2022-08-18 15:33:33 +01:00
|
|
|
import 'package:injectable/injectable.dart';
|
2022-08-06 22:35:35 +01:00
|
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
|
|
|
import 'package:revanced_manager/app/app.router.dart';
|
2022-08-18 15:33:33 +01:00
|
|
|
import 'package:revanced_manager/models/patch.dart';
|
|
|
|
import 'package:revanced_manager/models/patched_application.dart';
|
2022-08-06 17:43:28 +05:30
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
import 'package:stacked_services/stacked_services.dart';
|
|
|
|
|
2022-08-18 15:33:33 +01:00
|
|
|
@lazySingleton
|
2022-08-06 17:43:28 +05:30
|
|
|
class PatcherViewModel extends BaseViewModel {
|
2022-08-18 15:33:33 +01:00
|
|
|
PatchedApplication? selectedApp;
|
|
|
|
List<Patch> selectedPatches = [];
|
|
|
|
|
|
|
|
final NavigationService _navigationService = locator<NavigationService>();
|
2022-08-06 17:43:28 +05:30
|
|
|
|
|
|
|
void navigateToAppSelector() {
|
2022-08-08 00:45:52 +05:30
|
|
|
_navigationService.navigateTo(Routes.appSelectorView);
|
|
|
|
}
|
|
|
|
|
|
|
|
void navigateToPatchesSelector() {
|
|
|
|
_navigationService.navigateTo(Routes.patchesSelectorView);
|
2022-08-06 17:43:28 +05:30
|
|
|
}
|
2022-08-13 10:56:30 +01:00
|
|
|
|
|
|
|
void navigateToInstaller() {
|
|
|
|
_navigationService.navigateTo(Routes.installerView);
|
|
|
|
}
|
2022-08-17 12:48:03 +01:00
|
|
|
|
|
|
|
bool showFabButton() {
|
2022-08-18 15:33:33 +01:00
|
|
|
return selectedPatches.isNotEmpty;
|
2022-08-17 12:48:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool dimPatchesCard() {
|
2022-08-18 15:33:33 +01:00
|
|
|
return selectedApp == null;
|
2022-08-17 12:48:03 +01:00
|
|
|
}
|
2022-08-06 17:43:28 +05:30
|
|
|
}
|