2022-08-06 23:35:35 +02:00
|
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
|
|
|
import 'package:revanced_manager/app/app.router.dart';
|
2022-08-17 13:48:03 +02:00
|
|
|
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
|
|
|
|
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
2022-08-06 14:13:28 +02:00
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
import 'package:stacked_services/stacked_services.dart';
|
|
|
|
|
|
|
|
class PatcherViewModel extends BaseViewModel {
|
2022-08-07 21:15:52 +02:00
|
|
|
final _navigationService = locator<NavigationService>();
|
2022-08-06 14:13:28 +02:00
|
|
|
|
|
|
|
void navigateToAppSelector() {
|
2022-08-07 21:15:52 +02:00
|
|
|
_navigationService.navigateTo(Routes.appSelectorView);
|
|
|
|
}
|
|
|
|
|
|
|
|
void navigateToPatchesSelector() {
|
|
|
|
_navigationService.navigateTo(Routes.patchesSelectorView);
|
2022-08-06 14:13:28 +02:00
|
|
|
}
|
2022-08-13 11:56:30 +02:00
|
|
|
|
|
|
|
void navigateToInstaller() {
|
|
|
|
_navigationService.navigateTo(Routes.installerView);
|
|
|
|
}
|
2022-08-17 13:48:03 +02:00
|
|
|
|
|
|
|
bool showFabButton() {
|
|
|
|
return locator<PatchesSelectorViewModel>().selectedPatches.isNotEmpty;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool dimPatchesCard() {
|
|
|
|
return locator<AppSelectorViewModel>().selectedApp == null;
|
|
|
|
}
|
2022-08-06 14:13:28 +02:00
|
|
|
}
|