idev 0.1.2 icon indicating copy to clipboard operation
idev: ^0.1.2 copied to clipboard

A new Flutter package project.

IRouter的使用 #

IRouter.provider()

  1. app组件的initState里创建delegate和parser: _routeParser = IRouteParser( routes: { '/': (BuildContext context, Map<String, dynamic> params) => const FirstPage(), '/second': (context, params) => const SecondPage(), }, initialRoute: '/', );

    _routeState = IRouter(_routeParser);

    const _scaffoldKey = ValueKey('App scaffold'); _routerDelegate = IRouterDelegate( routeState: _routeState, navigatorKey: _navigatorKey, builder: (context) => IRootNavigator(navigatorKey: _navigatorKey, pages: _pages), );

    _pages = [ const MaterialPage

  2. 其builder函数为 @override Widget build(BuildContext context) => IRouter.provider( _routeState, MaterialApp.router( routerDelegate: _routerDelegate, routeInformationParser: _routeParser), );

  3. 对于rail等组件,按照正常的写法,唯显示页面的部分,使用ITab Expanded( child: ITabNavigator( urls: const ['/', '/second'], index: _selectedIndex, tabId: 'ipage', )) 而控制部分,简单的使用: IRouter.push( context, routeState!.tabs['ipage']![index].currentUrl, index);

  4. push和pop: IRouter.push,IRouter.pop

0
likes
100
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter package project.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on idev