feat(app): segmented glass top bar across the app

Extract the chat's segmented bar into lib/ui/adaptive (SegmentedBar,
GlassPill, SegmentedBarOverlay) and use it for the shell bar, DetailPane
and every page-level bar. Pieces are frosted glass over a fading scrim;
only pills take taps. Actions keep their natural width so the title gives
way before a model name. The chat transcript scrolls behind its header.
This commit is contained in:
2026-10-31 00:21:27 +00:00
parent 4a85a12cf7
commit 0582bfc34f
42 changed files with 1391 additions and 571 deletions
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../ui/theme/app_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@@ -392,15 +393,17 @@ class _ArtifactGalleryPageState extends State<ArtifactGalleryPage> {
// Sections paint the grouped background; the page must match it or a
// white seam shows below the last section in light mode.
backgroundColor: AppColors.groupedBackground,
navigationBar: const CupertinoNavigationBar(
middle: Text(artifactGalleryTitle),
navigationBar: const SegmentedBar(
cupertino: true,
title: artifactGalleryTitle,
),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(title: const Text(artifactGalleryTitle)),
body: SafeArea(top: false, child: body),
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: artifactGalleryTitle),
body: SafeArea(child: body),
);
}
}
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../ui/theme/app_theme.dart';
import '../../../ui/input/arrow_key_pager.dart';
import 'dart:convert';
@@ -252,15 +253,14 @@ class _ArtifactViewerPageState extends State<ArtifactViewerPage> {
if (usesCupertinoHost(context)) {
return CupertinoPageScaffold(
backgroundColor: AppColors.groupedBackground,
navigationBar: CupertinoNavigationBar(
middle: Text(title, overflow: TextOverflow.ellipsis),
),
navigationBar: SegmentedBar(cupertino: true, title: title),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(title: Text(title, overflow: TextOverflow.ellipsis)),
body: SafeArea(top: false, child: body),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: title),
body: SafeArea(child: body),
);
}
}
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../ui/input/arrow_key_pager.dart';
import 'dart:async';
@@ -302,15 +303,16 @@ class _FileDiffPageState extends State<FileDiffPage> {
);
if (cupertino) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text(name)),
navigationBar: SegmentedBar(cupertino: true, title: name),
child: SafeArea(
child: Theme(data: hostTextTheme(context), child: body),
),
);
}
return Scaffold(
appBar: AppBar(title: Text(name)),
body: SafeArea(top: false, child: body),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: name),
body: SafeArea(child: body),
);
}
}
@@ -1,10 +1,11 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../ui/sessions/chat_adaptive.dart';
/// The open conversation's bar: separate rounded pieces on the page's own
/// background above the transcript, instead of one solid app bar.
/// The open conversation's bar: the app's [SegmentedBar] above the
/// transcript.
///
/// From the leading edge: a round Back (only where the page can go back), a
/// pill with the conversation's title and folder that opens the chat's
@@ -37,206 +38,26 @@ class ChatThreadHeader extends StatelessWidget {
Widget build(BuildContext context) {
final cupertino =
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
final background = cupertino
? CupertinoTheme.of(context).scaffoldBackgroundColor
: Theme.of(context).colorScheme.surface;
return ColoredBox(
color: background,
child: SafeArea(
bottom: false,
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(12, 8, 12, 16),
child: LayoutBuilder(
builder: (context, constraints) => Row(
children: [
if (showBack) ...[
_ChatHeaderPill(
circle: true,
child: _BackControl(
cupertino: cupertino,
onPressed: onBack,
),
),
const SizedBox(width: 8),
],
Expanded(
child: Align(
alignment: AlignmentDirectional.centerStart,
child: _TitlePill(
title: title,
folder: folder,
cupertino: cupertino,
onPressed: onInfo,
),
),
),
if (controls.isNotEmpty) ...[
const SizedBox(width: 8),
// The controls keep to the trailing edge and at most about
// half the bar, so the title always has room; each control
// ellipsises its own label, the model's taking the larger share.
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth * 0.45,
),
child: _ChatHeaderPill(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(flex: 3, child: controls.first),
for (final control in controls.skip(1))
Flexible(flex: 2, child: control),
],
),
),
),
],
],
),
),
),
),
);
}
}
/// One rounded, filled piece of the bar in the host's raised surface role.
class _ChatHeaderPill extends StatelessWidget {
const _ChatHeaderPill({required this.child, this.circle = false});
final Widget child;
final bool circle;
@override
Widget build(BuildContext context) {
final cupertino =
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
final fill = cupertino
? CupertinoColors.systemGrey6.resolveFrom(context)
: Theme.of(context).colorScheme.surfaceContainerHigh;
final shape = circle
? const CircleBorder()
: const StadiumBorder() as ShapeBorder;
if (cupertino) {
return ClipPath(
clipper: ShapeBorderClipper(shape: shape),
child: ColoredBox(color: fill, child: child),
);
}
return Material(
color: fill,
shape: shape,
clipBehavior: Clip.antiAlias,
child: child,
);
}
}
/// The platform's own Back control, so it reads and behaves as every other
/// page's Back; its key and the conversation's destination wording stay.
class _BackControl extends StatelessWidget {
const _BackControl({required this.cupertino, required this.onPressed});
final bool cupertino;
final VoidCallback? onPressed;
@override
Widget build(BuildContext context) => KeyedSubtree(
key: const Key('chat-back'),
child: cupertino
? CupertinoNavigationBarBackButton(onPressed: onPressed)
: BackButton(onPressed: onPressed),
);
}
/// The title and its folder in one pill; pressing it opens the chat's
/// information.
class _TitlePill extends StatelessWidget {
const _TitlePill({
required this.title,
required this.folder,
required this.cupertino,
required this.onPressed,
});
final String title;
final String folder;
final bool cupertino;
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
final TextStyle? titleStyle;
final TextStyle? folderStyle;
if (cupertino) {
final text = CupertinoTheme.of(context).textTheme;
titleStyle = text.textStyle.copyWith(fontWeight: FontWeight.w600);
folderStyle = text.tabLabelTextStyle.copyWith(
color: CupertinoColors.secondaryLabel.resolveFrom(context),
);
} else {
final theme = Theme.of(context);
titleStyle = theme.textTheme.titleSmall;
folderStyle = theme.textTheme.labelSmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
);
}
final content = Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title.isEmpty ? 'Chat' : title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: titleStyle,
),
if (folder.isNotEmpty)
Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
cupertino ? CupertinoIcons.folder : Icons.folder_outlined,
size: folderStyle?.fontSize,
color: folderStyle?.color,
),
const SizedBox(width: 4),
Flexible(
child: Text(
folder,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: folderStyle,
),
),
],
),
],
),
);
return _ChatHeaderPill(
child: Semantics(
button: true,
label: 'Chat information',
child: cupertino
? CupertinoButton(
key: const Key('chat-info'),
padding: EdgeInsets.zero,
minimumSize: Size.zero,
onPressed: onPressed,
child: DefaultTextStyle.merge(
style: titleStyle,
child: content,
),
)
: InkWell(
key: const Key('chat-info'),
onTap: onPressed,
child: content,
),
),
return SegmentedBar(
cupertino: cupertino,
automaticallyImplyLeading: false,
// The platform's own Back, so it reads and behaves as every other
// page's Back; its key stays for finders.
leading: showBack
? SegmentedBackButton(
key: const Key('chat-back'),
cupertino: cupertino,
onPressed: onBack,
)
: null,
title: title.isEmpty ? 'Chat' : title,
subtitle: folder,
subtitleIcon: cupertino ? CupertinoIcons.folder : Icons.folder_outlined,
onTitlePressed: onInfo,
titleSemanticLabel: 'Chat information',
titleKey: const Key('chat-info'),
actions: controls,
bottomPadding: 16,
);
}
}
@@ -28,6 +28,7 @@ import 'chat_models.dart';
import 'chat_row_keys.dart';
import 'chat_scroll.dart';
import 'chat_thread_controller.dart';
import '../../../ui/adaptive/segmented_bar_overlay.dart';
import 'chat_thread_header.dart';
import 'chat_transcript_cache.dart';
import 'chat_permission_card_model.dart';
@@ -718,121 +719,135 @@ class _ChatThreadViewState extends State<ChatThreadView> {
final inShellBar = ShellBar.available(context);
final column = Column(
children: [
// The conversation's own floating bar, above its transcript.
_header(context, inShellBar),
Expanded(
child: NotificationListener<ScrollMetricsNotification>(
onNotification: _onScrollMetrics,
child: NotificationListener<ScrollNotification>(
onNotification: _onScrollNotification,
child: Stack(
children: [
ListView(
key: ValueKey<String>('chat-thread-${widget.sessionId}'),
controller: _scroll,
padding: const EdgeInsets.symmetric(vertical: 8),
children: [
if (initialLoad)
Padding(
key: const Key('chat-thread-loading'),
padding: const EdgeInsets.all(16),
child: Center(
child: cupertino
? const CupertinoActivityIndicator()
: const CircularProgressIndicator(),
),
// The conversation's own bar floats over its transcript, which
// scrolls behind it.
child: SegmentedBarOverlay(
bar: _header(context, inShellBar),
child: NotificationListener<ScrollMetricsNotification>(
onNotification: _onScrollMetrics,
child: NotificationListener<ScrollNotification>(
onNotification: _onScrollNotification,
child: Stack(
children: [
Builder(
// At rest the first item starts below the floating bar.
builder: (context) => ListView(
key: ValueKey<String>(
'chat-thread-${widget.sessionId}',
),
if (_controller.hasMore)
Padding(
key: const Key('chat-load-older'),
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Align(
alignment: AlignmentDirectional.centerStart,
child: cupertino
? CupertinoButton(
padding: EdgeInsets.zero,
onPressed: _controller.loading
? null
: _controller.loadOlder,
child: const Text('Load older'),
)
: TextButton(
onPressed: _controller.loading
? null
: _controller.loadOlder,
child: const Text('Load older'),
),
),
controller: _scroll,
padding: EdgeInsets.only(
top: MediaQuery.paddingOf(context).top + 8,
bottom: 8,
),
if (historyNotice != null)
_ChatNoticeLine(
key: const Key('chat-history-error'),
notice: historyNotice,
onDismiss: _dismiss,
onRetry: _controller.load,
),
if (liveNotice != null)
_ChatNoticeLine(
key: const Key('chat-live-error'),
notice: liveNotice,
onDismiss: _dismiss,
onRetry: _controller.resync,
),
if (_controller.loaded &&
allRows.isEmpty &&
allNotices.isEmpty &&
_commandNotices.isEmpty &&
_controller.error == null)
const Padding(
key: Key('chat-thread-empty'),
padding: EdgeInsets.all(16),
child: Text('No messages in this chat yet.'),
),
for (var index = 0; index < rows.length; index++)
Padding(
key: ValueKey<String>(keys[index]),
padding: const EdgeInsets.symmetric(horizontal: 16),
child: _transcriptRow(
rows[index],
onDismissCompaction:
compactionNotice != null &&
chatNoticeActivityCondition(
rows[index],
) ==
compactionNotice.condition
? () => _dismiss(compactionNotice)
: null,
),
),
// The conversation's own command lines sit after the
// turns, as on the web; they are never bubbles.
for (final notice in _commandNotices)
_ChatNoticeLine(
key: ValueKey<String>(
'chat-command-notice-${notice.condition}',
),
notice: notice,
onDismiss: _dismiss,
),
],
),
if (showJump)
PositionedDirectional(
end: 16,
bottom: 16,
child: _ChatJumpToLatest(
key: const Key('chat-jump-to-latest'),
label: chatJumpToLatestLabel(newMessages),
cupertino: cupertino,
onPressed: _followLatest,
children: [
if (initialLoad)
Padding(
key: const Key('chat-thread-loading'),
padding: const EdgeInsets.all(16),
child: Center(
child: cupertino
? const CupertinoActivityIndicator()
: const CircularProgressIndicator(),
),
),
if (_controller.hasMore)
Padding(
key: const Key('chat-load-older'),
padding: const EdgeInsets.symmetric(
horizontal: 16,
),
child: Align(
alignment: AlignmentDirectional.centerStart,
child: cupertino
? CupertinoButton(
padding: EdgeInsets.zero,
onPressed: _controller.loading
? null
: _controller.loadOlder,
child: const Text('Load older'),
)
: TextButton(
onPressed: _controller.loading
? null
: _controller.loadOlder,
child: const Text('Load older'),
),
),
),
if (historyNotice != null)
_ChatNoticeLine(
key: const Key('chat-history-error'),
notice: historyNotice,
onDismiss: _dismiss,
onRetry: _controller.load,
),
if (liveNotice != null)
_ChatNoticeLine(
key: const Key('chat-live-error'),
notice: liveNotice,
onDismiss: _dismiss,
onRetry: _controller.resync,
),
if (_controller.loaded &&
allRows.isEmpty &&
allNotices.isEmpty &&
_commandNotices.isEmpty &&
_controller.error == null)
const Padding(
key: Key('chat-thread-empty'),
padding: EdgeInsets.all(16),
child: Text('No messages in this chat yet.'),
),
for (var index = 0; index < rows.length; index++)
Padding(
key: ValueKey<String>(keys[index]),
padding: const EdgeInsets.symmetric(
horizontal: 16,
),
child: _transcriptRow(
rows[index],
onDismissCompaction:
compactionNotice != null &&
chatNoticeActivityCondition(
rows[index],
) ==
compactionNotice.condition
? () => _dismiss(compactionNotice)
: null,
),
),
// The conversation's own command lines sit after the
// turns, as on the web; they are never bubbles.
for (final notice in _commandNotices)
_ChatNoticeLine(
key: ValueKey<String>(
'chat-command-notice-${notice.condition}',
),
notice: notice,
onDismiss: _dismiss,
),
],
),
),
],
if (showJump)
PositionedDirectional(
end: 16,
bottom: 16,
child: _ChatJumpToLatest(
key: const Key('chat-jump-to-latest'),
label: chatJumpToLatestLabel(newMessages),
cupertino: cupertino,
onPressed: _followLatest,
),
),
],
),
),
),
),
),
ChatComposerBar(
key: ValueKey<String>('chat-composer-${widget.sessionId}'),
composer: _composer,
@@ -1,3 +1,4 @@
import '../../../../ui/adaptive/segmented_bar.dart';
import 'dart:async';
import 'package:flutter/cupertino.dart';
@@ -205,28 +206,28 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
children: [
ContentWidth(
child: ChatSessionsBody(
sessions: _controller.sessions,
activeSessionId: widget.activeSessionId,
query: _search.text,
loading: _controller.loading,
error: _controller.error,
onOpen: _open,
onRename: _rename,
onClose: _close,
onReopen: (session) =>
_controller.reopen(_sessionId(session)),
onStar: (session) => _controller.star(
_sessionId(session),
session['starred'] != true,
),
onHide: _hide,
onClearSearch: () {
_search.clear();
setState(() {});
},
isUnseen: _controller.isUnseen,
errorFor: _controller.errorFor,
onDismissError: _controller.dismissError,
sessions: _controller.sessions,
activeSessionId: widget.activeSessionId,
query: _search.text,
loading: _controller.loading,
error: _controller.error,
onOpen: _open,
onRename: _rename,
onClose: _close,
onReopen: (session) =>
_controller.reopen(_sessionId(session)),
onStar: (session) => _controller.star(
_sessionId(session),
session['starred'] != true,
),
onHide: _hide,
onClearSearch: () {
_search.clear();
setState(() {});
},
isUnseen: _controller.isUnseen,
errorFor: _controller.errorFor,
onDismissError: _controller.dismissError,
),
),
// The web's hide report is a fixed overlay: replacing or
@@ -285,19 +286,22 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
if (chatControlsStyleOf(context) == ChatControlsStyle.cupertino) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: const Text('Chats'),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: _actions(),
),
navigationBar: SegmentedBar(
cupertino: true,
title: 'Chats',
actions: _actions(),
),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(title: const Text('Chats'), actions: _actions()),
body: body,
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
title: 'Chats',
actions: _actions(),
),
body: SafeArea(left: false, right: false, bottom: false, child: body),
floatingActionButton: FloatingActionButton.extended(
key: const Key('chat-new-chat-fab'),
onPressed: _newChat,
@@ -1,3 +1,4 @@
import '../../../../ui/adaptive/segmented_bar.dart';
import 'dart:typed_data';
import 'package:flutter/cupertino.dart';
@@ -46,12 +47,13 @@ class ChatImageViewer extends StatelessWidget {
void close() => Navigator.of(context).maybePop();
if (cupertino) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
navigationBar: SegmentedBar(
cupertino: true,
automaticallyImplyLeading: false,
middle: Text(name, overflow: TextOverflow.ellipsis),
title: name,
leading: CupertinoButton(
key: const Key('chat-image-viewer-close'),
padding: EdgeInsets.zero,
padding: const EdgeInsets.symmetric(horizontal: 16),
onPressed: close,
child: const Text(chatImageViewerClose),
),
@@ -60,7 +62,9 @@ class ChatImageViewer extends StatelessWidget {
);
}
return Scaffold(
appBar: AppBar(
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
automaticallyImplyLeading: false,
leading: IconButton(
key: const Key('chat-image-viewer-close'),
@@ -68,7 +72,7 @@ class ChatImageViewer extends StatelessWidget {
onPressed: close,
icon: const Icon(Icons.close),
),
title: Text(name, overflow: TextOverflow.ellipsis),
title: name,
),
body: body,
);
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../ui/adaptive/host.dart';
import 'graph_viewport.dart';
import 'graph_viewport_controller.dart';
@@ -102,22 +103,27 @@ class _GraphExpandedViewState extends State<GraphExpandedView> {
);
if (usesCupertinoHost(context)) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
navigationBar: SegmentedBar(
cupertino: true,
automaticallyImplyLeading: false,
middle: Text(widget.title),
trailing: CupertinoButton(
key: const Key('graph-expanded-close'),
padding: EdgeInsets.zero,
onPressed: _close,
child: const Text(graphExpandedClose),
),
title: widget.title,
actions: [
CupertinoButton(
key: const Key('graph-expanded-close'),
padding: const EdgeInsets.symmetric(horizontal: 16),
onPressed: _close,
child: const Text(graphExpandedClose),
),
],
),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
title: widget.title,
automaticallyImplyLeading: false,
actions: [
TextButton(
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import 'dart:convert';
import 'package:flutter/cupertino.dart';
@@ -141,14 +142,15 @@ Future<void> openStageDefinition(
? CupertinoPageRoute<void>(
settings: settings,
builder: (_) => CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text(title)),
navigationBar: SegmentedBar(cupertino: true, title: title),
child: SafeArea(child: view),
),
)
: MaterialPageRoute<void>(
settings: settings,
builder: (_) => Scaffold(
appBar: AppBar(title: Text(title)),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: title),
body: SafeArea(child: view),
),
);
+14 -13
View File
@@ -1,3 +1,4 @@
import '../../ui/adaptive/segmented_bar.dart';
import '../../shell/destination.dart';
import '../../shell/detail_page.dart';
import '../../shell/list_detail.dart';
@@ -351,8 +352,10 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
Widget _materialShell(BuildContext context, Widget body) {
return Scaffold(
appBar: AppBar(
title: const Text('Pipelines'),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
title: 'Pipelines',
actions: [
...pipelineListActions(context, _controller),
if (widget.onOpenSchedules != null) _schedulesButton(context),
@@ -365,18 +368,16 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
Widget _cupertinoShell(BuildContext context, Widget body) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: const Text('Pipelines'),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
...pipelineListActions(context, _controller),
if (widget.onOpenSchedules != null) _schedulesButton(context),
_refreshButton(context),
],
),
navigationBar: SegmentedBar(
cupertino: true,
title: 'Pipelines',
actions: [
...pipelineListActions(context, _controller),
if (widget.onOpenSchedules != null) _schedulesButton(context),
_refreshButton(context),
],
),
child: SafeArea(top: false, child: body),
child: SafeArea(child: body),
);
}
}
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../pipeline_filter.dart';
import 'pipeline_controls.dart';
import 'pipeline_filter_cupertino_body.dart';
@@ -99,20 +100,25 @@ class _PipelineFilterPageState extends State<PipelineFilterPage> {
);
if (widget.cupertino) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: const Text('Filter pipelines'),
trailing: CupertinoButton(
padding: EdgeInsets.zero,
onPressed: _apply,
child: const Text('Done'),
),
navigationBar: SegmentedBar(
cupertino: true,
title: 'Filter pipelines',
actions: [
CupertinoButton(
padding: const EdgeInsets.symmetric(horizontal: 16),
onPressed: _apply,
child: const Text('Done'),
),
],
),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(
title: const Text('Filter pipelines'),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
title: 'Filter pipelines',
actions: [TextButton(onPressed: _apply, child: const Text('Done'))],
),
body: SafeArea(child: body),
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../core/api_gateway.dart';
import '../../../ui/adaptive/host.dart';
import '../../changes/changes.dart';
@@ -185,9 +186,9 @@ class _MaterialChangesPage extends StatelessWidget {
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: Text(title)),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: title),
body: SafeArea(
top: false,
child: ChangesViewer(steps: steps, showSummary: showSummary),
),
);
@@ -206,7 +207,7 @@ class _CupertinoChangesPage extends StatelessWidget {
@override
Widget build(BuildContext context) => CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text(title)),
navigationBar: SegmentedBar(cupertino: true, title: title),
child: SafeArea(
// A CupertinoApp supplies no Material theme; follow the host brightness
// so the viewer's Material-derived section text stays readable.
+13 -7
View File
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
@@ -302,25 +303,30 @@ class _RunDetailTabsState extends State<RunDetailTabs> {
final title = detailTitle(run);
if (cupertino) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
leading: CupertinoNavigationBarBackButton(
navigationBar: SegmentedBar(
cupertino: true,
leading: SegmentedBackButton(
key: const Key('run-visit-back'),
cupertino: true,
onPressed: () => Navigator.of(pageContext).pop(),
),
middle: Text(title),
title: title,
),
child: SafeArea(child: pane),
);
}
return Scaffold(
appBar: AppBar(
leading: BackButton(
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
leading: SegmentedBackButton(
key: const Key('run-visit-back'),
cupertino: false,
onPressed: () => Navigator.of(pageContext).pop(),
),
title: Text(title),
title: title,
),
body: SafeArea(top: false, child: pane),
body: SafeArea(child: pane),
);
},
);
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../core/api_gateway.dart';
import '../../../ui/adaptive/host.dart';
import '../../graph/widgets/run_graph_view.dart';
@@ -105,16 +106,18 @@ class RunGraphPreview extends StatelessWidget {
cupertino
? CupertinoPageRoute<void>(
builder: (page) => CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Graph'),
navigationBar: const SegmentedBar(
cupertino: true,
title: 'Graph',
),
child: SafeArea(child: graphView(page)),
),
)
: MaterialPageRoute<void>(
builder: (page) => Scaffold(
appBar: AppBar(title: const Text('Graph')),
body: SafeArea(top: false, child: graphView(page)),
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Graph'),
body: SafeArea(child: graphView(page)),
),
),
);
@@ -1,3 +1,4 @@
import '../../../ui/adaptive/segmented_bar.dart';
import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
@@ -37,13 +38,14 @@ class RunsStatsPage extends StatelessWidget {
);
if (cupertino) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Usage')),
navigationBar: const SegmentedBar(cupertino: true, title: 'Usage'),
child: SafeArea(child: body),
);
}
return Scaffold(
appBar: AppBar(title: const Text('Usage')),
body: SafeArea(top: false, child: body),
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Usage'),
body: SafeArea(child: body),
);
}
@@ -1,3 +1,4 @@
import '../../../../ui/adaptive/segmented_bar.dart';
import 'dart:math';
import 'package:flutter/cupertino.dart';
@@ -43,14 +44,15 @@ Future<void> openSchedulePipelineEditor(
? CupertinoPageRoute<void>(
settings: settings,
builder: (_) => CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text(title)),
child: SafeArea(top: false, child: page),
navigationBar: SegmentedBar(cupertino: true, title: title),
child: SafeArea(child: page),
),
)
: MaterialPageRoute<void>(
settings: settings,
builder: (_) => Scaffold(
appBar: AppBar(title: Text(title)),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: title),
body: SafeArea(child: page),
),
);
+4 -2
View File
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../ui/adaptive/segmented_bar.dart';
import '../../core/api_gateway.dart';
import '../../ui/adaptive/host.dart';
import 'data/search_repository.dart';
@@ -132,7 +133,8 @@ class _SearchScreenState extends State<SearchScreen> {
);
if (widget.embedded) return body;
return Scaffold(
appBar: AppBar(title: const Text('Search')),
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Search'),
body: body,
);
}
@@ -203,7 +205,7 @@ class _SearchScreenState extends State<SearchScreen> {
);
if (widget.embedded) return body;
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Search')),
navigationBar: const SegmentedBar(cupertino: true, title: 'Search'),
child: body,
);
}
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../ui/adaptive/segmented_bar.dart';
import '../../core/servers/server_catalog.dart';
import '../../ui/adaptive/host.dart';
@@ -177,11 +178,12 @@ class _ServerEditorState extends State<_ServerEditor> {
canPop: !_saving,
child: cupertino
? CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text(title)),
navigationBar: SegmentedBar(cupertino: true, title: title),
child: body,
)
: Scaffold(
appBar: AppBar(title: Text(title)),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(cupertino: false, title: title),
body: body,
),
);
@@ -1,3 +1,4 @@
import '../../ui/adaptive/segmented_bar.dart';
import 'dart:async';
import 'package:flutter/cupertino.dart';
@@ -267,12 +268,13 @@ class _SettingsScreenState extends State<SettingsScreen> {
if (widget.embedded) return content;
if (usesCupertinoControls(context)) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Settings')),
navigationBar: const SegmentedBar(cupertino: true, title: 'Settings'),
child: content,
);
}
return Scaffold(
appBar: AppBar(title: const Text('Settings')),
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Settings'),
body: content,
);
}
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../ui/adaptive/host.dart';
const templatesRefreshKey = ValueKey<String>('templates-refresh');
@@ -55,7 +56,8 @@ class TemplatesFrame extends StatelessWidget {
Widget _cupertino(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
navigationBar: SegmentedBar(
cupertino: true,
leading: canGoBack
? CupertinoButton(
key: templatesBackKey,
@@ -64,8 +66,8 @@ class TemplatesFrame extends StatelessWidget {
child: const Icon(CupertinoIcons.back, semanticLabel: 'Back'),
)
: null,
middle: const Text('Templates'),
trailing: _refreshButton(context),
title: 'Templates',
actions: [_refreshButton(context)],
),
child: SafeArea(child: body),
);
@@ -73,8 +75,10 @@ class TemplatesFrame extends StatelessWidget {
Widget _material(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Templates'),
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
title: 'Templates',
leading: canGoBack
? BackButton(key: templatesBackKey, onPressed: onBack)
: null,