Flutter go_router how to return result to previous page?

The latest version of go_router package now supports this functionality.
To pass data when popping from a screen, you can do this:

context.pop('value');

And to get this value back, your code should look like this:

String? val = await context.pushNamed('secondRoute');

Hope this helps, thank you

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)