Navigation boilerplate

    0

    0

    michaelessiet

    The filename.ext widget extends the StatelessWidget class. Within the build method, the widget creates separate routes for the '/a' and '/b' paths. The routes define the path of the widget and the widget builder to use when rendering it.

    Library: Flutter

    /// Flutter
    class filename.ext extends StatelessWidget {
      // This widget is the root of your application.
      const filename.ext({Key? key}) : super(key: key);
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          //...
          routes: <String, WidgetBuilder>{
            '/a': (BuildContext context) => Home(),
            '/b': (BuildContext context) => Settings(),
          },
          //...
        );
      }
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.