backup: before proxies page modernization
This commit is contained in:
@@ -113,3 +113,20 @@ class PerAppProxyList extends _$PerAppProxyList {
|
||||
return _exclude.write(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
class ExcludedDomainsList extends _$ExcludedDomainsList {
|
||||
late final _pref = PreferencesEntry(
|
||||
preferences: ref.watch(sharedPreferencesProvider).requireValue,
|
||||
key: "excluded_domains_list",
|
||||
defaultValue: <String>[],
|
||||
);
|
||||
|
||||
@override
|
||||
List<String> build() => _pref.read();
|
||||
|
||||
Future<void> update(List<String> value) {
|
||||
state = value;
|
||||
return _pref.write(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ part 'app_router.g.dart';
|
||||
|
||||
bool _debugMobileRouter = false;
|
||||
|
||||
final useMobileRouter =
|
||||
!PlatformUtils.isDesktop || (kDebugMode && _debugMobileRouter);
|
||||
final useMobileRouter = !PlatformUtils.isDesktop || (kDebugMode && _debugMobileRouter);
|
||||
final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
// TODO: test and improve handling of deep link
|
||||
@@ -53,6 +52,7 @@ GoRouter router(RouterRef ref) {
|
||||
final tabLocations = [
|
||||
const HomeRoute().location,
|
||||
const ProxiesRoute().location,
|
||||
const PerAppProxyRoute().location,
|
||||
const ConfigOptionsRoute().location,
|
||||
const SettingsRoute().location,
|
||||
const LogsOverviewRoute().location,
|
||||
@@ -77,9 +77,7 @@ void switchTab(int index, BuildContext context) {
|
||||
}
|
||||
|
||||
@riverpod
|
||||
class RouterListenable extends _$RouterListenable
|
||||
with AppLogger
|
||||
implements Listenable {
|
||||
class RouterListenable extends _$RouterListenable with AppLogger implements Listenable {
|
||||
VoidCallback? _routerListener;
|
||||
bool _introCompleted = false;
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ class AppTheme {
|
||||
final String fontFamily;
|
||||
|
||||
ThemeData lightTheme(ColorScheme? lightColorScheme) {
|
||||
final ColorScheme scheme = lightColorScheme ??
|
||||
ColorScheme.fromSeed(seedColor: const Color(0xFF293CA0));
|
||||
final ColorScheme scheme = lightColorScheme ?? ColorScheme.fromSeed(seedColor: const Color(0xFF293CA0));
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: scheme,
|
||||
@@ -29,8 +28,7 @@ class AppTheme {
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: scheme,
|
||||
scaffoldBackgroundColor:
|
||||
mode.trueBlack ? Colors.black : scheme.background,
|
||||
scaffoldBackgroundColor: mode.trueBlack ? Colors.black : scheme.background,
|
||||
fontFamily: fontFamily,
|
||||
extensions: const <ThemeExtension<dynamic>>{
|
||||
ConnectionButtonTheme.light,
|
||||
|
||||
@@ -8,19 +8,13 @@ part 'theme_preferences.g.dart';
|
||||
class ThemePreferences extends _$ThemePreferences {
|
||||
@override
|
||||
AppThemeMode build() {
|
||||
final persisted = ref
|
||||
.watch(sharedPreferencesProvider)
|
||||
.requireValue
|
||||
.getString("theme_mode");
|
||||
final persisted = ref.watch(sharedPreferencesProvider).requireValue.getString("theme_mode");
|
||||
if (persisted == null) return AppThemeMode.system;
|
||||
return AppThemeMode.values.byName(persisted);
|
||||
}
|
||||
|
||||
Future<void> changeThemeMode(AppThemeMode value) async {
|
||||
state = value;
|
||||
await ref
|
||||
.read(sharedPreferencesProvider)
|
||||
.requireValue
|
||||
.setString("theme_mode", value.name);
|
||||
await ref.read(sharedPreferencesProvider).requireValue.setString("theme_mode", value.name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user