fix: prefs persistence

This commit is contained in:
problematicconsumer
2023-09-17 14:24:25 +03:30
parent 493be47c8f
commit e6eab038ce
4 changed files with 73 additions and 145 deletions

View File

@@ -51,8 +51,12 @@ final tunImplementationStore = PrefNotifier.provider(
final mtuStore = PrefNotifier.provider("mtu", _default.mtu);
final connectionTestUrlStore =
PrefNotifier.provider("connection-test-url", _default.connectionTestUrl);
final urlTestIntervalStore =
PrefNotifier.provider("url-test-interval", _default.urlTestInterval);
final urlTestIntervalStore = PrefNotifier.provider<Duration, int>(
"url-test-interval",
_default.urlTestInterval,
mapFrom: (value) => Duration(seconds: value),
mapTo: (value) => value.inSeconds,
);
final enableClashApiStore =
PrefNotifier.provider("enable-clash-api", _default.enableClashApi);
final clashApiPortStore =