mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-22 18:53:57 +00:00
feat: improve app theming code and add Material You (#58)
This commit is contained in:
@@ -17,11 +17,6 @@ class RootCheckerView extends StatelessWidget {
|
||||
label: I18nText('rootCheckerView.nonRootButton'),
|
||||
icon: const Icon(Icons.keyboard_arrow_right),
|
||||
onPressed: () => model.navigateAsNonRoot(),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
foregroundColor: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
body: Container(
|
||||
height: double.infinity,
|
||||
@@ -41,10 +36,10 @@ class RootCheckerView extends StatelessWidget {
|
||||
const SizedBox(height: 24),
|
||||
I18nText(
|
||||
'rootCheckerView.widgetDescription',
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'',
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.roboto(
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
letterSpacing: 1.1,
|
||||
),
|
||||
@@ -62,10 +57,6 @@ class RootCheckerView extends StatelessWidget {
|
||||
translationParams: {
|
||||
'isRooted': model.isRooted.toString(),
|
||||
},
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.poppins(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -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