class BaseModel { int id = 0; } class BaseEntity { ///状态码 0:成功 其他异常 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; } }