added oled theme and theme presets
Android CI / Build and Test (pull_request) Failing after 11m39s
Flutter / build (BalanceFlutter/build/ios/iphoneos/*.app, macos-latest, ios) (push) Canceled after 0s
Flutter / build (BalanceFlutter/build/macos/Build/Products/Release/*.app, macos-latest, macos) (push) Canceled after 0s
Flutter / build (BalanceFlutter/build/windows/x64/runner/Release, windows-latest, windows) (push) Canceled after 0s
Flutter / watchos (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (push) Canceled after 0s
Flutter / checks (push) Successful in 25m8s
Flutter / build (BalanceFlutter/build/app/outputs/flutter-apk/*.apk, ubuntu-latest, android) (push) Failing after 38m6s
Flutter / build (BalanceFlutter/build/linux/x64/release/bundle, ubuntu-latest, linux) (push) Successful in 32m37s
Flutter / build (BalanceFlutter/build/web, ubuntu-latest, web) (push) Successful in 31m39s
iOS CI / Build and Test SwiftUI App (pull_request) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (pull_request) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (pull_request) Canceled after 0s
Flutter / build (BalanceFlutter/build/ios/iphoneos/*.app, macos-latest, ios) (pull_request) Canceled after 0s
Flutter / build (BalanceFlutter/build/macos/Build/Products/Release/*.app, macos-latest, macos) (pull_request) Canceled after 0s
Flutter / build (BalanceFlutter/build/windows/x64/runner/Release, windows-latest, windows) (pull_request) Canceled after 0s
Flutter / watchos (pull_request) Canceled after 0s
Flutter / checks (pull_request) Successful in 24m59s
Flutter / build (BalanceFlutter/build/app/outputs/flutter-apk/*.apk, ubuntu-latest, android) (pull_request) Failing after 31m24s
Flutter / build (BalanceFlutter/build/linux/x64/release/bundle, ubuntu-latest, linux) (pull_request) Successful in 32m34s
Flutter / build (BalanceFlutter/build/web, ubuntu-latest, web) (pull_request) Successful in 24m54s
Android CI / Build and Test (pull_request) Failing after 11m39s
Flutter / build (BalanceFlutter/build/ios/iphoneos/*.app, macos-latest, ios) (push) Canceled after 0s
Flutter / build (BalanceFlutter/build/macos/Build/Products/Release/*.app, macos-latest, macos) (push) Canceled after 0s
Flutter / build (BalanceFlutter/build/windows/x64/runner/Release, windows-latest, windows) (push) Canceled after 0s
Flutter / watchos (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (push) Canceled after 0s
Flutter / checks (push) Successful in 25m8s
Flutter / build (BalanceFlutter/build/app/outputs/flutter-apk/*.apk, ubuntu-latest, android) (push) Failing after 38m6s
Flutter / build (BalanceFlutter/build/linux/x64/release/bundle, ubuntu-latest, linux) (push) Successful in 32m37s
Flutter / build (BalanceFlutter/build/web, ubuntu-latest, web) (push) Successful in 31m39s
iOS CI / Build and Test SwiftUI App (pull_request) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (pull_request) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (pull_request) Canceled after 0s
Flutter / build (BalanceFlutter/build/ios/iphoneos/*.app, macos-latest, ios) (pull_request) Canceled after 0s
Flutter / build (BalanceFlutter/build/macos/Build/Products/Release/*.app, macos-latest, macos) (pull_request) Canceled after 0s
Flutter / build (BalanceFlutter/build/windows/x64/runner/Release, windows-latest, windows) (pull_request) Canceled after 0s
Flutter / watchos (pull_request) Canceled after 0s
Flutter / checks (pull_request) Successful in 24m59s
Flutter / build (BalanceFlutter/build/app/outputs/flutter-apk/*.apk, ubuntu-latest, android) (pull_request) Failing after 31m24s
Flutter / build (BalanceFlutter/build/linux/x64/release/bundle, ubuntu-latest, linux) (pull_request) Successful in 32m34s
Flutter / build (BalanceFlutter/build/web, ubuntu-latest, web) (pull_request) Successful in 24m54s
This commit is contained in:
1 parent
2c278044bb
commit
a2aa714a83
16 files changed
+436
-42
No files matched your search
@@ -7,6 +7,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import '../domain/finance.dart';
|
||||
import '../domain/appearance.dart';
|
||||
import 'storage.dart';
|
||||
import 'runtime_lock.dart';
|
||||
import 'sync_api.dart';
|
||||
@@ -62,6 +63,7 @@ class AppStore extends ChangeNotifier with WidgetsBindingObserver {
|
||||
String serverUrl = '';
|
||||
String currency = 'RUB';
|
||||
String theme = 'system';
|
||||
String themePreset = 'forest';
|
||||
AuthSession? session;
|
||||
String? sessionPersistenceWarning;
|
||||
String get email => session?.email ?? '';
|
||||
@@ -121,6 +123,7 @@ class AppStore extends ChangeNotifier with WidgetsBindingObserver {
|
||||
serverUrl = _preferences!.getString('serverUrl') ?? serverUrl;
|
||||
currency = _preferences!.getString('currency') ?? currency;
|
||||
theme = _preferences!.getString('theme') ?? theme;
|
||||
themePreset = ColorPreset.fromId(_preferences!.getString('themePreset')).id;
|
||||
_deviceId = _preferences!.getString('deviceId') ?? newId();
|
||||
await _preferences!.setString('deviceId', _deviceId);
|
||||
_storage ??= await LedgerStorage.open();
|
||||
@@ -147,6 +150,7 @@ class AppStore extends ChangeNotifier with WidgetsBindingObserver {
|
||||
}
|
||||
currency = _preferences!.getString('currency') ?? 'RUB';
|
||||
theme = _preferences!.getString('theme') ?? 'system';
|
||||
themePreset = ColorPreset.fromId(_preferences!.getString('themePreset')).id;
|
||||
_deviceId = _preferences!.getString('deviceId') ?? _deviceId;
|
||||
await _restoreSession();
|
||||
await _loadScope();
|
||||
@@ -481,10 +485,26 @@ class AppStore extends ChangeNotifier with WidgetsBindingObserver {
|
||||
_notify();
|
||||
});
|
||||
Future<void> setTheme(String value) => _exclusive(() async {
|
||||
if (!const ['system', 'light', 'dark'].contains(value)) {
|
||||
throw ArgumentError('Неизвестный режим темы');
|
||||
}
|
||||
theme = value;
|
||||
await _preferences!.setString('theme', value);
|
||||
_notify();
|
||||
});
|
||||
Future<void> setThemePreset(String value) => _exclusive(() async {
|
||||
if (!ColorPreset.values.any((preset) => preset.id == value)) {
|
||||
throw ArgumentError('Неизвестный пресет');
|
||||
}
|
||||
await _preferences!.setString('themePreset', value);
|
||||
themePreset = value;
|
||||
if (value == ColorPreset.oled.id) {
|
||||
await _preferences!.setString('theme', 'dark');
|
||||
theme = 'dark';
|
||||
}
|
||||
_notify();
|
||||
});
|
||||
|
||||
Future<void> setServerUrl(String value) => _exclusive(() async {
|
||||
final normalized = value.trim().replaceAll(RegExp(r'/+$'), '');
|
||||
final uri = Uri.tryParse(normalized);
|
||||
|
||||
Reference in new issue
Block a user