kevin-sakemaer/flouter
Navigator 2.0 및 정규 표현식을 기반으로 한 플러터 라우터
- Stars
- 40
- Forks
- 4
- 최근 푸시(UTC)
- 2021. 3. 4.
- 프로젝트 상태
- 활성
언어DartHTMLSwiftKotlinObjective-C
기술 주제
사용 중인 의존성
원본 README
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
README 펼치기 / 접기
A Navigator 2.0 router for Flutter
Easy to use router library that do all the work for you !
Easy
First create a MaterialApp.router :
return MaterialApp.router(
title: 'Uri navigator App',
routerDelegate: _routerDelegate,
routeInformationParser: UriRouteInformationParser(),
);
Second initialize your _routerDelegate like this :
final _routerDelegate = UriRouterDelegate(
pageNotFound: (routeInformation) => MaterialPage(
key: ValueKey('not-found-page'),
child: Scaffold(
body: Center(
child: Text('Page ${routeInformation.uri.path} not found'),
),
),
),
initialUris: [
Uri.parse('/'),
Uri.parse('/test/titi/'),
],
pages: {
RegExp(r'^/$'): (_) => HomePage(),
RegExp(r'^/test/([a-z]+)/$'): (routeInformation) => TestPage(routeInformation),
},
);
That's all you have to do ;)