add: peer rename

Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
Kingtous
2022-07-29 12:03:24 +08:00
parent a81f4c0124
commit 6b99d4d82e
5 changed files with 168 additions and 199 deletions

View File

@@ -141,6 +141,16 @@ class AbModel with ChangeNotifier {
}
}
void setPeerOption(String id, String key, String value) {
final it = peers.where((p0) => p0['id'] == id);
if (it.isEmpty) {
debugPrint("${id} is not exists");
return;
} else {
it.first[key] = value;
}
}
void clear() {
peers.clear();
tags.clear();