mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 05:43:41 +00:00
feat: support drag torrent file (#42)
This commit is contained in:
1 parent
77e59f7376
commit
e9442edd94
9 files changed
+122
-79
No files matched your search
@@ -14,14 +14,16 @@ class Setting {
|
||||
int port = 0;
|
||||
int connections = 0;
|
||||
String downloadDir = "";
|
||||
ThemeMode themeMode = ThemeMode.system;
|
||||
Locale locale = ui.window.locale;
|
||||
late ThemeMode themeMode;
|
||||
late String locale;
|
||||
|
||||
// singleton pattern
|
||||
static Setting? _instance;
|
||||
|
||||
static Setting get instance {
|
||||
_instance ??= Setting._internal();
|
||||
_instance!.themeMode = ThemeMode.system;
|
||||
_instance!.locale = getLocaleKey(ui.window.locale);
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
@@ -39,7 +41,7 @@ class Setting {
|
||||
}
|
||||
final locale = config.extra?['locale'];
|
||||
if (locale != null) {
|
||||
this.locale = toLocale(locale);
|
||||
this.locale = locale;
|
||||
}
|
||||
|
||||
if (Util.isWeb()) {
|
||||
@@ -67,7 +69,7 @@ class Setting {
|
||||
downloadDir: downloadDir,
|
||||
extra: {
|
||||
'themeMode': themeMode.name,
|
||||
'locale': locale.toString(),
|
||||
'locale': locale,
|
||||
},
|
||||
);
|
||||
await putConfig(config);
|
||||
|
||||
Reference in new issue
Block a user