class BaseModel { int id = 0; } class BaseEntity { int code = 0; String msg = ""; BaseModel? data; BaseEntity({required this.code, required this.msg, this.data}); BaseEntity.fromJson(Map json) { code = json['code']; msg = json['msg']; data = json['data']; } Map toJson() { final Map data = {}; data['code'] = code; data['msg'] = msg; data['data'] = this.data; return data; } }