mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
new: delete all servers btn
This commit is contained in:
@@ -29,7 +29,7 @@ class ServerPrivateInfo {
|
||||
required this.pwd,
|
||||
this.pubKeyId,
|
||||
this.tags,
|
||||
}) : id = '$name<$user@$ip:$port>';
|
||||
}) : id = '$user@$ip:$port';
|
||||
|
||||
ServerPrivateInfo.fromJson(Map<String, dynamic> json) {
|
||||
name = json["name"].toString();
|
||||
|
||||
@@ -167,6 +167,15 @@ class ServerProvider extends BusyProvider {
|
||||
_serverStore.delete(id);
|
||||
}
|
||||
|
||||
void deleteAll() {
|
||||
_servers.clear();
|
||||
_serverOrder.clear();
|
||||
_settingStore.serverOrder.put(_serverOrder);
|
||||
_updateTags();
|
||||
notifyListeners();
|
||||
_serverStore.deleteAll();
|
||||
}
|
||||
|
||||
Future<void> updateServer(
|
||||
ServerPrivateInfo old,
|
||||
ServerPrivateInfo newSpi,
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 387;
|
||||
static const int build = 388;
|
||||
static const String engine = "3.10.6";
|
||||
static const String buildAt = "2023-07-21 18:06:24.239059";
|
||||
static const int modifications = 2;
|
||||
static const String buildAt = "2023-07-27 13:03:33.193528";
|
||||
static const int modifications = 16;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@ class ServerStore extends PersistentStore {
|
||||
box.delete(id);
|
||||
}
|
||||
|
||||
void deleteAll() {
|
||||
box.clear();
|
||||
}
|
||||
|
||||
void update(ServerPrivateInfo old, ServerPrivateInfo newInfo) {
|
||||
if (!have(old)) {
|
||||
throw Exception('Old spi: $old not found');
|
||||
|
||||
@@ -95,7 +95,8 @@ class SettingStore extends PersistentStore {
|
||||
|
||||
StoreProperty<NetViewType> get netViewType =>
|
||||
property('netViewType', defaultValue: NetViewType.speed);
|
||||
|
||||
|
||||
// Only valid on iOS
|
||||
StoreProperty<bool> get autoUpdateHomeWidget => property('autoUpdateHomeWidget', defaultValue: isIOS);
|
||||
StoreProperty<bool> get autoUpdateHomeWidget =>
|
||||
property('autoUpdateHomeWidget', defaultValue: isIOS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user