Skip to content

Commit

Permalink
feat: show selected patches count in patches selector view & patch se…
Browse files Browse the repository at this point in the history
…lector 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
  • Loading branch information
Mipirakas authored Nov 9, 2022
1 parent 0fc8e7c commit 2c3809d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
7 changes: 6 additions & 1 deletion lib/ui/views/patches_selector/patches_selector_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
floatingActionButton: Visibility(
visible: model.patches.isNotEmpty,
child: FloatingActionButton.extended(
label: I18nText('patchesSelectorView.doneButton'),
label: Row(
children: <Widget>[
I18nText('patchesSelectorView.doneButton'),
Text(' (${model.selectedPatches.length})')
],
),
icon: const Icon(Icons.check),
onPressed: () {
model.selectPatches();
Expand Down
33 changes: 23 additions & 10 deletions lib/ui/widgets/patcherView/patch_selector_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,30 @@ class PatchSelectorCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
I18nText(
locator<PatcherViewModel>().selectedPatches.isEmpty
? 'patchSelectorCard.widgetTitle'
: 'patchSelectorCard.widgetTitleSelected',
child: const Text(
'',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
Row(
children: <Widget>[
I18nText(
locator<PatcherViewModel>().selectedPatches.isEmpty
? 'patchSelectorCard.widgetTitle'
: 'patchSelectorCard.widgetTitleSelected',
child: const Text(
'',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
),
Text(
locator<PatcherViewModel>().selectedPatches.isEmpty
? ''
: ' (${locator<PatcherViewModel>().selectedPatches.length})',
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 4),
locator<PatcherViewModel>().selectedApp == null
Expand Down

0 comments on commit 2c3809d

Please sign in to comment.