30 lines
649 B
Dart
30 lines
649 B
Dart
// To parse this JSON data, do
|
|
//
|
|
// final city = cityFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
City cityFromJson(String str) => City.fromJson(json.decode(str));
|
|
|
|
String cityToJson(City data) => json.encode(data.toJson());
|
|
|
|
class City {
|
|
final String? cityCode;
|
|
final String? cityDescription;
|
|
|
|
City({
|
|
this.cityCode,
|
|
this.cityDescription,
|
|
});
|
|
|
|
factory City.fromJson(Map<String, dynamic> json) => City(
|
|
cityCode: json["city_code"],
|
|
cityDescription: json["city_description"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"city_code": cityCode,
|
|
"city_description": cityDescription,
|
|
};
|
|
}
|