mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: hide FAB when no patches selected.
This commit is contained in:
parent
84923127e2
commit
cc47584643
@ -18,7 +18,7 @@ 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: locator<PatcherViewModel>().hideFabButton,
|
visible: locator<PatcherViewModel>().showFabButton,
|
||||||
child: FloatingActionButton.extended(
|
child: FloatingActionButton.extended(
|
||||||
onPressed: () => {},
|
onPressed: () => {},
|
||||||
label: I18nText('patcherView.fabButton'),
|
label: I18nText('patcherView.fabButton'),
|
||||||
|
@ -6,7 +6,7 @@ import 'package:stacked_services/stacked_services.dart';
|
|||||||
class PatcherViewModel extends BaseViewModel {
|
class PatcherViewModel extends BaseViewModel {
|
||||||
final _navigationService = locator<NavigationService>();
|
final _navigationService = locator<NavigationService>();
|
||||||
bool dimPatchCard = true;
|
bool dimPatchCard = true;
|
||||||
bool hideFabButton = true;
|
bool showFabButton = false;
|
||||||
|
|
||||||
void navigateToAppSelector() {
|
void navigateToAppSelector() {
|
||||||
_navigationService.navigateTo(Routes.appSelectorView);
|
_navigationService.navigateTo(Routes.appSelectorView);
|
||||||
|
@ -33,8 +33,8 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
locator<PatcherViewModel>().hideFabButton =
|
locator<PatcherViewModel>().showFabButton =
|
||||||
selectedPatches.isEmpty ? true : false;
|
selectedPatches.isNotEmpty ? true : false;
|
||||||
locator<PatcherViewModel>().notifyListeners();
|
locator<PatcherViewModel>().notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user