4e0481fd8d
Full screen button in the viewer's bottom bar opens a root full-screen route with the same bar and top bar; exit by the bar, Close, Escape or back. It renders the already fetched bytes, never the system browser. The external Open action is now labelled Open in browser. Native web views claim their gestures (vertical drags inline, every pointer in full screen) so the page swipe no longer starves them. On the web, full screen adds zoom buttons that scale the live sandboxed frame. Links: in-page anchors scroll, http(s)/mailto open outside, everything else is inert. Capture kit: --touch, swipe=, pinch=, tabs=; html=1 fixture artifact.
43 lines
1.1 KiB
Dart
43 lines
1.1 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../../ui/adaptive/host.dart';
|
|
import '../../../ui/adaptive/segmented_bar.dart';
|
|
import '../../../ui/theme/app_theme.dart';
|
|
|
|
/// The viewer's page structure on either host: its [SegmentedBar] (the
|
|
/// platform's Back, or Close on the full-screen route) over [body].
|
|
class ArtifactViewerScaffold extends StatelessWidget {
|
|
const ArtifactViewerScaffold({
|
|
super.key,
|
|
required this.title,
|
|
required this.subtitle,
|
|
required this.actions,
|
|
required this.body,
|
|
});
|
|
|
|
final String title;
|
|
final String? subtitle;
|
|
final List<Widget> actions;
|
|
final Widget body;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final cupertino = usesCupertinoHost(context);
|
|
final bar = SegmentedBar(
|
|
cupertino: cupertino,
|
|
title: title,
|
|
subtitle: subtitle,
|
|
actions: actions,
|
|
);
|
|
if (cupertino) {
|
|
return CupertinoPageScaffold(
|
|
backgroundColor: AppColors.groupedBackground,
|
|
navigationBar: bar,
|
|
child: body,
|
|
);
|
|
}
|
|
return Scaffold(extendBodyBehindAppBar: true, appBar: bar, body: body);
|
|
}
|
|
}
|