How do i use flutter searchdelegate on a list of map gotten from api. When i used this movies = query.isEmpty ? suggections : suggections;
i got the error saying type 'String' is not a subtype of type 'int' of 'index'
HERE is the api sample display below:
[
{
"id": 398,
"permission": 1,
"image": "/media/no-image.png",
"image_link": "https://filedn.com/lyaQed6jT9EFxgMccSbkU1H/Images/img407.jpg",
"title": "Michael McIntyre: Showman",
"language": "English",
"rate": "tt11860624",
"trailer": "7-40nXd1YA",
"genre": "Comedy",
"year": 2020,
"link": "x-special/nautilus-clipboard copy mtp://INFINIX_MOBILITY_LIMITED_Infinix_HOT_9_Play_055571104J004220/Internal%20shared%20storage/Xender/video/Caged(2021)_www.linocinema.com.mp4 mtp://INFINIX_MOBILITY_LIMITED_Infinix_HOT_9_Play_055571104J004220/Internal%20shared%20storage/Xender/video/MagicMax(2021)_www.linocinema.com.mp4 mtp://INFINIX_MOBILITY_LIMITED_Infinix_HOT_9_Play_055571104J004220/Internal%20shared%20storage/Xender/video/OutsideTheWire(2021)_www.linocinema.com.mp4 mtp://INFINIX_MOBILITY_LI",
"mb": 130,
"stream_link": null,
"director": "Chris Howe",
"director_link": "https://www.imdb.com/name/nm1608926/?ref_=tt_ov_dr",
"subtitle": "https://u.pcloud.link/publink/show?code=XZtE6bXZb7fELk9qEm84KiWbgfXbQ49wzGEX",
"added_on": "2021-02-02T07:22:41.542589Z",
"description": "Charming comic Michael McIntyre talks family, technology, sharks, accents and the time he confused himself for a world leader in this stand-up special.",
},
{
"id": 397,
"permission": 1,
"image": "/media/no-image.png",
"image_link": "https://filedn.com/lyaQed6jT9EFxgMccSbkU1H/Images/img406.jpg",
"title": "Palmer",
"language": "English",
"rate": "tt6857376",
"trailer": "8jVuOheTNGQ",
"genre": "Drama",
"year": 2021,
"link": "https://u.pcloud.link/publink/show?code=XZrLebXZf5eXINfxDU0T3Y2Osl5AORgMxjEy",
"mb": 198,
"stream_link": null,
"director": "Fisher Stevens",
"director_link": "https://www.imdb.com/name/nm0001770/?ref_=tt_ov_dr",
"subtitle": null,
"added_on": "2021-01-30T16:02:50.375659Z",
"description": "Former high school football star Eddie Palmer (Justin Timberlake) went from hometown hero to convicted felon, earning himself 12 years in a state penitentiary. He returns home to Louisiana, where he moves back in with Vivian (June Squibb), the grandmother who raised him. While trying to keep his head down and rebuild a quiet life for himself, Palmer is haunted by memories of his glory days and the suspicious eyes of his small town community. Things become more complicated when Vivian’s hard-living neighbor Shelly (Juno Temple) disappears on a prolonged bender, leaving her precocious and unique 7-year-old son Sam (Ryder Allen), often the target of bullying, in Palmer’s reluctant care. In time, Palmer is drawn into a more hopeful world as he forges a connection with Sam through their shared experience of being made to feel different by those around them. Life improves for Palmer, and a romance develops between him and Sam’s teacher Maggie (Alisha Wainwright). An inspiring and unexpected journey unfolds for the three of them, but soon Palmer’s past threatens to tear apart this new life.",
},]
It is a List of map. The Question is, How can i use searchdelegate on this.
question from:
https://stackoverflow.com/questions/66051240/flutter-searchdelegate-and-list-of-map