flutter_navigation 0.0.2

flutter-navigation #

Life is short, use Flutter Navigation

a flutter navigation solution

currently support cupertino app

First, add flutter_navigation as a dependency in your pubspec.yaml file.

Example #

    import "package:flutter_navigation/navigation.dart";
    import 'some_widget_1.dart'
    import 'some_widget_2.dart'

    final screens ={
    final navigationOptions ={
              "SomeWidget1":NavigationOptions(title:Text('Widget Title')),
              "SomeWidget2":NavigationOptions(title:Text('Widget Title')),

void main(){

    return runApp(FlutterNavigation(
            onUnknownRoute:Route (FlutterNavigator navigation){
                return SomeCupertinoPageRoute();
            navigationType: FlutterNavigationTypes.IOS,
            onPush: (params) {
                print("onPush ${params}");
            onPop: (params) {
                print("onPop ${params}");
// some_widget_1.dart
import 'package:flutter/cupertino.dart';

class SomeWidget extends StatefulWidget {
  SomeWidget({this.params, this.navigation});
  final Map params;
  final navigation;
  State<StatefulWidget> createState() => SomeWidgetWithState();
class SomeWidgetWithState extends State<Home> {
  Widget build(BuildContext context) {
    return Column(children: <Widget>[
        child: Text('Go to profile'),
        onPressed: () {
          widget.navigation.push(context, "SomeWidget2", {"hello": Null});

Use this package as a library

1. Depend on it

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

  flutter_navigation: ^0.0.2

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:flutter_navigation/constants.dart';
import 'package:flutter_navigation/page_scaffold.dart';
import 'package:flutter_navigation/app.dart';
import 'package:flutter_navigation/cupertino.dart';
import 'package:flutter_navigation/material.dart';
import 'package:flutter_navigation/navigation.dart';
import 'package:flutter_navigation/navigation_bar.dart';
import 'package:flutter_navigation/navigator.dart';
import 'package:flutter_navigation/unknown_route.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.30 points)

123 out of 126 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/app.dart. (-0.50 points)

Analysis of lib/app.dart reported 1 hint:

line 24 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: FlutterNavigation.navigation

Fix lib/cupertino.dart. (-0.50 points)

Analysis of lib/cupertino.dart reported 1 hint:

line 1 col 8: Unused import: 'package:flutter/cupertino.dart'.

Fix lib/material.dart. (-0.50 points)

Analysis of lib/material.dart reported 1 hint:

line 1 col 8: Unused import: 'package:flutter/material.dart'.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/constants.dart (Run flutter format to format lib/constants.dart.)
  • lib/navigation_bar.dart (Run flutter format to format lib/navigation_bar.dart.)
  • lib/navigator.dart (Run flutter format to format lib/navigator.dart.)
  • lib/page_scaffold.dart (Run flutter format to format lib/page_scaffold.dart.)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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 flutter_navigation.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
cupertino_icons ^0.1.2 0.1.3
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies