Skip to content
pubscout

ff_annotation_route

12.1.0, released 2 months ago by fluttercandies.com

Annotation-driven route generator and navigation helper for Flutter

$ flutter pub add ff_annotation_route
Source repository

What it does

Scans Dart code for annotations like @FFRoute to generate strongly-typed routing maps and argument helpers. It supports multiple navigation frameworks including Navigator 1.0/2.0, GetX, and GoRouter, alongside route interceptors and lifecycle observers.

AI-written summary of version 12.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want strongly-typed routing and arguments generated via annotations
  • Your project uses Navigator 1.0, 2.0, GetX, or GoRouter and needs centralized route maps
  • You need built-in route interceptors and page lifecycle callbacks

Skip it when

  • You prefer manual route table definitions without code generation tools
  • You do not want external command-line tools or global activation in your build workflow

Strengths

  • Multi-navigation paradigm support (Navigator 1.0/2.0, GetX, GoRouter)
  • Strongly-typed argument helpers and auto-import features
  • Supports fast mode and full analysis mode for monorepos

Weaknesses

  • Requires running an external CLI command for route generation
  • Fast mode requires manual import statements or @FFAutoImport for complex arguments

Setup

Kind
Pure Dart
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
13

Activate the plugin globally using `dart pub global activate ff_annotation_route`, add dependencies like ff_annotation_route_core and ff_annotation_route_library, and execute the route generator command in the project root.

@FFRoute(
  name: "fluttercandies://mainpage",
  routeName: "MainPage",
)
class MainPage extends StatelessWidget {
  const MainPage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) => Container();
}

Alternatives

Packages that do the same job and could replace ff_annotation_route.

  • auto_route

    Provides a robust, annotation-driven routing solution with built-in declarative routing and generated type-safe arguments.

  • go_router

    Offers an official declarative routing package with deep linking built directly into the Flutter ecosystem without mandatory code generation tools.

Works with

Packages commonly used together with ff_annotation_route: ones it builds on, ones built on it, and its own family.