I have a json object here -
{
\"error\": \"0\",
\"message\": \"Got it!\",
\"data\": [
{
\"status\": false,
\"_id\":
I think your fetch method should be like this:
Future> getData() async{
String link = baseURL + fetchTodoByDate;
var res = await http.post(Uri.encodeFull(link), headers: {"Accept": "application/json"});
var fetch = List();
if (res.statusCode == 200 ) {
var datesJson = json.decode(res.body);
for(var dateJson in datesJson){
fetch.add(Data.fromJson((dateJson)));
}
}
return fetch;
}