As stated, I am trying to use the flutter table_calendar: 2.3.0 and I'm not sure how to add the json data to the Map<DateTime,List> to display dates.
I'm using the start date as the datetime and the event "list" as the data that I'm utilizing.
Here is my json data:
"Events": [
{
"id": 1,
"event_name": "Cake tasting",
"event_photo": "https://dispensaries.s3.amazonaws.com/event_photo/Southern_Cali_Kush_3.jpg",
"vendor_name": {
"id": 1,
"vendor": "Tastey Cakes"
},
"refund_available": false,
"website": "www.foodcakes.com",
"share_count": 0,
"check_in_count": 0,
"street_address": "123 Fake Street",
"city": "Brooklynn",
"state": "NY",
"zipcode": "12312",
"event_tagline": "Taste my cakes",
"details": "Cake tasting",
"start_date": "2020-11-03",
"start_time": "23:33:00",
"end_time": "23:33:00",
"attendees": []
}
]
Here is the map I'm using to add the data to the _event variable that holds the new date data:
Map<DateTime, List> _events = {};
void _getEventDates(data) { Map<String, dynamic> newMap = {};
for (int i = 0; i < data.length; i++) {
newMap = {
data.startingTime, [data.name]
} as Map<String, dynamic>;
};
}
Could someone assist getting the json data into the format needed to display on the calendar?