I have list of map where there is a date field. In the screen I have filter option where I can filter data based on last week, last month and last year so Don't know how can achieve the result.
Below is my code
_listOfHistory.addAll(
_listStaticRoundForHistory.
where((element) {
final date = element.date;
return date == date.subtract(Duration(days: 30));
}
).toList());
But pretty sure that wrong.
Response Listing
[
{
"title": "title",
"details": "details",
"date": DateTime
},
{
"title": "title",
"details": "details",
"date": DateTime
}
.
.
.
.
]