底部导航栏不适用于命名路线

时间:2020-09-15 22:50:12

标签: flutter

我正在尝试使用以下方法添加底部导航栏:https://pub.dev/packages/google_nav_bar/example 我已经命名了路由,那么如何实现呢?

这是我当前的设置:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'CooApp',
      initialRoute: 'home',
      routes: {
        '/home': (context) => Home(),
        '/anotherRoute': (context) => AnotherRoute(),
      },
    );
  }
}

我是否必须在每个页面上添加它?

0 个答案:

没有答案