I have a Widget which on some point navigate to a different page.
like:-
Navigator.of(context).pushNamed(
NextPage.routeName,
arguments: {
"tag": this.tag,
"data": this.data,
},
);
now clearly Even though argument
parameter accepts type Object
but it also accepts Map
since this sentence is not giving me an error.
And in the NextPage
i am accessing the value like:-
tag: ModalRoute.of(context).settings.arguments["tag"].toString(),
Now the vscode is giving me error:-
The operator '[]' isn't defined for the class 'Object'.
Try defining the operator '[]'.dart(undefined_operator)
I don't know why vscode
is giving me an error.
So, Either the Object
should have the []
or Map
should be a type of Object.
Or there is something about the Date which is not clear.
Note: data
is object.
How do I remove this error?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…