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
This commit is contained in:
Boris M 2022-11-09 08:32:39 +01:00 committed by GitHub
parent 0fc8e7cbc8
commit 2c3809d2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 11 deletions

View File

@ -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();

View File

@ -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