diff options
author | uvok | 2025-08-01 15:07:26 +0200 |
---|---|---|
committer | uvok | 2025-08-01 15:07:26 +0200 |
commit | 220eae3eb135eac5b03122d95d6fbc8c3bde2513 (patch) | |
tree | a67cc7ef330f7f4ea18442ac2e15e3bde8ad2d75 /lib/widgets | |
parent | 5c1ffb1caa83681b9bb128841c6919ccfc1823e7 (diff) |
Add proper selection/setting motive
Diffstat (limited to 'lib/widgets')
-rw-r--r-- | lib/widgets/badge_motive_list.dart | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/widgets/badge_motive_list.dart b/lib/widgets/badge_motive_list.dart index 1da85fa..e59eeeb 100644 --- a/lib/widgets/badge_motive_list.dart +++ b/lib/widgets/badge_motive_list.dart @@ -55,12 +55,15 @@ class _BadgeMotiveListState extends State<BadgeMotiveList> { title: Text(item.description), selectedTileColor: mytheme.primaryColorLight, selectedColor: Colors.black, - onTap: () { - setState(() { - _selectedIndex = index; - }); - widget.onItemSelected(item); - }, + onTap: !widget._motiveVM.allowSelection + ? null + : () async { + setState(() { + _selectedIndex = index; + }); + widget.onItemSelected(item); + await widget._motiveVM.setMotive(item); + }, selected: _selectedIndex == index, ); }, |