rename tag
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
46b3cf1871
commit
db45552a05
38 changed files with 204 additions and 63 deletions
|
|
@ -223,6 +223,33 @@ class AbModel {
|
|||
}
|
||||
}
|
||||
|
||||
void renameTag(String oldTag, String newTag) {
|
||||
if (tags.contains(newTag)) return;
|
||||
tags.value = tags.map((e) {
|
||||
if (e == oldTag) {
|
||||
return newTag;
|
||||
} else {
|
||||
return oldTag;
|
||||
}
|
||||
}).toList();
|
||||
selectedTags.value = selectedTags.map((e) {
|
||||
if (e == oldTag) {
|
||||
return newTag;
|
||||
} else {
|
||||
return oldTag;
|
||||
}
|
||||
}).toList();
|
||||
for (var peer in peers) {
|
||||
peer.tags = peer.tags.map((e) {
|
||||
if (e == oldTag) {
|
||||
return newTag;
|
||||
} else {
|
||||
return oldTag;
|
||||
}
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
|
||||
void unsetSelectedTags() {
|
||||
selectedTags.clear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue