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