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

Error: The argument type 'FluroRouter' can't be assigned to the parameter type 'Router<dynamic>' #278

Closed
suraj740 opened this issue Dec 28, 2022 · 1 comment

Comments

@suraj740
Copy link

Hi @lukef , i am using fluro router 2.0.0 , i am getting below errors,

  1. Error: The argument type 'FluroRouter' can't be assigned to the parameter type 'Router'.
  2. Error: A value of type 'FluroRouter' can't be assigned to a variable of type 'Router?'.
  3. The getter 'generator' isn't defined for the class 'Router
class Test extends StatelessWidget {
  Test({Key? key}) : super(key: key) {
    final router = FluroRouter();
    Routes.configureRoutes(router); // 1.
    Application.router = router; // 2.
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Test',
      theme: ThemeData(
        fontFamily: 'GoogleSans',
        primaryColor: Colors.black,
      ),
      onGenerateRoute: Application.router.generator, // 3.
      home: Home(),
    );
  }
}

Any help would be appreciated!

@suraj740
Copy link
Author

suraj740 commented Dec 28, 2022

Found the issue Router class from flutter was used instead of FluroRouter in Routes and Application classes.

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