All Projects → fluttercandies → Nav_router

fluttercandies / Nav_router

Licence: apache-2.0
flutter The lightest, easiest and most convenient route management!

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Nav router

Flutter appavailability
A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed apps.
Stars: ✭ 63 (-37.62%)
Mutual labels:  flutter-plugin
Flutter plugin pdf viewer
A flutter plugin for handling PDF files. Works on both Android & iOS
Stars: ✭ 81 (-19.8%)
Mutual labels:  flutter-plugin
Amap location fluttify
高德地图 定位组件 Flutter插件
Stars: ✭ 97 (-3.96%)
Mutual labels:  flutter-plugin
Flutter Permission Handler
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
Stars: ✭ 1,144 (+1032.67%)
Mutual labels:  flutter-plugin
Firebase dart sdk
Unofficial Firebase Flutter SDK. Maintainer: @long1eu
Stars: ✭ 80 (-20.79%)
Mutual labels:  flutter-plugin
In app review
A Flutter plugin for showing the In-App Review/System Rating pop up on Android, IOS, and MacOS. It makes it easy for users to rate your app.
Stars: ✭ 85 (-15.84%)
Mutual labels:  flutter-plugin
Flutter svg
SVG parsing, rendering, and widget library for Flutter
Stars: ✭ 1,113 (+1001.98%)
Mutual labels:  flutter-plugin
Painter
A simple flutter widget to paint with your fingers
Stars: ✭ 99 (-1.98%)
Mutual labels:  flutter-plugin
Flutter web auth
Flutter plugin for authenticating a user with a web service
Stars: ✭ 81 (-19.8%)
Mutual labels:  flutter-plugin
Octo image
A multifunctional Flutter image widget
Stars: ✭ 97 (-3.96%)
Mutual labels:  flutter-plugin
Flutter install plugin
A flutter plugin for install apk for android; and using url to go to app store for iOS.
Stars: ✭ 71 (-29.7%)
Mutual labels:  flutter-plugin
Intent
A simple Flutter plugin to deal with Android Intents, written with ❤️
Stars: ✭ 79 (-21.78%)
Mutual labels:  flutter-plugin
Flutter inappwebview
A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
Stars: ✭ 1,259 (+1146.53%)
Mutual labels:  flutter-plugin
Stereo
A Flutter plugin for playing music on iOS and Android.
Stars: ✭ 66 (-34.65%)
Mutual labels:  flutter-plugin
Flutter Apps Collection
This is a repository of a collection of apps made in flutter
Stars: ✭ 98 (-2.97%)
Mutual labels:  flutter-plugin
Flutter native ads
Show AdMob Native Ads use PlatformView
Stars: ✭ 63 (-37.62%)
Mutual labels:  flutter-plugin
Json to form
A flutter plugin to use convert Json to Form
Stars: ✭ 82 (-18.81%)
Mutual labels:  flutter-plugin
Screenshot
Flutter Screenshot Library
Stars: ✭ 100 (-0.99%)
Mutual labels:  flutter-plugin
Launch review
A Flutter plugin to assist in leaving user reviews/ratings in the Google Play Store. Supports both Android and iOS.
Stars: ✭ 98 (-2.97%)
Mutual labels:  flutter-plugin
Flutter weather bg
A rich and cool weather dynamic background plug-in
Stars: ✭ 89 (-11.88%)
Mutual labels:  flutter-plugin

Language: English | 中文简体

GitHub stars GitHub forks GitHub issues

nav_router

nav_router is the simplest / lightweight / convenient routing management solution for flutter. It supports various routing animations, and it is very convenient to jump / pass parameters. To jump to a new page, just routePush (NewPage ());

Log

  • 2020.07.04-Test Flutter 1.17.3

  • 2020.06.03-Cancel pop default empty string data

  • 2020.02.28 - Fix pop method of dev branch flutter error.

Getting started

Add dependency

dependencies:
  nav_router: any #Specific version customization (any means latest)

Related articles updated ...

Then use flutter packages upgrade to update flutter plugin packages

Sample project

There is a pretty sweet example project in the example folder. Check it out. Otherwise, keep reading to get up and running.

Setting up

  • 1.Import our plugin on the page of MaterialApp
import 'package:nav_router/nav_router.dart';
  • 2.Write navGK value innavigatorKey property of MaterialApp
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: '',
      navigatorKey: navGK,
    );
  }
  • 3.Then, we can start using it, here is an example of a jump page
Widget buildItem(RouteModel item) {
  return new FlatButton(
    onPressed: () => routePush(new NewPage()),
    child: new Text('Click to jump'),
  );
}
  • 4.If we want to use other routing animations to jump, we can add jump properties later, such as: gradient animation
routePush(new NewPage(), RouterType.fade);

Parameter passing

Way 1:

Normally push the new page, but add Then at the back, the v behind is the data brought back by the page after we jump, and then we print it out.

routePush(NewPage()).then((v) {
  print('I received::$v');
});

Then our new page will pop the return value. Add our parameters directly in the pop and then the brackets. It can be any type of parameter value. After that, what we wrote above will receive the parameters we returned this time with the past.

FlatButton(
  onPressed: () {
    pop('This is the parameter');
  },
  child: Text('Return with parameters'),
),

Way 2:

Method two can use our NavData, first add the NavData type parameter to the page we want to push to,

class NewPage extends StatlessWidget {
  final NavData navData;

  NewPage({this.navData});
}

Then the following judges whether the navData is empty, that is, whether the superior has received this method, and if so, returns it with parameters.

FlatButton(
  onPressed: () {
    if(navData == null) return;
    widget.navData('NavData mode parameter transmission');
    pop();
  },
  child: Text('Return with parameters'),
),

Then the place where we push can use navData to receive the value and print it out.

routePush(NewPage(navData: (v) {
    print('I received::$v');
  }),
);

Effect map 图片不能显示点我

1.gif 2.gif 3.gif
4.gif 5.gif 6.gif
7.gif 8.gif 9.gif
10.gif 11.gif 12.gif

Flutter WeChat group

Above can't show my point

FlutterJ:www.flutterj.com

Contributor

LICENSE

fluttercandies/nav_router is licensed under the
Apache License 2.0

A permissive license whose main conditions require preservation of copyright and license notices. 
Contributors provide an express grant of patent rights. 
Licensed works, modifications, and larger works may be distributed under different terms and without source code.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].