pal-plugin icon indicating copy to clipboard operation
pal-plugin copied to clipboard

Error: PageCreationException: EMPTY_ROUTE_PROVIDED

Open marcstoffel opened this issue 4 years ago • 1 comments
trafficstars

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(),
    ),
        )),
  ));
}

marcstoffel avatar Jan 09 '21 06:01 marcstoffel

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

  • use navigator pushNamed method => https://api.flutter.dev/flutter/widgets/Navigator/pushNamed.html

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. 👍

g-apparence avatar Jan 10 '21 11:01 g-apparence