listTile method
Widget
listTile(
- String? text,
- BuildContext context,
- dynamic onTap(), {
- EdgeInsets? padding,
- Color? colorText,
- bool? loading = false,
- Widget? leading,
- 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,
),
);
}