Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Error: PageCreationException: EMPTY_ROUTE_PROVIDED #5

Open
marcstoffel opened this issue Jan 9, 2021 · 1 comment
Open

Error: PageCreationException: EMPTY_ROUTE_PROVIDED #5

marcstoffel opened this issue Jan 9, 2021 · 1 comment

Comments

@marcstoffel
Copy link

marcstoffel commented Jan 9, 2021

I get this error when saving a new helper.
What did I wrong?

Thanks for help, would be awesome to use your codeless onboarding!

This is how I wrapped my app with the pal widget:

void main() async {
  //Routes.setupRouter();

  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  if (!kIsWeb) await FirebaseRemoteConfig.setupRemoteConfig();

  final _navigatorKey = GlobalKey<NavigatorState>();


  runApp(MultiProvider(
    providers: [
      // StreamProvider<FirebaseAuthentication.User>.value(
      //     value: authenticatedUser),
      ChangeNotifierProvider(create: (context) => CounterService()),
      ChangeNotifierProvider(
        create: (context) => AuthNotifier(),
      ),
      ChangeNotifierProvider(
        create: (context) => TeamNotifier(),
      ),
      ChangeNotifierProvider(
        create: (context) => MatchEngine(),
      ),
    ],
    child: OverlaySupport(
        child: Pal(
          editorModeEnabled: true,
          appToken: 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0Y2FhZjI0NC1jNGZkLTRhZmMtYmYyYS01ZjNjZTMwMzMyODYiLCJ0eXBlIjoiUFJPSkVDVCIsImlhdCI6MTYxMDA4MzMzMH0.QxzaLbqm1w0F1ICR-zVa6O_PTeGKqWL8N3VNE0JlfFE',
          childApp: MaterialApp(
            key: ValueKey('hostedApp'),
            navigatorKey: _navigatorKey, // add this in your app
            navigatorObservers: [PalNavigatorObserver.instance()], // add this in your app
      title: 'Dream-teams.com',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
          primaryColorBrightness: Brightness.light,
          primarySwatch: Colors.pink,
          primaryColor: Colors.pink,
          fontFamily: 'Verdana',
      ),
      initialRoute: '/',
      onGenerateRoute: Routes.generateRoute,
/*      routes: {
          WrapperPage.route: (BuildContext context) => new WrapperPage(),
          MyApp.route: (BuildContext context) => new MyApp(),
      },*/
      //home: WrapperPage(),
    ),
        )),
  ));
}
@g-apparence
Copy link
Contributor

Hi, thank you for your kind message 😊 .
This error can be shown when you push a route without using a name.

We recently added an error to help people using the navigator.push as it doesn't provide a name to the current page.
Tell me if that fixes your error, either we are thinking of an option to ignore push without names. 👍

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

No branches or pull requests

2 participants