60 lines
1.6 KiB
Dart
60 lines
1.6 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final pro = proFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
List<Pro> proFromJson(String str) =>
|
|
List<Pro>.from(json.decode(str).map((x) => Pro.fromJson(x)));
|
|
|
|
String proToJson(List<Pro> data) =>
|
|
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
|
|
|
class Pro {
|
|
int id;
|
|
int userId;
|
|
int procedureCode;
|
|
String procedure;
|
|
String placeOfService;
|
|
int totalBeneficiaries;
|
|
int totalServices;
|
|
int totalBeneDayServices;
|
|
int programYear;
|
|
|
|
Pro({
|
|
required this.id,
|
|
required this.userId,
|
|
required this.procedureCode,
|
|
required this.procedure,
|
|
required this.placeOfService,
|
|
required this.totalBeneficiaries,
|
|
required this.totalServices,
|
|
required this.totalBeneDayServices,
|
|
required this.programYear,
|
|
});
|
|
|
|
factory Pro.fromJson(Map<String, dynamic> json) => Pro(
|
|
id: json["id"],
|
|
userId: json["user_id"],
|
|
procedureCode: json["Procedure code"],
|
|
procedure: json["Procedure"],
|
|
placeOfService: json["Place of Service"],
|
|
totalBeneficiaries: json["Total Beneficiaries"],
|
|
totalServices: json["Total Services"],
|
|
totalBeneDayServices: json["Total_bene_day_services"],
|
|
programYear: json["Program year"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"user_id": userId,
|
|
"Procedure code": procedureCode,
|
|
"Procedure": procedure,
|
|
"Place of Service": placeOfService,
|
|
"Total Beneficiaries": totalBeneficiaries,
|
|
"Total Services": totalServices,
|
|
"Total_bene_day_services": totalBeneDayServices,
|
|
"Program year": programYear,
|
|
};
|
|
}
|