uiExpandedTile method

Widget uiExpandedTile({
  1. required List<Widget> children,
  2. required Widget title,
  3. Key? key,
  4. bool enabled = true,
  5. bool initiallyExpanded = false,
  6. dynamic leading,
  7. ExpansionTileThemeData? style,
  8. Widget? subtitle,
  9. dynamic trailing,
})

Provides the ability to have an expansion list of widgets.

Implementation

Widget uiExpandedTile({
  required List<Widget> children,
  required Widget title,
  Key? key,
  bool enabled = true,
  bool initiallyExpanded = false,
  dynamic leading,
  ExpansionTileThemeData? style,
  Widget? subtitle,
  dynamic trailing,
}) {
  // Make sure we are using things properly
  assert(
    leading is IconData || leading is Image || leading == null,
    "leading can only be an Image, IconData, or null type",
  );
  assert(
    trailing is IconData || trailing is Image || trailing == null,
    "trailing can only be an Image, IconData, or null type",
  );

  final w = ExpansionTile(
    key: key,
    enabled: enabled,
    leading: leading is IconData ? Icon(leading) : leading,
    initiallyExpanded: false,
    title: title,
    subtitle: subtitle,
    trailing: trailing is IconData ? Icon(trailing) : trailing,
    children: children,
  );

  return style != null ? ExpansionTileTheme(data: style, child: w) : w;
}