v0.9.1backdrop
Dart におけるバックドロップの実装。(https://material.io/design/components/backdrop.html)
Flutterにおけるバックドロップの実装。
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
ARCHIVE NOTE: Backdrop was based on the Material 2 Backdrop specification, which is no longer actively maintained. Material 3 does not include a Backdrop specification. As a result, this package is no longer actively developed and is limited to maintenance and critical fixes.
Backdrop implementation in flutter.
This widget is in active development. Any contribution, idea, criticism or feedback is welcomed.
| Package | https://pub.dev/packages/backdrop |
| API Docs | https://pub.dev/documentation/backdrop/latest/backdrop/backdrop-library.html |
| Live Demo | https://fluttercommunity.github.io/backdrop/demo/#/ |
| Git Repo | https://github.com/fluttercommunity/backdrop |
| Issue Tracker | https://github.com/fluttercommunity/backdrop/issues |
| Chat Room | https://gitter.im/flutter-backdrop |
Use BackdropScaffold instead of the standard Scaffold in your app.
A backLayer and a frontLayer have to be defined for the backdrop to work.
BackdropScaffold(
appBar: BackdropAppBar(
title: Text("Backdrop Example"),
actions: <Widget>[
BackdropToggleButton(
icon: AnimatedIcons.list_view,
)
],
),
backLayer: Center(
child: Text("Back Layer"),
),
frontLayer: Center(
child: Text("Front Layer"),
),
)
To use backdrop for navigation, use the provided BackdropNavigationBackLayer as backLayer.
The BackdropNavigationBackLayer contains a property items representing the list elements shown on the back layer. The front layer has to be "manually" set depending on the current index, which can be accessed with the onTap callback.
int _currentIndex = 0;
final List<Widget> _pages = [Widget1(), Widget2()];
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Backdrop Demo',
home: BackdropScaffold(
appBar: BackdropAppBar(
title: Text("Navigation Example"),
actions: <Widget>[
BackdropToggleButton(
icon: AnimatedIcons.list_view,
)
],
),
stickyFrontLayer: true,
frontLayer: _pages[_currentIndex],
backLayer: BackdropNavigationBackLayer(
items: [
ListTile(title: Text("Widget 1")),
ListTile(title: Text("Widget 2")),
],
onTap: (int position) => {setState(() => _currentIndex = position)},
),
),
);
}
To access backdrop related functionalities, use Backdrop.of(context) to get underlying BackdropScaffoldState.
BackdropScaffoldState exposes various properties and methods like:
animationController -> AnimationControllerscaffoldKey -> GlobalKey<ScaffoldState> isBackLayerConcealed -> boolisBackLayerRevealed -> boolfling()concealBackLayer()revealBackLayer()Note:
Backdropis anInheritedWidgetand therefore likeScaffold.of,Theme.ofandMediaQuery.of, theBuildContext contextpassed toBackdrop.of(context)should be of aWidgetthat is under theBackdropScaffoldin the "widget tree". In other words,Backdrop.ofcalled inside a widget where theBackdropScaffoldis initalized will not work explicitly, since thecontextpassed is of the widget that will buildBackdropScaffoldtherefore aboveBackdropScaffold. This can be solved by either making a seperateWidgetwhereBackdrop.ofneeds to be used and make it the "child" ofBackdropScaffoldor wrap theBackdrop.ofusage aroundBuilderwidget so that the "correct"context(fromBuilder) is passed toBackdrop.of. This answere on SO and FWotW video on Builder gives a very good idea of how and whyBuilderworks in later case.
For more information, check out sample code in the example directory, demo app with use-cases and code for it and API references generated by pub.dev.
Check proposal documents for v1.0 and web&desktop milestones before you begin with any contibution.
Please file feature requests and bugs at the issue tracker.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
依存関係一覧 3 件
{"sdk":"flutter"}{"sdk":"flutter"}^2.0.0用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗