custom_navigator
ウィジェットツリーの任意の場所で独自のナビゲーターを作成しやすくするFlutterパッケージです。
ウィジェットツリーの深い部分でのナビゲーションを処理するFlutterパッケージ
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
A flutter package that makes it easy to create your own navigator anywhere in the widget tree.
A common use for such widget is when you need to implement an "Always presenting bottom navigation bar"
First you need to add the package to your pubspec.yaml file.
CustomScaffold is a stateful widget that uses the CustomNavigator to to handle item transition of [BottomNavigationBar] with nested navigation while keeping the [BottomNavigationBar] visible!
// Here's the custom scaffold widget
// It takes a normal scaffold with mandatory bottom navigation bar
// and children who are your pages
CustomScaffold(
scaffold: Scaffold(
bottomNavigationBar: BottomNavigationBar(
items: _items,
),
),
// Children are the pages that will be shown by every click
// They should placed in order such as
// `page 0` will be presented when `item 0` in the [BottomNavigationBar] clicked.
children: <Widget>[
Page('0'),
Page('1'),
Page('2'),
],
// Called when one of the [items] is tapped.
onItemTap: (index) {},
);
See the custom_scaffold_example for more details
The CustomNavigator is fairly easy to use
CustomNavigator(
home: YourChildWidget(),
//Specify your page route [PageRoutes.materialPageRoute] or [PageRoutes.cupertinoPageRoute]
pageRoute: PageRoutes.materialPageRoute,
);
Then you can call it using the same old Navigator.of(context)
if you want to use the default [Navigator] you need to specify a
[GlobalKey] to your [MaterialApp] and use it navigatorKey.currentState
See the example for more details.
依存関係一覧 2 件
{"sdk":"flutter"}{"sdk":"flutter"}用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗