backup: before proxies page modernization

This commit is contained in:
Hiddify User
2025-12-26 02:39:35 +03:00
parent 6e73e53fb6
commit 063f2464ee
25 changed files with 1395 additions and 609 deletions

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -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,

View File

@@ -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);
}
}