barely functional database with hive

This commit is contained in:
SomnusVeritas
2023-11-06 18:19:52 +01:00
parent da4dc83193
commit d1da474998
9 changed files with 114 additions and 5 deletions

View File

@@ -4,6 +4,18 @@ class Unit {
final System system;
Unit(this.name, this.type, {this.system = System.metric});
factory Unit.fromJson(Map<String, dynamic> json) => Unit(
json['name'] as String,
json['type'] as UnitType,
system: json['system'] as System,
);
Map<String, dynamic> toJson() => {
'name': name,
'type': type,
'system': system,
};
}
enum System { metric, imperial, neutral }