navigationService top-level constant

List<String> const navigationService

Implementation

const navigationService = [
  "import 'package:{app}/presentation/pages/{page}/{page}.page.dart';",
  "import 'package:flutter/material.dart';",
  "import 'package:go_router/go_router.dart';",
  "",
  "part '_route_names.dart';",
  "part '_routers.dart';",
  "",
  "class NavigationService {",
  "  NavigationService._();",
  "",
  "  static final _key = GlobalKey<NavigatorState>();",
  "  static BuildContext? get context => _key.currentState?.context;",
  "",
  "  static final router = GoRouter(",
  "    navigatorKey: _key,",
  "    debugLogDiagnostics: true,",
  "    initialLocation: '/',",
  "    routes: _routes,",
  "  );",
  "}",
];