English Document | 中文文档 |
---|
Our aim is to help developers make development more convenient and experience the beauty of programming!
*1、Support routing management without context
*2、Support 'non-intrusive parameter passing' routing management
*3、Airoute that makes you fall in love with routing management
Airoute in theProjectPractical applicationflutter sample
iOS | Android |
---|---|
:- | :- |
macOS | web |
---|---|
:- | :- |
Use the current package as a dependent library
Add in file 'pubspec.yaml'
dependencies:
airoute: ^version
or
# Route package.
airoute:
git:
url: https://github.com/pdliuw/airoute.git
You can install this library via the command line below
$ flutter pub get
You can also perform the above steps through the visual operation through the project development tool
Now, in your Dart editing code, you can use:
import 'package:airoute/airoute.dart';
Airoute Global configuration
void main() {
runApp(
///
/// Configuration Airoute
Airoute.createMaterialApp(
home: LaunchPage(),
routes: <String, WidgetBuilder>{
"/LaunchPage": (_) => LaunchPage(),
"/SecondPage": (_) => SecondPage(),
},
),
);
}
*1、Jump to new page
Airoute.pushNamed(routeName: "/routeName");
*2、Close page
Airoute.pop();
*3、Jump to new page and add animation
Airoute.pushNamedWithAnimation(
routeName: "/routeName",
routePageAnimation: AirouteTransition.Slide);
*4、Passing parameters, receiving parameters
Passing parameters
Airoute.pushNamed(
routeName: "/Page",
argument: "I'm happy to meet you😄😄😄",
);
Passing number parameters
Airoute.pushNamed(
routeName: "/SecondPage",
argument: 0,
);
Passing Map parameters
Airoute.pushNamed(
routeName: "/Page",
argument: {
"account":"this is accont",
"password":"this is password ",
},
Passing Array parameters
Airoute.pushNamed(
routeName: "/Page",
argument: [
"Air",
"James",
"Lucy",
"Tom",
],
);
Receiving parameters
class Page extends StatefulWidget with AirArgumentReceiver {
@override
State<StatefulWidget> createState() {
return _PageState();
}
@override
void receive(AirArgument argument) {
print("Received${argument.argument}parameters,I am happy😄😄😄");
}
}
*5、Push route
Airoute.push(
route: AwesomeMessageRoute(
awesomeMessage: AwesomeHelper.createAwesome(
title: "title", message: "message"),
theme: null,
settings: RouteSettings(name: "/messageRouteName"),
),
);
*6、More usageclick to see more
- Support route interceptor.
BSD 3-Clause License
Copyright (c) 2020, pdliuw
All rights reserved.