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 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); } }