Skip to main content

go_guardian 0.2.2 copy "go_guardian: ^0.2.2" to clipboard
go_guardian: ^0.2.2 copied to clipboard

NestJS-style declarative route guards for GoRouter. Declare guards at the route level, inherit through shells, compose with existing redirect logic.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:go_guardian/go_guardian.dart';

import 'src/router.dart';

void main() {
  if (kDebugMode) GoGuardian.observer = DebugGuardObserver();
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'go_guardian demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorSchemeSeed: Colors.teal,
        useMaterial3: true,
      ),
      routerConfig: router,
    );
  }
}
1
likes
150
points
18
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

NestJS-style declarative route guards for GoRouter. Declare guards at the route level, inherit through shells, compose with existing redirect logic.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, go_router

More

Packages that depend on go_guardian