38 lines
948 B
Dart
38 lines
948 B
Dart
|
// 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 {
|
||
|
final int? barangayId;
|
||
|
final String? barangayCode;
|
||
|
final String? cityCode;
|
||
|
final String? barangayDescription;
|
||
|
|
||
|
Brgy({
|
||
|
this.barangayId,
|
||
|
this.barangayCode,
|
||
|
this.cityCode,
|
||
|
this.barangayDescription,
|
||
|
});
|
||
|
|
||
|
factory Brgy.fromJson(Map<String, dynamic> json) => Brgy(
|
||
|
barangayId: json["barangay_id"],
|
||
|
barangayCode: json["barangay_code"],
|
||
|
cityCode: json["city_code"],
|
||
|
barangayDescription: json["barangay_description"],
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
"barangay_id": barangayId,
|
||
|
"barangay_code": barangayCode,
|
||
|
"city_code": cityCode,
|
||
|
"barangay_description": barangayDescription,
|
||
|
};
|
||
|
}
|