fluro_annotation_generator_fork 1.0.0

Flutter Android iOS web

Enable annotation support for fluro fork, which automatically generate fluro routes for you.

Fluro Annotation Generator #

Enable annotation support for fluro, which automatically generate fluro routes for you.

Usage #

  1. decorate route with @FRoute()
  2. decorate entry widget with @EnableFluroRouter()

Rule #

  1. all optional parameters are not required
  2. route should have a no-argument constructor or a single-argument constructor which accepts Map<String, List

Example #

// file: mail.dart
void main() => runApp(MyApp());

@EnableFluroRouter()
class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      onGenerateRoute: createFluroRouter().generator,
      initialRoute: "/",
    );
  }
}

// file: page1.dart
@FRoute(
  "/", 
  // transitionType: TransitionType.native,
  // handlerType: HandlerType.route,
  // handlerFunc: (BuildContext ctx, Map<String, List<String>> parameters) => Page1(),
)
class Page1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Text("Page 1");
  }
}

Recipe #

1. Set default transition effect #

TBD

1
likes
70
pub points
0%
popularity

Enable annotation support for fluro fork, which automatically generate fluro routes for you.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

brian.ja.schardt@gmail.com

License

MIT (LICENSE)

Dependencies

analyzer, build, build_config, fluro_fork, flutter, glob, source_gen

More

Packages that depend on fluro_annotation_generator_fork