2023-09-01 03:22:48 +00:00
|
|
|
// To parse this JSON data, do
|
|
|
|
//
|
|
|
|
// final barangay = barangayFromJson(jsonString);
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
Brgy barangayFromJson(String str) => Brgy.fromJson(json.decode(str));
|
|
|
|
|
|
|
|
String barangayToJson(Brgy data) => json.encode(data.toJson());
|
|
|
|
|
|
|
|
class Brgy {
|
2023-11-10 08:38:47 +00:00
|
|
|
final int? id;
|
2023-09-01 03:22:48 +00:00
|
|
|
final int? barangayId;
|
|
|
|
final String? barangayCode;
|
|
|
|
final String? cityCode;
|
|
|
|
final String? barangayDescription;
|
|
|
|
|
|
|
|
Brgy({
|
2023-11-10 08:38:47 +00:00
|
|
|
this.id,
|
2023-09-01 03:22:48 +00:00
|
|
|
this.barangayId,
|
|
|
|
this.barangayCode,
|
|
|
|
this.cityCode,
|
|
|
|
this.barangayDescription,
|
|
|
|
});
|
|
|
|
|
2023-11-10 08:38:47 +00:00
|
|
|
Brgy copy(
|
|
|
|
{int? id,
|
|
|
|
int? barangayId,
|
|
|
|
String? barangayCode,
|
|
|
|
String? cityCode,
|
|
|
|
String? barangayDescription}) {
|
|
|
|
return Brgy(
|
|
|
|
id: id ?? this.id,
|
|
|
|
barangayId: barangayId ?? this.barangayId,
|
|
|
|
barangayCode: barangayCode ?? this.barangayCode,
|
|
|
|
cityCode: cityCode ?? this.cityCode,
|
|
|
|
barangayDescription: barangayDescription ?? this.barangayDescription);
|
|
|
|
}
|
|
|
|
|
2023-09-01 03:22:48 +00:00
|
|
|
factory Brgy.fromJson(Map<String, dynamic> json) => Brgy(
|
2023-11-10 08:38:47 +00:00
|
|
|
id: json["id"],
|
2023-09-01 03:22:48 +00:00
|
|
|
barangayId: json["barangay_id"],
|
|
|
|
barangayCode: json["barangay_code"],
|
|
|
|
cityCode: json["city_code"],
|
|
|
|
barangayDescription: json["barangay_description"],
|
|
|
|
);
|
|
|
|
|
2023-11-10 08:38:47 +00:00
|
|
|
factory Brgy.fromJson2(Map<String, dynamic> json) => Brgy(
|
|
|
|
id: json["id"],
|
|
|
|
barangayId: json["barangayId"],
|
|
|
|
barangayCode: json["barangayCode"],
|
|
|
|
cityCode: json["cityCode"],
|
|
|
|
barangayDescription: json["barangayDescription"],
|
|
|
|
);
|
|
|
|
|
2023-09-01 03:22:48 +00:00
|
|
|
Map<String, dynamic> toJson() => {
|
2023-11-10 08:38:47 +00:00
|
|
|
"id": id,
|
2023-09-01 03:22:48 +00:00
|
|
|
"barangay_id": barangayId,
|
|
|
|
"barangay_code": barangayCode,
|
|
|
|
"city_code": cityCode,
|
|
|
|
"barangay_description": barangayDescription,
|
|
|
|
};
|
|
|
|
}
|