mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: server tag
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user