Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.56k stars 394 forks source link

"PostRouteArgs can not be null because the corresponding page has a required parameter" as soon as I try to select a widget in WidgetInspector #1997

Closed escamoteur closed 1 month ago

escamoteur commented 1 month ago

Hi.

we are using autoroute 8.3.0 and everytime I try to use the WidgtInspector I get this exception here:

ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Missing or invalid required parameter

PostRouteArgs can not be null because the corresponding page has a required parameter
#0      RouteData.argsAs (package:auto_route/src/route/route_data.dart:99:9)
#1      new $WcRouter.<anonymous closure> (package:watchcrunch/the_app/router/router.gr.dart:151:30)
#2      RootStackRouter._pageBuilder (package:auto_route/src/router/controller/root_stack_router.dart:161:20)
#3      StackRouter._addEntry (package:auto_route/src/router/controller/routing_controller.dart:1606:29)
#4      StackRouter._pushAllGuarded (package:auto_route/src/router/controller/routing_controller.dart:1581:29)
<asynchronous suspension>

any idea what we make wrong? when using the app the parameters are all passed as expected.

Milad-Akarie commented 1 month ago

@escamoteur you just start the WidgetInspector to get this error?

escamoteur commented 1 month ago

@Milad-Akarie I start it and the moment I activate the widget selector I get this exception

escamoteur commented 1 month ago

If I can do anything to provide more data, please tell me

Milad-Akarie commented 1 month ago

@escamoteur vs or Android studio?

escamoteur commented 1 month ago

VS code

Milad-Akarie commented 1 month ago

@escamoteur Unfortunately, I could not reproduce the error no matter what I did, tried on Android, IOS and web with no success, what do you suggest I do to encounter this error?

escamoteur commented 1 month ago

I was fearing that. Our app is a pretty big Biest with complex nested navigation. Any way I could add some additional logging? Am 20. Juli 2024, 20:50 +0100 schrieb Milad Akarie @.***>:

@escamoteur Unfortunately, I could not reproduce the error no matter what I did, tried on Android, IOS and web with no success, what do you suggest I do to encounter this error? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Milad-Akarie commented 1 month ago

This is most likely a result of lost state, maybe you can check whether the router is re-initiated? and sure, let's see the logs. also what platform are you working on?

escamoteur commented 1 month ago

I just tested it again on Android and there is works so I only had this problem on Windows. Which also means it's not such a pressing issue

Milad-Akarie commented 1 month ago

I'm closing this for now but let me know if you have clear steps to reproduce it.