Ross McQuillan
Ross McQuillan

Reputation: 85

Is there a way for Go Router in flutter to handle Fragment Parameters?

I'm currently implementing a flutter web app. I'm calling a 3rd party system and it's redirecting to the URL I provide to it. However it appends to the end of it #code=CODE&idtoken=IDTOKEN. So i'm getting a redirect to REDIRECTURL/#code=CODE&idtoken=IDTOKEN. The problem is that Go Router sees this as a path and not as parameters and i get the error: GoException: no routes for location: code=CODE&id_token=IDTOKEN

Is there a way for me to handle Fragment parameters using Go Router?

The best I have is to read these parameters manually and then try to remove them from the URL in initstate, but that seems a little hacky and doesn't sit nicely. Is there a better way to do this?

Upvotes: 1

Views: 139

Answers (0)

Related Questions