geo-smart-app/lib/model/response.dart

26 lines
475 B
Dart
Raw Normal View History

2019-12-16 00:18:09 +00:00
class ResponseModel {
2020-01-03 23:36:33 +00:00
final String errorMessage = "error";
2019-10-31 15:51:22 +00:00
String status;
2019-12-16 00:18:09 +00:00
ResponseModel({this.status});
2019-10-31 15:51:22 +00:00
2019-12-16 00:18:09 +00:00
ResponseModel.fromJson(Map<String, dynamic> json) {
2019-10-31 15:51:22 +00:00
status = json['status'];
}
ResponseModel.fromNull() {
2020-01-03 23:36:33 +00:00
status = errorMessage;
}
isError() {
return (status == errorMessage);
}
2019-10-31 15:51:22 +00:00
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['status'] = this.status;
return data;
}
}