listTile method

Widget listTile(
  1. String? text,
  2. BuildContext context,
  3. dynamic onTap(), {
  4. EdgeInsets? padding,
  5. Color? colorText,
  6. bool? loading = false,
  7. Widget? leading,
  8. Widget? trailing,
})

Implementation

Widget listTile(
  String? text,
  BuildContext context,
  Function() onTap, {
  EdgeInsets? padding,
  Color? colorText,
  bool? loading = false,
  Widget? leading,
  Widget? trailing,
}) {
  return Material(
    color: Colors.transparent,
    child: ListTile(
      tileColor: Theme.of(context).colorScheme.background,
      contentPadding: padding ??
          EdgeInsets.symmetric(
              horizontal: DUI.spacing.lateralPaddingValue, vertical: 0),
      title: DUI.text.regular(context, text ?? '',
          color: colorText ?? Theme.of(context).textTheme.bodyMedium!.color),
      trailing: loading!
          ? DUI.misc.loadingAnimation(context, size: 18)
          : trailing ??
              Icon(
                Icons.chevron_right,
              ),
      leading: leading,
      onTap: onTap,
    ),
  );
}