mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-19 15:37:43 +08:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
d2b09936d1 | |||
68e9f0f7c1 | |||
c3d345de80 | |||
385c0e246a | |||
5ead49a5b7 | |||
c0760b1347 | |||
e01b323aee | |||
6f4866ef63 |
@ -90,7 +90,7 @@ class _DynamicThemeBuilderState extends State<DynamicThemeBuilder> with WidgetsB
|
||||
4: darkCustomTheme,
|
||||
5: darkDynamicTheme,
|
||||
},
|
||||
fallbackTheme: brightness == Brightness.light ? lightCustomTheme : darkCustomTheme,
|
||||
fallbackTheme: PlatformDispatcher.instance.platformBrightness == Brightness.light ? lightCustomTheme : darkCustomTheme,
|
||||
),
|
||||
builder: (context, theme) => MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
|
@ -1,4 +1,5 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:dynamic_themes/dynamic_themes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@ -30,9 +31,23 @@ class NavigationViewModel extends IndexTrackingViewModel {
|
||||
);
|
||||
}
|
||||
|
||||
final dynamicTheme = DynamicTheme.of(context)!;
|
||||
if (prefs.getInt('themeMode') == null) {
|
||||
await prefs.setInt('themeMode', 0);
|
||||
await dynamicTheme.setTheme(0);
|
||||
}
|
||||
|
||||
// Force disable Material You on Android 11 and below
|
||||
if (dynamicTheme.themeId.isOdd) {
|
||||
const int ANDROID_12_SDK_VERSION = 31;
|
||||
final AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
||||
if (info.version.sdkInt < ANDROID_12_SDK_VERSION) {
|
||||
await prefs.setInt('themeMode', 0);
|
||||
await prefs.setBool('useDynamicTheme', false);
|
||||
await dynamicTheme.setTheme(0);
|
||||
}
|
||||
}
|
||||
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
SystemUiOverlayStyle(
|
||||
|
@ -157,6 +157,7 @@ class SUpdateThemeUI extends StatelessWidget {
|
||||
label: sUpdateTheme.getThemeModeName(),
|
||||
onPressed: () => { sUpdateTheme.showThemeDialog(context) },
|
||||
),
|
||||
onTap: () => { sUpdateTheme.showThemeDialog(context) },
|
||||
),
|
||||
FutureBuilder<int>(
|
||||
future: _settingViewModel.getSdkVersion(),
|
||||
|
@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
||||
|
||||
publish_to: 'none'
|
||||
|
||||
version: 1.10.0+101000000
|
||||
version: 1.10.2+101000200
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
Reference in New Issue
Block a user