Artifact viewer: keep the preview between the top bar and the controls
Every preview (image, text, markdown, HTML, video) now fills the space between the viewer's top bar and its bottom controls instead of passing behind them; the insets are applied once here and removed for the content inside.
This commit is contained in:
@@ -67,9 +67,7 @@ class ArtifactViewerBody extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final resolved = plan.resolved;
|
||||
// The page never scrolls: the preview fills the middle (it zooms or
|
||||
// scrolls itself) and the controls float over its bottom edge.
|
||||
final content = Column(
|
||||
final preview = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -85,6 +83,23 @@ class ArtifactViewerBody extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
);
|
||||
// The page never scrolls: the preview fills the space between the top
|
||||
// bar and the bottom controls (it zooms or scrolls itself), never
|
||||
// passing behind either; the insets are spent here, not again inside.
|
||||
final content = Builder(
|
||||
builder: (context) {
|
||||
final insets = MediaQuery.paddingOf(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(top: insets.top, bottom: insets.bottom),
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeTop: true,
|
||||
removeBottom: true,
|
||||
child: preview,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
final hasPrevious = pagedIndex(index, -1, count) != index;
|
||||
final hasNext = pagedIndex(index, 1, count) != index;
|
||||
final swipe = GestureDetector(
|
||||
|
||||
Reference in New Issue
Block a user