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