fix: use square FABs instead of round FABs to comply with MD3

This commit is contained in:
Alberto Ponces 2022-08-31 09:32:10 +01:00
parent c0b164ec26
commit 2427b0847d
5 changed files with 18 additions and 12 deletions

View file

@ -31,7 +31,7 @@
}, },
"patcherView": { "patcherView": {
"widgetTitle": "Patcher", "widgetTitle": "Patcher",
"fabButton": "Patch" "patchButton": "Patch"
}, },
"appSelectorCard": { "appSelectorCard": {
"widgetTitle": "Select application", "widgetTitle": "Select application",
@ -50,7 +50,7 @@
}, },
"appSelectorView": { "appSelectorView": {
"searchBarHint": "Search applications", "searchBarHint": "Search applications",
"fabButton": "Storage", "storageButton": "Storage",
"errorMessage": "Unable to use selected application." "errorMessage": "Unable to use selected application."
}, },
"patchesSelectorView": { "patchesSelectorView": {

View file

@ -23,12 +23,17 @@ class _AppSelectorViewState extends State<AppSelectorView> {
viewModelBuilder: () => AppSelectorViewModel(), viewModelBuilder: () => AppSelectorViewModel(),
builder: (context, model, child) => Scaffold( builder: (context, model, child) => Scaffold(
floatingActionButton: FloatingActionButton.extended( floatingActionButton: FloatingActionButton.extended(
label: I18nText('appSelectorView.storageButton'),
icon: const Icon(Icons.sd_storage),
onPressed: () { onPressed: () {
model.selectAppFromStorage(context); model.selectAppFromStorage(context);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
label: I18nText('appSelectorView.fabButton'), shape: const RoundedRectangleBorder(
icon: const Icon(Icons.sd_storage), borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
),
backgroundColor: Theme.of(context).colorScheme.secondary, backgroundColor: Theme.of(context).colorScheme.secondary,
foregroundColor: Colors.white, foregroundColor: Colors.white,
), ),

View file

@ -12,10 +12,6 @@ class ContributorsView extends StatelessWidget {
viewModelBuilder: () => ContributorsViewModel(), viewModelBuilder: () => ContributorsViewModel(),
onModelReady: (model) => model.getContributors(), onModelReady: (model) => model.getContributors(),
builder: (context, model, child) => Scaffold( builder: (context, model, child) => Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () => model.getContributors(),
child: const Icon(Icons.refresh),
),
body: SafeArea( body: SafeArea(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(

View file

@ -18,11 +18,16 @@ class PatcherView extends StatelessWidget {
viewModelBuilder: () => locator<PatcherViewModel>(), viewModelBuilder: () => locator<PatcherViewModel>(),
builder: (context, model, child) => Scaffold( builder: (context, model, child) => Scaffold(
floatingActionButton: Visibility( floatingActionButton: Visibility(
visible: model.showFabButton(), visible: model.showPatchButton(),
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
onPressed: () => model.navigateToInstaller(), label: I18nText('patcherView.patchButton'),
label: I18nText('patcherView.fabButton'),
icon: const Icon(Icons.build), icon: const Icon(Icons.build),
onPressed: () => model.navigateToInstaller(),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
),
backgroundColor: Theme.of(context).colorScheme.secondary, backgroundColor: Theme.of(context).colorScheme.secondary,
foregroundColor: Colors.white, foregroundColor: Colors.white,
), ),

View file

@ -25,7 +25,7 @@ class PatcherViewModel extends BaseViewModel {
_navigationService.navigateTo(Routes.installerView); _navigationService.navigateTo(Routes.installerView);
} }
bool showFabButton() { bool showPatchButton() {
return selectedPatches.isNotEmpty; return selectedPatches.isNotEmpty;
} }