fix: improve patches selector.

This commit is contained in:
Alberto Ponces
2022-08-09 02:30:12 +01:00
parent 6338eb5dd1
commit 84923127e2
9 changed files with 95 additions and 26 deletions

View File

@ -17,12 +17,15 @@ class PatcherView extends StatelessWidget {
disposeViewModel: false,
viewModelBuilder: () => locator<PatcherViewModel>(),
builder: (context, model, child) => Scaffold(
floatingActionButton: FloatingActionButton.extended(
onPressed: () => {},
label: I18nText('patcherView.fabButton'),
icon: const Icon(Icons.build),
backgroundColor: const Color(0xff7792BA),
foregroundColor: Colors.white,
floatingActionButton: Visibility(
visible: locator<PatcherViewModel>().hideFabButton,
child: FloatingActionButton.extended(
onPressed: () => {},
label: I18nText('patcherView.fabButton'),
icon: const Icon(Icons.build),
backgroundColor: const Color(0xff7792BA),
foregroundColor: Colors.white,
),
),
body: SafeArea(
child: Padding(
@ -46,8 +49,11 @@ class PatcherView extends StatelessWidget {
onPressed: model.navigateToAppSelector,
),
const SizedBox(height: 16),
PatchSelectorCard(
onPressed: model.navigateToPatchesSelector,
Opacity(
opacity: model.dimPatchCard ? 0.5 : 1,
child: PatchSelectorCard(
onPressed: model.navigateToPatchesSelector,
),
),
],
),

View File

@ -5,6 +5,8 @@ import 'package:stacked_services/stacked_services.dart';
class PatcherViewModel extends BaseViewModel {
final _navigationService = locator<NavigationService>();
bool dimPatchCard = true;
bool hideFabButton = true;
void navigateToAppSelector() {
_navigationService.navigateTo(Routes.appSelectorView);