How to parse this inside ListTile>FutureBuilder in Flutter? I want to Show ListTile inside ListTile title should be docType only. Below is my model Class of Response of url. I generated this model Class from online Converter Tool by response i am getting
//To parse this JSON data, do
import 'dart:convert';
final truckDocuments = truckDocumentsFromJson(jsonString);
List<TruckDocuments> truckDocumentsFromJson(String str) =>
List<TruckDocuments>.from(
json.decode(str).map((x) => TruckDocuments.fromJson(x)));
String truckDocumentsToJson(List<TruckDocuments> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class TruckDocuments {
TruckDocuments({
this.id,
this.docType,
this.docFor,
this.expDate,
this.expMonth,
this.sortOrder,
this.required,
this.status,
this.alert,
this.hasExpiryDate,
this.selected,
});
int id;
String docType;
String docFor;
int expDate;
int expMonth;
int sortOrder;
bool required;
int status;
String alert;
bool hasExpiryDate;
bool selected;
factory TruckDocuments.fromJson(Map<String, dynamic> json) => TruckDocuments(
id: json["id"],
docType: json["docType"],
docFor: json["docFor"],
expDate: json["expDate"],
expMonth: json["expMonth"],
sortOrder: json["sortOrder"],
required: json["required"],
status: json["status"],
alert: json["alert"],
hasExpiryDate: json["hasExpiryDate"],
selected: json["selected"],
);
Map<String, dynamic> toJson() => {
"id": id,
"docType": docType,
"docFor": docFor,
"expDate": expDate,
"expMonth": expMonth,
"sortOrder": sortOrder,
"required": required,
"status": status,
"alert": alert,
"hasExpiryDate": hasExpiryDate,
"selected": selected,
};
}