// To parse this JSON data, do // // final province = provinceFromJson(jsonString); import 'package:meta/meta.dart'; import 'dart:convert'; Province provinceFromJson(String str) => Province.fromJson(json.decode(str)); String provinceToJson(Province data) => json.encode(data.toJson()); class Province { Province({ required this.code, required this.description, required this.region, required this.psgcCode, required this.shortname, }); final String code; final String description; final Region region; final String psgcCode; final String shortname; factory Province.fromJson(Map json) => Province( code: json["code"], description: json["description"], region: Region.fromJson(json["region"]), psgcCode: json["psgc_code"], shortname: json["shortname"], ); Map toJson() => { "code": code, "description": description, "region": region.toJson(), "psgc_code": psgcCode, "shortname": shortname, }; } class Region { Region({ required this.code, required this.description, required this.psgcCode, }); final int code; final String description; final String psgcCode; factory Region.fromJson(Map json) => Region( code: json["code"], description: json["description"], psgcCode: json["psgc_code"], ); Map toJson() => { "code": code, "description": description, "psgc_code": psgcCode, }; }