Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page Args null after restoration #2098

Open
AndyDavidJoyce opened this issue Nov 22, 2024 · 0 comments
Open

Page Args null after restoration #2098

AndyDavidJoyce opened this issue Nov 22, 2024 · 0 comments

Comments

@AndyDavidJoyce
Copy link

AndyDavidJoyce commented Nov 22, 2024

Hi All,

I’m currently testing restoration functionality and have encountered an issue. When the app is reopened after a process death on Android, AutoRoute seems to attempt to open the last visited page. However, an error occurs because the page arguments are null.

ManufacturersByLetterRouteArgs can not be null because the corresponding page has a required parameter
	RouteData.argsAs (package:auto_route/src/route/route_data.dart:99:9)
	ManufacturersByLetterRoute.page.<anonymous closure> (package:mouser/core/navigation/app_router.gr.dart:191:25)
	AutoRoute.buildPage (package:auto_route/src/route/auto_route_config.dart:92:21)
	RouteMatch.buildPage (package:auto_route/src/matcher/route_match.dart:91:60)
	RouteData.buildPage (package:auto_route/src/route/route_data.dart:191:19)
	StackRouter._addEntry (package:auto_route/src/router/controller/routing_controller.dart:1586:23)
	StackRouter._pushAllGuarded (package:auto_route/src/router/controller/routing_controller.dart:1561:29)
<asynchronous suspension>

Any ideas on why this might be happening? I’ve checked the documentation, but it doesn’t seem to mention anything about restoration.

Note: I have just tried using QueryParams instead and that does seem to work. Is this the recommended approach if we want to handle restoration? Or should args also be restored?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant