Skip to content

Commit

Permalink
Allow suffix icon to be cutomised
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Nov 5, 2024
1 parent 944870c commit a96e5ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/pages/docs/tile/select-menu-tile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ FSelectMenuTile<Value>(
title: Text('Notifications'),
subtitle: Text('subtitle'),
details: Text('All'),
suffixIcon: FIcon(FAssets.icons.chevronsUpDown),
menu: [
FSelectTile(
label: const Text('1'),
Expand Down
6 changes: 5 additions & 1 deletion forui/lib/src/widgets/select_menu_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class FSelectMenuTile<T> extends FormField<Set<T>> with FTileMixin {
/// The details.
final Widget? details;

/// The suffix icon. Defaults to `FAssets.icons.chevronsUpDown`.
final Widget? suffixIcon;

/// Creates a [FSelectMenuTile].
FSelectMenuTile({
required this.groupController,
Expand All @@ -133,6 +136,7 @@ class FSelectMenuTile<T> extends FormField<Set<T>> with FTileMixin {
this.prefixIcon,
this.subtitle,
this.details,
this.suffixIcon,
super.onSaved,
super.validator,
super.initialValue,
Expand Down Expand Up @@ -195,7 +199,7 @@ class FSelectMenuTile<T> extends FormField<Set<T>> with FTileMixin {
title: title,
subtitle: subtitle,
details: details,
suffixIcon: FIcon(FAssets.icons.chevronsUpDown),
suffixIcon: suffixIcon ?? FIcon(FAssets.icons.chevronsUpDown),
onPress: state._controller._popover.toggle,
),
);
Expand Down

0 comments on commit a96e5ca

Please sign in to comment.