Updated text icon tile
This commit is contained in:
@@ -150,7 +150,6 @@ class _GroupDetailViewState extends State<GroupDetailView> {
|
|||||||
return TextIconTile(
|
return TextIconTile(
|
||||||
text: member.name,
|
text: member.name,
|
||||||
suffixText: getNameCountText(member),
|
suffixText: getNameCountText(member),
|
||||||
iconEnabled: false,
|
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ class TeamCard extends StatelessWidget {
|
|||||||
return TextIconTile(
|
return TextIconTile(
|
||||||
text: player.name,
|
text: player.name,
|
||||||
suffixText: getNameCountText(player),
|
suffixText: getNameCountText(player),
|
||||||
iconEnabled: false,
|
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ class _GroupTileState extends State<GroupTile> {
|
|||||||
TextIconTile(
|
TextIconTile(
|
||||||
text: member.name,
|
text: member.name,
|
||||||
suffixText: getNameCountText(member),
|
suffixText: getNameCountText(member),
|
||||||
iconEnabled: false,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,14 +4,12 @@ import 'package:tallee/core/custom_theme.dart';
|
|||||||
class TextIconTile extends StatelessWidget {
|
class TextIconTile extends StatelessWidget {
|
||||||
/// A tile widget that displays text with an optional icon that can be tapped.
|
/// A tile widget that displays text with an optional icon that can be tapped.
|
||||||
/// - [text]: The text to display in the tile.
|
/// - [text]: The text to display in the tile.
|
||||||
/// - [iconEnabled]: A boolean to determine if the icon should be displayed.
|
|
||||||
/// - [onIconTap]: The callback to be invoked when the icon is tapped.
|
/// - [onIconTap]: The callback to be invoked when the icon is tapped.
|
||||||
/// - [icon]: Optional custom icon. Defaults to [Icons.close].
|
/// - [icon]: Optional custom icon. Defaults to [Icons.close].
|
||||||
const TextIconTile({
|
const TextIconTile({
|
||||||
super.key,
|
super.key,
|
||||||
required this.text,
|
required this.text,
|
||||||
this.suffixText = '',
|
this.suffixText = '',
|
||||||
this.iconEnabled = true,
|
|
||||||
this.onIconTap,
|
this.onIconTap,
|
||||||
this.icon = Icons.close,
|
this.icon = Icons.close,
|
||||||
});
|
});
|
||||||
@@ -21,9 +19,6 @@ class TextIconTile extends StatelessWidget {
|
|||||||
|
|
||||||
final String suffixText;
|
final String suffixText;
|
||||||
|
|
||||||
/// A boolean to determine if the icon should be displayed.
|
|
||||||
final bool iconEnabled;
|
|
||||||
|
|
||||||
/// The callback to be invoked when the icon is tapped.
|
/// The callback to be invoked when the icon is tapped.
|
||||||
final VoidCallback? onIconTap;
|
final VoidCallback? onIconTap;
|
||||||
|
|
||||||
@@ -32,6 +27,8 @@ class TextIconTile extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final iconEnabled = onIconTap != null;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
Reference in New Issue
Block a user