mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 20:57:36 +02:00
feat: root and nonroot toggle.
This commit is contained in:
@ -1,9 +1,18 @@
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/app/app.router.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
class SettingsViewModel extends BaseViewModel {
|
||||
bool isRooted = false;
|
||||
|
||||
Future<void> initialize() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
isRooted = prefs.getBool('isRooted') ?? false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
final NavigationService _navigationService = locator<NavigationService>();
|
||||
|
||||
void setLanguage(String language) {
|
||||
@ -13,4 +22,8 @@ class SettingsViewModel extends BaseViewModel {
|
||||
void navigateToContributors() {
|
||||
_navigationService.navigateTo(Routes.contributorsView);
|
||||
}
|
||||
|
||||
void navigateToRootChecker() {
|
||||
_navigationService.navigateTo(Routes.rootCheckerView);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user