toListTile method

Widget toListTile(
  1. BuildContext context, {
  2. Key? key,
  3. bool? isCard,
  4. double iconSize = 30,
  5. VoidCallback? onTap,
})

Implementation

Widget toListTile(BuildContext context,
    {Key? key, bool? isCard, double iconSize = 30, VoidCallback? onTap}) {
  Widget? trailing;
  final thisTrailing = this.trailing;
  if (thisTrailing != null) {
    if (thisTrailing is Widget) trailing = thisTrailing;
    if (thisTrailing is String) trailing = LinkText(thisTrailing);
  }
  return PlatformListTile(
    key: key,
    useShadow: isCard ?? true,
    // dense: isCard == false,
    margin: isCard == false ? EdgeInsets.zero : null,
    onTap: onTap == null ? null : (context) => onTap(),
    title: TileTitle.of(title),
    subtitle: subtitle.toColumn(),
    leading: context.findIcon(icon!)?.toListSelectOption(),
    trailing: trailing,
  );
}