29 lines
611 B
Dart
29 lines
611 B
Dart
class GenericResponse{
|
|
bool? status;
|
|
String? message;
|
|
|
|
GenericResponse.fromJson(Map<String, dynamic> json){
|
|
status = (json["code"] ?? "") != "0";
|
|
message = json["message"] ?? "Something went wrong";
|
|
}
|
|
|
|
GenericResponse.withError(String err){
|
|
status = false;
|
|
message = err;
|
|
}
|
|
}
|
|
|
|
class GenericResponse2{
|
|
bool? status;
|
|
String? message;
|
|
|
|
GenericResponse2.fromJson(Map<String, dynamic> json){
|
|
status = (json["Code"] ?? "") != "0";
|
|
message = json["Message"] ?? "Something went wrong";
|
|
}
|
|
|
|
GenericResponse2.withError(String err){
|
|
status = false;
|
|
message = err;
|
|
}
|
|
} |