mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-27 04:51:03 +00:00
feat: improve app theming code and add Material You (#58)
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
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:revanced_manager/services/manager_api.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:root/root.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
class RootCheckerViewModel extends BaseViewModel {
|
||||
final NavigationService _navigationService = locator<NavigationService>();
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
bool isRooted = false;
|
||||
|
||||
Future<void> navigateAsRoot() async {
|
||||
@@ -25,8 +26,7 @@ class RootCheckerViewModel extends BaseViewModel {
|
||||
}
|
||||
|
||||
Future<void> navigateToHome() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setBool('isRooted', isRooted);
|
||||
_managerAPI.setIsRooted(isRooted);
|
||||
_navigationService.navigateTo(Routes.navigation);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user