ok_route 0.1.1 ok_route: ^0.1.1 copied to clipboard
A sample command-line application.
ok_route #
Annotation route of flutter.
Usage #
import project #
dependencies:
ok_route: ^0.1.1
Add Annotation to your widget #
import `package:ok_route:okroute.dart`;
@OKRoute("/home")
class HomePage extends StatelessWidget{
// ...
}
Generate route class #
How to use pub global
Use pub global
Add pub/pub.bat
to your $PATH.
Add cache/bin to your path like image
Get generator
$ pub global activate ok_route
or
$ pub.bat global activate ok_route
Use generator
$ ok_route $your_project
Use route in your project #
import 'package:ok_route_example/okroutes.dart'; // The dart file have the routes.
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,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
routes: OKRouteMap.getRoutes(), // routes create by ok_route.
);
}
}
LICENSE #
MIT style