jsontodart
a dotnet app to create dart class from json, taking null-safety into consideration
the dart class extends serializable
base class
here is the serializable
class code
import 'dart:convert';
abstract class serializable {
string serialize() {
return json.encode(this.tomap());
}
void deserialize(string text) {
this.frommap(json.decode(text));
}
//abstract
map<string, dynamic> tomap();
//abstract
void frommap(map<string, dynamic> map);
}
Comments are closed.