19 lines
523 B
Dart
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;
|
|
}
|
|
} |