Skip to main content

ag_flow 0.5.0 copy "ag_flow: ^0.5.0" to clipboard
ag_flow: ^0.5.0 copied to clipboard

Opinionated clean architecture for Flutter: layered feature modules with built-in state, DI, route-scoped controllers, paging and a swappable network layer.

example/lib/main.dart

import 'package:ag_flow_example/core/auth/auth_service.dart';
import 'package:ag_flow_example/core/bindings/initial_binding.dart';
import 'package:ag_flow_example/core/routes/app_pages.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  // App-wide singletons (ApiProvider, AuthService) must exist before the
  // router runs its first guard.
  InitialBinding().dependencies();
  // Reads the stored token once, so a saved session skips the login page.
  await AuthService.instance.restoreSession();
  runApp(const AgFlowExampleApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'ag_flow example',
      routerConfig: AppPages.router,
    );
  }
}
2
likes
150
points
882
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Opinionated clean architecture for Flutter: layered feature modules with built-in state, DI, route-scoped controllers, paging and a swappable network layer.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

collection, dio, flutter, meta

More

Packages that depend on ag_flow