Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MasterDetailPage.bottomBar #441

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/src/layouts/yaru_landscape_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class YaruLandscapeLayout extends StatefulWidget {
this.previousPaneWidth,
this.onLeftPaneWidthChange,
this.appBar,
this.bottomBar,
required this.controller,
});

Expand All @@ -29,6 +30,7 @@ class YaruLandscapeLayout extends StatefulWidget {
final double? previousPaneWidth;
final Function(double)? onLeftPaneWidthChange;
final PreferredSizeWidget? appBar;
final Widget? bottomBar;
final YaruPageController controller;

@override
Expand Down Expand Up @@ -156,6 +158,7 @@ class _YaruLandscapeLayoutState extends State<YaruLandscapeLayout> {
onTap: _onTap,
builder: widget.tileBuilder,
),
bottomNavigationBar: widget.bottomBar,
),
);
}
Expand Down
6 changes: 6 additions & 0 deletions lib/src/layouts/yaru_master_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class YaruMasterDetailPage extends StatefulWidget {
this.layoutDelegate =
const YaruMasterFixedPaneDelegate(paneWidth: _kDefaultPaneWidth),
this.appBar,
this.bottomBar,
this.initialIndex,
this.onSelected,
this.controller,
Expand Down Expand Up @@ -84,6 +85,9 @@ class YaruMasterDetailPage extends StatefulWidget {
/// An optional custom AppBar for the left pane.
final PreferredSizeWidget? appBar;

/// An optional bottom bar for the left pane.
final Widget? bottomBar;

/// An optional index of the initial page to show.
final int? initialIndex;

Expand Down Expand Up @@ -139,6 +143,7 @@ class _YaruMasterDetailPageState extends State<YaruMasterDetailPage> {
pageBuilder: widget.pageBuilder,
onSelected: widget.onSelected,
appBar: widget.appBar,
bottomBar: widget.bottomBar,
controller: _controller,
);
} else {
Expand All @@ -150,6 +155,7 @@ class _YaruMasterDetailPageState extends State<YaruMasterDetailPage> {
previousPaneWidth: _previousPaneWidth,
onLeftPaneWidthChange: (width) => _previousPaneWidth = width,
appBar: widget.appBar,
bottomBar: widget.bottomBar,
controller: _controller,
);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/src/layouts/yaru_portrait_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class YaruPortraitLayout extends StatefulWidget {
required this.pageBuilder,
this.onSelected,
this.appBar,
this.bottomBar,
required this.controller,
});

Expand All @@ -20,6 +21,7 @@ class YaruPortraitLayout extends StatefulWidget {
final ValueChanged<int>? onSelected;

final PreferredSizeWidget? appBar;
final Widget? bottomBar;

final YaruPageController controller;

Expand Down Expand Up @@ -99,6 +101,7 @@ class _YaruPortraitLayoutState extends State<YaruPortraitLayout> {
onTap: _onTap,
builder: widget.tileBuilder,
),
bottomNavigationBar: widget.bottomBar,
),
),
if (_selectedIndex != -1) page(_selectedIndex)
Expand Down