#54 new: grouped snippet & tab snippet

This commit is contained in:
lollipopkit
2023-05-30 18:05:46 +08:00
parent 96438313a1
commit a1e80fd806
13 changed files with 192 additions and 57 deletions

View File

@@ -8,16 +8,20 @@ class Snippet {
late String name;
@HiveField(1)
late String script;
Snippet(this.name, this.script);
@HiveField(2)
List<String>? tags;
Snippet(this.name, this.script, {this.tags});
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;
}
}