fluro_annotation_generator 0.3.1

  • Readme
  • Changelog
  • Installing
  • 52

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

0.3.1 #

  • Fix second time generation failure.
  • Optimize code generation (delete, rename)

0.3.0 #

  • Supports customized handler type and handler function.

0.2.1 #

  • Optimize code
  • Change default transition to fluro default transition.

0.2.0 #

  • Supports customized transition on each route.

0.1.0 #

  • First version, supports url on annotation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fluro_annotation_generator: ^0.3.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fluro_annotation_generator/fluro_annotation_generator.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
52
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

9 out of 9 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/annotation/f_route.dart. (-0.50 points)

Analysis of lib/src/annotation/f_route.dart reported 1 hint:

line 1 col 8: Don't import implementation files from another package.

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 6 dependencies without version constraints. Specify version ranges for the following dependencies: analyzer, build, build_config, fluro, glob, source_gen.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and fluro_annotation_generator.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
analyzer any 0.38.5
build any 1.2.0
build_config any 0.4.1+1
fluro any 1.5.1
flutter 0.0.0
glob any 1.2.0
source_gen any 0.9.4+5
Transitive dependencies
args 1.5.2
async 2.4.0
charcode 1.1.2
checked_yaml 1.0.2
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.16.1
dart_style 1.3.1
front_end 0.1.27
html 0.14.0+3
js 0.6.1+1
json_annotation 3.0.0
kernel 0.3.27
logging 0.11.3+2
meta 1.1.7
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pub_semver 1.4.2
pubspec_parse 0.1.5
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
watcher 0.9.7+12
yaml 2.2.0
Dev dependencies
build_runner any
pedantic ^1.7.0 1.8.0+1
test ^1.6.0