Keep the shell tab bar over the list pane on wide splits; cap schedules and reading bodies; share the empty-pane placeholder
This commit is contained in:
@@ -143,17 +143,26 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
// it, learning the bar's height as its bottom media padding. Neither
|
||||
// scaffold's structure depends on the width, so resizing never
|
||||
// remounts a destination.
|
||||
final bar = FloatingDestinationBar(
|
||||
cupertino: widget.cupertino,
|
||||
currentIndex: index,
|
||||
onTap: (value) => _select(AppDestination.values[value]),
|
||||
items: _destinationItems(),
|
||||
//
|
||||
// While the tab shows its list beside an open item, the bar floats
|
||||
// over the list pane only (judging its placement on that width), so
|
||||
// it never covers the item or stacks on the item's own composer.
|
||||
final split = _bar.split(_selected);
|
||||
final bar = ListPaneWidth(
|
||||
split: split,
|
||||
alignment: AlignmentDirectional.bottomStart,
|
||||
child: FloatingDestinationBar(
|
||||
cupertino: widget.cupertino,
|
||||
currentIndex: index,
|
||||
onTap: (value) => _select(AppDestination.values[value]),
|
||||
items: _destinationItems(),
|
||||
),
|
||||
);
|
||||
// Destinations reach the top edge and scroll behind the floating top
|
||||
// bar too: each learns the bar's height as its top media padding and
|
||||
// pads its own lists by it (see withTopBarClearance).
|
||||
final topBar = _ListPaneBar(
|
||||
split: _bar.split(_selected),
|
||||
split: split,
|
||||
bar: _segmentedBar(spec, details.label),
|
||||
);
|
||||
if (widget.cupertino) {
|
||||
@@ -277,19 +286,9 @@ class _ListPaneBar extends StatelessWidget
|
||||
bar.shouldFullyObstruct(context);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final width = split
|
||||
? listDetailListWidth(
|
||||
MediaQuery.sizeOf(context).width,
|
||||
constraints.maxWidth,
|
||||
)
|
||||
: constraints.maxWidth;
|
||||
return Align(
|
||||
alignment: AlignmentDirectional.topStart,
|
||||
heightFactor: 1,
|
||||
child: SizedBox(width: width, child: bar),
|
||||
);
|
||||
},
|
||||
Widget build(BuildContext context) => ListPaneWidth(
|
||||
split: split,
|
||||
alignment: AlignmentDirectional.topStart,
|
||||
child: bar,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user