goRouterContent property
Template for the lib/router/router.dart file when using GoRouter.
Implementation
static String goRouterContent = '''
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'routes.dart';
import '../home_page.dart';
final GlobalKey<NavigatorState> _rootNavigatorKey =
GlobalKey<NavigatorState>(debugLabel: 'root');
final appRouter = GoRouter(
navigatorKey: _rootNavigatorKey,
initialLocation: '/',
debugLogDiagnostics: true,
routes: [
GoRoute(
path: Routes.home,
builder: (context, state) => const HomePage(),
),
// Add more routes here
],
);
''';