Route Configuration

PHOTO EMBED

Thu Jul 25 2024 07:20:36 GMT+0000 (Coordinated Universal Time)

Saved by @zemax_c4 ##flutter

import 'package:go_router/go_router.dart';

// GoRouter configuration
final _router = GoRouter(
  initialLocation: '/',
  routes: [
    GoRoute(
      name: 'home', // Optional, add name to your routes. Allows you navigate by name instead of path
      path: '/',
      builder: (context, state) => HomeScreen(),
    ),
    GoRoute(
      name: 'page2',
      path: '/page2',
      builder: (context, state) => Page2Screen(),
    ),
  ],
);
content_copyCOPY

https://medium.com/