So, I have created a basic map
var tracks = const [
{
'title':'Something',
'subtitle':'Something'
},
{
'title':'Something Else',
},
{
'title':'Admission',
},
{
'title':'University',
},
{
'title':'Exam',
'subtitle':'Something'
},
{
'title':'Job',
},
];
And this is being called by a ListView.builder in the following manner:
var trackTitles = tracks[index];
and then being used like this:
return PrimaryMail(
title: trackTitles['titles'],
)
But, it is throwing an "Invalid Argument(s): titles error in the final build. No dart-analytics issues seen. The only error I see (info, not serious) is This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: Home.tracks (must_be_immutable] lib\main.dart:18). [edit: the immutable issue has been fixed now by replacing var with final, but the original problem remains]
So, any way to understand why it is throwing an invalid argument even though the title key does exist?
The full code of this page is here.