make non-clickable rows appear non-clickable

This commit is contained in:
fosse 2024-01-17 11:12:54 -05:00
parent edbf25bc71
commit a2a5d6deea

View file

@ -16,9 +16,7 @@ class StandardListRow extends StatelessWidget {
final leading = buildLeading(context);
final trailing = buildTrailing(context);
return InkWell(
onTap: () => onTap?.call(context),
child: Container(
final base = Container(
height: 56,
padding: EdgeInsets.only(left: 24, right: 24),
decoration: decoration ??
@ -33,8 +31,16 @@ class StandardListRow extends StatelessWidget {
if (trailing != null) trailing,
],
),
),
);
if (onTap != null) {
return InkWell(
onTap: () => onTap?.call(context),
child: base,
);
} else {
return base;
}
}
Widget? buildLeading(BuildContext context) => null;