auto_go_route 1.0.8 copy "auto_go_route: ^1.0.8" to clipboard
auto_go_route: ^1.0.8 copied to clipboard

A powerful, type-safe, and feature-rich routing package for Flutter GoRouter with automatic code generation.

example/lib/main.dart

// lib/main.dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';

import 'src/app_router.dart';
import 'src/auth_service.dart';

// Initialize services
final authService = AuthService();
final appRouter = AppRouter(authService: authService);

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(
    ChangeNotifierProvider.value(
      value: authService,
      child: MyApp(router: appRouter.router),
    ),
  );
}

class MyApp extends StatelessWidget {
  final GoRouter router;

  const MyApp({super.key, required this.router});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'AutoGoRoute Example',
      theme: ThemeData(
        primarySwatch: Colors.deepPurple,
        useMaterial3: true,
        brightness: Brightness.dark,
        scaffoldBackgroundColor: const Color(0xFF121212),
        cardColor: const Color(0xFF1E1E1E),
        appBarTheme: const AppBarTheme(
          backgroundColor: Color(0xFF1E1E1E),
          elevation: 0,
        ),
        bottomNavigationBarTheme: const BottomNavigationBarThemeData(
          backgroundColor: Color(0xFF1E1E1E),
          selectedItemColor: Colors.deepPurpleAccent,
          unselectedItemColor: Colors.grey,
        ),
      ),
      routerConfig: router,
      debugShowCheckedModeBanner: false,
    );
  }
}
6
likes
160
points
184
downloads
screenshot

Publisher

verified publishermohesu.com

Weekly Downloads

A powerful, type-safe, and feature-rich routing package for Flutter GoRouter with automatic code generation.

Repository (GitHub)
View/report issues

Topics

#routing #navigation #auto-route #go-router #type-safety

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

equatable, flutter, go_router, meta

More

Packages that depend on auto_go_route