mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 17:17:49 +01:00
35 lines
1,015 B
Dart
35 lines
1,015 B
Dart
import 'package:injectable/injectable.dart';
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
|
import 'package:revanced_manager/app/app.router.dart';
|
|
import 'package:revanced_manager/models/patch.dart';
|
|
import 'package:revanced_manager/models/patched_application.dart';
|
|
import 'package:stacked/stacked.dart';
|
|
import 'package:stacked_services/stacked_services.dart';
|
|
|
|
@lazySingleton
|
|
class PatcherViewModel extends BaseViewModel {
|
|
PatchedApplication? selectedApp;
|
|
List<Patch> selectedPatches = [];
|
|
|
|
final NavigationService _navigationService = locator<NavigationService>();
|
|
|
|
void navigateToAppSelector() {
|
|
_navigationService.navigateTo(Routes.appSelectorView);
|
|
}
|
|
|
|
void navigateToPatchesSelector() {
|
|
_navigationService.navigateTo(Routes.patchesSelectorView);
|
|
}
|
|
|
|
void navigateToInstaller() {
|
|
_navigationService.navigateTo(Routes.installerView);
|
|
}
|
|
|
|
bool showPatchButton() {
|
|
return selectedPatches.isNotEmpty;
|
|
}
|
|
|
|
bool dimPatchesCard() {
|
|
return selectedApp == null;
|
|
}
|
|
}
|