listTileWithSub method

Widget listTileWithSub(
  1. String? title,
  2. BuildContext context,
  3. String? subtitle, {
  4. EdgeInsets? padding,
  5. Color? colorText,
  6. dynamic onTap()?,
  7. Widget? leading,
  8. Widget? trailing,
})

Implementation

Widget listTileWithSub(
  String? title,
  BuildContext context,
  String? subtitle, {
  EdgeInsets? padding,
  Color? colorText,
  Function()? onTap,
  Widget? leading,
  Widget? trailing,
}) {
  return Material(
    color: Colors.transparent,
    child: ListTile(
      onTap: onTap,
      leading: leading,
      trailing: trailing ??
          Icon(
            Icons.chevron_right,
          ),
      tileColor: Theme.of(context).colorScheme.background,
      contentPadding: padding ??
          EdgeInsets.symmetric(
              horizontal: DUI.spacing.lateralPaddingValue, vertical: 0),
      title: Text(
        title ?? '',
        style: TextStyle(
            fontSize: DUI.text.regularText,
            fontWeight: DUI.text.semiBoldWeight,
            color:
                colorText ?? Theme.of(context).textTheme.bodyMedium!.color),
      ),
      subtitle: subtitle == null
          ? null
          : Text(
              subtitle,
              style: TextStyle(
                  fontSize: DUI.text.smallText,
                  color: colorText ??
                      Theme.of(context).textTheme.bodyMedium!.color),
              textAlign: TextAlign.start,
            ),
    ),
  );
}