From 2c3809d2bc87921e4bbb999b4c65b9ebb4981bba Mon Sep 17 00:00:00 2001 From: Boris M Date: Wed, 9 Nov 2022 08:32:39 +0100 Subject: [PATCH] feat: show selected patches count in patches selector view & patch selector card (#466) * feat: show selected patches count in patches selector view & patch selector card * fix: add Widget on row * fix: formatting * fix: same text style for count --- .../patches_selector_view.dart | 7 +++- .../patcherView/patch_selector_card.dart | 33 +++++++++++++------ 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index 35092327..84ed6b0a 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -25,7 +25,12 @@ class _PatchesSelectorViewState extends State { floatingActionButton: Visibility( visible: model.patches.isNotEmpty, child: FloatingActionButton.extended( - label: I18nText('patchesSelectorView.doneButton'), + label: Row( + children: [ + I18nText('patchesSelectorView.doneButton'), + Text(' (${model.selectedPatches.length})') + ], + ), icon: const Icon(Icons.check), onPressed: () { model.selectPatches(); diff --git a/lib/ui/widgets/patcherView/patch_selector_card.dart b/lib/ui/widgets/patcherView/patch_selector_card.dart index d9c25e1e..2a432d66 100644 --- a/lib/ui/widgets/patcherView/patch_selector_card.dart +++ b/lib/ui/widgets/patcherView/patch_selector_card.dart @@ -20,17 +20,30 @@ class PatchSelectorCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - I18nText( - locator().selectedPatches.isEmpty - ? 'patchSelectorCard.widgetTitle' - : 'patchSelectorCard.widgetTitleSelected', - child: const Text( - '', - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w500, + Row( + children: [ + I18nText( + locator().selectedPatches.isEmpty + ? 'patchSelectorCard.widgetTitle' + : 'patchSelectorCard.widgetTitleSelected', + child: const Text( + '', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), ), - ), + Text( + locator().selectedPatches.isEmpty + ? '' + : ' (${locator().selectedPatches.length})', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], ), const SizedBox(height: 4), locator().selectedApp == null