2023-02-15 03:40:12 +00:00
|
|
|
// To parse this JSON data, do
|
|
|
|
//
|
|
|
|
// final city = cityFromJson(jsonString);
|
|
|
|
|
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
import 'dart:convert';
|
|
|
|
|
2023-02-20 07:48:24 +00:00
|
|
|
import 'provinces.dart';
|
|
|
|
import 'region.dart';
|
2023-02-15 03:40:12 +00:00
|
|
|
|
2023-02-20 07:48:24 +00:00
|
|
|
CityMunicipality cityFromJson(String str) => CityMunicipality.fromJson(json.decode(str));
|
2023-02-15 03:40:12 +00:00
|
|
|
|
2023-02-20 07:48:24 +00:00
|
|
|
String cityToJson(CityMunicipality data) => json.encode(data.toJson());
|
|
|
|
|
|
|
|
class CityMunicipality {
|
|
|
|
CityMunicipality({
|
2023-02-15 03:40:12 +00:00
|
|
|
required this.code,
|
|
|
|
required this.description,
|
|
|
|
required this.province,
|
|
|
|
required this.psgcCode,
|
|
|
|
required this.zipcode,
|
|
|
|
});
|
|
|
|
|
2023-02-15 08:48:34 +00:00
|
|
|
final String? code;
|
|
|
|
final String? description;
|
|
|
|
final Province? province;
|
|
|
|
final String? psgcCode;
|
|
|
|
final String? zipcode;
|
2023-02-15 03:40:12 +00:00
|
|
|
|
2023-02-20 07:48:24 +00:00
|
|
|
factory CityMunicipality.fromJson(Map<String, dynamic> json) => CityMunicipality(
|
2023-02-15 03:40:12 +00:00
|
|
|
code: json["code"],
|
|
|
|
description: json["description"],
|
2023-02-15 08:48:34 +00:00
|
|
|
province: json['province'] == null? null : Province.fromJson(json["province"]),
|
2023-02-15 03:40:12 +00:00
|
|
|
psgcCode: json["psgc_code"],
|
|
|
|
zipcode: json["zipcode"],
|
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
"code": code,
|
|
|
|
"description": description,
|
2023-02-15 08:48:34 +00:00
|
|
|
"province": province!.toJson(),
|
2023-02-15 03:40:12 +00:00
|
|
|
"psgc_code": psgcCode,
|
|
|
|
"zipcode": zipcode,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|