Application/medcify/lib/models/api/pincode_response.dart
2022-09-26 12:03:52 +05:30

19 lines
523 B
Dart

import 'package:medcify/models/pincode_item.dart';
class PincodeResponse{
bool? status;
String? message;
List<PincodeItem>? pincodes;
PincodeResponse.fromJson(Map<String, dynamic> json){
status = (json["Code"] ?? "0") != "0";
pincodes = (json["Data"] != null) ? json["Data"].map<PincodeItem>((e) => PincodeItem.fromJson(e)).toList() : [];
message = json["Message"] ?? "Something went wrong";
}
PincodeResponse.withError(String err){
status = false;
pincodes = [];
message = err;
}
}