mobile_skt/lib/models/base_response.dart

32 lines
690 B
Dart
Raw Normal View History

class BaseResponse {
int? code;
dynamic data;
bool? fail;
String? key;
String? msg;
bool? success;
BaseResponse(
{this.code, this.data, this.fail, this.key, this.msg, this.success});
BaseResponse.fromJson(Map<String, dynamic> json) {
code = json['code'];
fail = json['fail'];
key = json['key'];
data = json['data'];
msg = json['msg'];
success = json['success'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['code'] = code;
data['fail'] = fail;
data['data'] = data;
data['key'] = key;
data['msg'] = msg;
data['success'] = success;
return data;
}
}