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;
|
2024-03-21 05:47:57 +00:00
|
|
|
final String? genCode;
|
2023-09-01 03:22:48 +00:00
|
|
|
|
2024-03-21 05:47:57 +00:00
|
|
|
Brgy(
|
|
|
|
{this.id,
|
|
|
|
this.barangayId,
|
|
|
|
this.barangayCode,
|
|
|
|
this.cityCode,
|
|
|
|
this.barangayDescription,
|
|
|
|
this.genCode});
|
2023-09-01 03:22:48 +00:00
|
|
|
|
2023-11-10 08:38:47 +00:00
|
|
|
Brgy copy(
|
|
|
|
{int? id,
|
|
|
|
int? barangayId,
|
|
|
|
String? barangayCode,
|
|
|
|
String? cityCode,
|
2024-03-21 05:47:57 +00:00
|
|
|
String? barangayDescription,
|
|
|
|
String? genCode}) {
|
2023-11-10 08:38:47 +00:00
|
|
|
return Brgy(
|
|
|
|
id: id ?? this.id,
|
|
|
|
barangayId: barangayId ?? this.barangayId,
|
|
|
|
barangayCode: barangayCode ?? this.barangayCode,
|
|
|
|
cityCode: cityCode ?? this.cityCode,
|
2024-03-21 05:47:57 +00:00
|
|
|
barangayDescription: barangayDescription ?? this.barangayDescription,
|
|
|
|
genCode: genCode ?? this.genCode);
|
2023-11-10 08:38:47 +00:00
|
|
|
}
|
|
|
|
|
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"],
|
2024-03-21 05:47:57 +00:00
|
|
|
genCode: json["gen_code"],
|
2023-09-01 03:22:48 +00:00
|
|
|
);
|
|
|
|
|
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"],
|
2024-03-21 05:47:57 +00:00
|
|
|
genCode: json["gen_code"],
|
2023-11-10 08:38:47 +00:00
|
|
|
);
|
|
|
|
|
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,
|
2024-03-21 05:47:57 +00:00
|
|
|
"gen_code": genCode,
|
2023-09-01 03:22:48 +00:00
|
|
|
};
|
|
|
|
}
|