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

Unhandled Exception: type 'AutoRoutePage<dynamic>' is not a subtype of type 'AutoRoutePage<Object>' in type #1826

Closed
maheshmesta opened this issue Jan 2, 2024 · 6 comments

Comments

@maheshmesta
Copy link

maheshmesta commented Jan 2, 2024

Exception

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'AutoRoutePage<dynamic>' is not a subtype of type 'AutoRoutePage<Object>' in type cast
#0      StackRouter._addEntry (package:auto_route/src/router/controller/routing_controller.dart:1552:18)
#1      StackRouter._pushAllGuarded (package:auto_route/src/router/controller/routing_controller.dart:1522:29)
<asynchronous suspension>

there is some exceptions i am getting in flutter windows. it seems like coming from package plz look into this.

[√] Flutter (Channel stable, 3.16.0, on Microsoft Windows [Version 10.0.22621.2861], locale en-IN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.2)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.85.1)
[√] Connected device (3 available)
[√] Network resources
@eshfield
Copy link

Have the same problem when trying to return a result from a route.

I have added types everywhere as recommended but it still gets an error:

Unhandled Exception: type 'AutoRoutePage<dynamic>' is not a subtype of type 'AutoRoutePage<MyCustomType>'

@oengmengthong
Copy link

any solution here?

@filak8
Copy link

filak8 commented Mar 27, 2024

The same problem
Version auto_route: 7.8.4

@Milad-Akarie
Copy link
Owner

@filak8 @eshfield have you added return type to @<RETURN_TYPE>RoutePage()

@filak8
Copy link

filak8 commented Mar 27, 2024

@filak8 @eshfield have you added return type to @<RETURN_TYPE>RoutePage()

No(
This was solution for me. Sorry for wasting your time.

@eshfield
Copy link

@filak8 @eshfield have you added return type to @<RETURN_TYPE>RoutePage()

Thanks a lot! This code example did the trick:

@RoutePage<bool>()
class LoginPage extends StatelessWidget {}

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

5 participants