I want to pass a map of complex data as a parameter to a GoRoute()
. However, from what I can see, the param is a String
. I tried converting my Map -> String, but it immediately causes all sorts of errors due to format errors: Unexpected character (at character 2)
.
Im most likely going about this the incorrect way.
Is it even possible to send a Map
of data as a parameter in GoRouter?
2
Answers
It can be done, but JsonEncode and then JsonDecode on the other side, I have performed it incorrectly
I would suggest you to use
Model
and havetoJson()
fromJson()
methods. And pass between routes asModel
usingextra
.Example:
Object:
Define GoRoute as
Call it as:
Receive it as: