new: server tag

This commit is contained in:
lollipopkit
2023-05-30 22:44:45 +08:00
parent 92ffed6541
commit 472a441c8e
23 changed files with 239 additions and 112 deletions

View File

@@ -8,20 +8,16 @@ class Snippet {
late String name;
@HiveField(1)
late String script;
@HiveField(2)
List<String>? tags;
Snippet(this.name, this.script, {this.tags});
Snippet(this.name, this.script);
Snippet.fromJson(Map<String, dynamic> json) {
name = json['name'].toString();
script = json['script'].toString();
tags = json['tags'].cast<String>();
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['name'] = name;
data['script'] = script;
data['tags'] = tags;
return data;
}
}