From 9551eceaed09737c887ab2207e3b653d7ea0d915 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 21:55:39 +0000 Subject: [PATCH] Complete Material-only APIs and fixtures Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically. --- app/lib/application/app.dart | 5 - app/lib/application/app_router.dart | 5 - app/lib/application/app_terminals.dart | 26 ++---- app/lib/application/connection_status.dart | 5 +- app/lib/application/pipelines_app.dart | 22 +---- .../application/schedules_destination.dart | 4 - app/lib/application/search_destination.dart | 2 +- .../application/templates_destination.dart | 17 +--- .../actions/artifact_file_actions.dart | 2 +- .../artifacts/ui/artifact_fullscreen.dart | 9 +- .../ui/artifact_fullscreen_host.dart | 1 - .../artifacts/ui/artifact_gallery_page.dart | 1 - .../features/artifacts/ui/artifact_tile.dart | 7 +- .../artifacts/ui/artifact_viewer_bar.dart | 3 +- .../ui/artifact_viewer_scaffold.dart | 1 - .../ui/notification_permission_tile.dart | 5 - .../changes/widgets/changes_viewer.dart | 4 +- .../changes/widgets/file_diff_viewer.dart | 4 +- .../features/chat/chat_screen_workspace.dart | 1 - .../chat_account_usage_section.dart | 2 - .../chat/conversation/chat_bar_tint.dart | 18 ++-- .../chat/conversation/chat_card_styles.dart | 25 +++-- .../chat/conversation/chat_composer_bar.dart | 1 - .../conversation/chat_delivery_indicator.dart | 2 - .../conversation/chat_permission_card.dart | 28 ++---- .../chat/conversation/chat_question_card.dart | 15 +-- .../chat_question_card_controls.dart | 4 +- .../chat_question_card_fields.dart | 16 +--- .../conversation/chat_question_group.dart | 10 +- .../chat_question_option_controls.dart | 2 - .../chat_question_recorded_answers.dart | 25 +---- .../conversation/chat_session_section.dart | 4 +- .../chat/conversation/chat_thread_header.dart | 4 - .../chat/conversation/chat_thread_view.dart | 20 +--- .../chat/shell/chat_shell_history_chip.dart | 2 +- .../shell/chat_shell_history_output_page.dart | 12 +-- .../chat/shell/chat_shell_history_view.dart | 8 +- .../chat/shell/chat_shell_mode_indicator.dart | 11 +-- .../chat/shell/chat_shell_output_view.dart | 2 +- .../chat/shell/chat_shell_run_card.dart | 23 ++--- .../chat/shell/chat_shell_status.dart | 4 +- .../chat/shell/chat_shell_terminal_theme.dart | 4 +- .../ui/folder_picker/folder_picker_page.dart | 3 +- .../chat/ui/sessions/chat_adaptive.dart | 5 - .../chat/ui/sessions/chat_compact_avatar.dart | 4 +- .../ui/sessions/chat_compact_sidebar.dart | 1 - .../chat/ui/sessions/chat_prompt_chooser.dart | 3 - .../ui/sessions/chat_sessions_screen.dart | 6 +- .../chat/ui/sessions/create_chat_dialog.dart | 1 - .../ui/sessions/session_activity_badge.dart | 1 - .../chat/ui/sessions/session_row_content.dart | 4 +- .../transcript/chat_attachment_gallery.dart | 3 - .../transcript/chat_attachment_thumbnail.dart | 10 +- .../chat/ui/transcript/chat_code_hover.dart | 10 +- .../chat/ui/transcript/chat_image_viewer.dart | 12 +-- .../ui/transcript/chat_injected_rows.dart | 2 +- .../ui/transcript/chat_message_bubble.dart | 2 +- .../chat/ui/transcript/chat_message_view.dart | 5 +- .../chat/ui/transcript/chat_turn_chip.dart | 4 +- .../ui/transcript/chat_turn_diff_chip.dart | 3 +- .../shown/chat_shown_html_card.dart | 1 - .../graph/viewport/graph_expanded_view.dart | 3 +- .../graph/viewport/graph_viewport.dart | 1 - .../graph/widgets/stage_definition_view.dart | 2 +- app/lib/features/pipelines/screen.dart | 1 - .../pipelines/ui/run_pipeline_dialog.dart | 1 - .../pipelines/ui/run_pipeline_fields.dart | 4 - .../widgets/pipeline_bar_buttons.dart | 2 - .../pipelines/widgets/pipeline_controls.dart | 5 +- .../widgets/pipeline_filter_page.dart | 6 -- .../widgets/pipeline_list_panel.dart | 1 - .../widgets/pipeline_summary_view.dart | 3 - .../pipelines/widgets/pipeline_tabs.dart | 1 - .../features/runs/actions/cancel_dialog.dart | 6 +- .../runs/actions/cancel_run_action.dart | 1 - .../runs/actions/decision_action.dart | 6 -- .../runs/actions/decision_dialog.dart | 1 - .../runs/actions/delete_runs_action.dart | 2 - .../runs/actions/delete_runs_dialog.dart | 13 +-- .../features/runs/actions/retry_action.dart | 1 - .../features/runs/actions/retry_dialog.dart | 6 +- .../features/runs/actions/title_action.dart | 1 - .../features/runs/actions/title_dialog.dart | 1 - .../features/runs/ui/run_changes_action.dart | 2 +- .../features/runs/ui/run_detail_material.dart | 1 - .../runs/ui/run_detail_tab_bodies.dart | 16 +--- .../runs/ui/run_detail_tab_strip.dart | 1 - app/lib/features/runs/ui/run_detail_tabs.dart | 16 +--- .../features/runs/ui/run_detail_timeline.dart | 6 -- app/lib/features/runs/ui/run_detail_view.dart | 3 - .../features/runs/ui/run_detail_visit.dart | 3 - .../runs/ui/run_detail_visit_sections.dart | 7 +- .../runs/ui/run_detail_wide_chrome.dart | 4 - app/lib/features/runs/ui/run_field_body.dart | 2 - .../features/runs/ui/run_graph_preview.dart | 2 +- app/lib/features/runs/ui/run_list_row.dart | 2 - app/lib/features/runs/ui/run_more_menu.dart | 3 - .../features/runs/ui/run_pipeline_link.dart | 8 +- .../features/runs/ui/runs_selection_bar.dart | 1 - app/lib/features/runs/ui/runs_stats_page.dart | 2 +- app/lib/features/schedules/screen.dart | 1 - .../schedules/ui/list/schedule_list_row.dart | 12 +-- .../ui/list/schedule_list_toolbar.dart | 5 - .../schedules/ui/list/schedule_list_view.dart | 5 - .../ui/pipeline/schedule_pipeline_editor.dart | 2 +- .../ui/pipeline/schedule_pipeline_row.dart | 3 +- app/lib/features/search/search_screen.dart | 22 +---- .../search/ui/material_search_body.dart | 1 - .../search/ui/search_bar_controls.dart | 7 +- .../features/search/ui/search_result_row.dart | 3 - .../search/ui/search_result_slivers.dart | 2 - .../settings/saved_server_editor.dart | 12 +-- .../features/settings/settings_screen.dart | 2 +- app/lib/features/templates/screen.dart | 1 - .../ui/template_create_controls.dart | 5 - .../templates/ui/template_create_dialog.dart | 7 +- .../templates/ui/template_detail.dart | 7 +- .../templates/ui/template_gallery.dart | 1 - .../templates/ui/templates_frame.dart | 9 +- .../features/terminal/terminal_surface.dart | 3 - .../terminal/terminal_toggle_button.dart | 5 +- .../updates/launch_update_dialog.dart | 8 +- app/lib/shell/adaptive_shell.dart | 10 -- app/lib/shell/attention_badge.dart | 8 -- app/lib/shell/destination.dart | 43 +++------ app/lib/shell/detail_page.dart | 2 - app/lib/shell/shell_destination_menu.dart | 4 - .../ui/adaptive/floating_destination_bar.dart | 44 +++------ .../adaptive/floating_destination_labels.dart | 2 - app/lib/ui/adaptive/floating_tab_button.dart | 22 +---- app/lib/ui/adaptive/glass_bar.dart | 31 ++----- app/lib/ui/adaptive/glass_pill.dart | 9 +- app/lib/ui/adaptive/host.dart | 10 -- app/lib/ui/adaptive/platform.dart | 9 -- app/lib/ui/adaptive/segmented_bar.dart | 73 +++------------ app/lib/ui/adaptive/segmented_bar_motion.dart | 4 +- .../ui/adaptive/segmented_bar_overflow.dart | 12 +-- app/lib/ui/adaptive/segmented_bar_pieces.dart | 43 ++------- app/lib/ui/adaptive/top_glass_strip.dart | 3 - app/lib/ui/input/app_search_field.dart | 2 - app/lib/ui/layout/app_list_row.dart | 25 ++--- app/lib/ui/layout/app_sheet_header.dart | 4 - app/lib/ui/layout/facts_grid.dart | 4 - .../motion/container_transform_gestures.dart | 2 - .../ui/motion/container_transform_route.dart | 8 +- app/lib/ui/navigation/bar_icon_button.dart | 8 -- app/lib/ui/navigation/chevron_pager.dart | 4 +- app/lib/ui/theme/app_theme.dart | 63 +------------ app/notes/material-final-api-cleanup.md | 85 +++++++++++++++++ app/pubspec.lock | 8 -- app/pubspec.yaml | 3 - .../app_lifecycle_reconnect_test.dart | 2 +- app/test/application/app_router_test.dart | 2 - .../application/chat_registration_test.dart | 23 +++-- .../application/chat_scroll_back_test.dart | 1 - app/test/application/chat_wide_back_test.dart | 1 - .../list_detail_consistency_test.dart | 2 +- .../pipeline_stage_deep_link_test.dart | 2 +- app/test/application/pipelines_app_test.dart | 1 - .../pipelines_registration_test.dart | 6 +- .../application/run_start_wiring_test.dart | 2 +- app/test/application/search_wiring_test.dart | 1 - app/test/application/settings_page_test.dart | 6 +- .../settings_registration_test.dart | 2 +- .../startup_update_check_test.dart | 92 ++++++++++--------- .../application/startup_update_flow_test.dart | 3 - .../tab_location_navigation_test.dart | 8 +- .../templates_behind_bar_test.dart | 8 +- .../application/templates_wiring_test.dart | 11 +-- .../ui/notification_permission_tile_test.dart | 5 +- .../chat/chat_composer_entrance_test.dart | 1 - .../chat/chat_list_shortcuts_test.dart | 1 - .../chat/chat_open_transition_test.dart | 1 - .../features/chat/chat_screen_mode_test.dart | 4 +- .../chat/chat_split_integration_test.dart | 1 - .../chat_workspace_insets_color_test.dart | 1 - .../ui/sessions/chat_ios_material_test.dart | 12 ++- .../chat/ui/sessions/chat_test_harness.dart | 3 +- .../chat_paragraph_spacing_test.dart | 2 +- .../pipelines/pipeline_summary_flat_test.dart | 1 - .../pipelines/pipeline_tabs_test.dart | 14 ++- .../runs/ui/run_detail_tabs_test.dart | 5 +- .../runs/ui/run_live_duration_test.dart | 7 +- .../runs/ui/run_timeline_row_test.dart | 6 +- .../ui/list/schedules_behind_bar_test.dart | 8 +- .../ui/run/schedule_run_action_test.dart | 7 +- .../search/search_bar_layout_test.dart | 12 +-- .../search/search_chat_screen_test.dart | 12 +-- .../features/search/search_screen_test.dart | 14 +-- .../ui/template_create_test_support.dart | 10 +- .../ui/template_gallery_test_support.dart | 1 - .../updates/native_update_dialog_test.dart | 5 +- app/test/native_back.dart | 6 +- app/test/shell/floating_tab_bar_test.dart | 2 +- app/test/shell/pane_bar_row_test.dart | 1 - .../shell/shell_destination_menu_test.dart | 1 - .../shell/split_destination_bar_test.dart | 1 - app/test/shell/split_status_bar_test.dart | 2 - app/test/shell/tab_history_back_test.dart | 1 - app/test/shell/window_margins_shell_test.dart | 1 - .../adaptive/floating_bar_geometry_test.dart | 60 +++--------- .../ui/adaptive/floating_bar_layout_test.dart | 1 - .../floating_destination_labels_test.dart | 1 - .../ui/adaptive/floating_tab_motion_test.dart | 27 ++---- .../adaptive/glass_backdrop_group_test.dart | 3 +- app/test/ui/adaptive/glass_bar_test.dart | 19 ++-- app/test/ui/adaptive/glass_surface_test.dart | 4 +- app/test/ui/adaptive/platform_test.dart | 7 -- .../adaptive/segmented_bar_entrance_test.dart | 46 +++------- .../adaptive/segmented_bar_motion_test.dart | 22 ++--- .../adaptive/segmented_bar_overflow_test.dart | 55 ++++------- app/test/ui/adaptive/segmented_bar_test.dart | 11 +-- .../segmented_bar_title_widget_test.dart | 4 +- .../ui/adaptive/top_bar_clearance_test.dart | 17 +--- .../ui/adaptive/window_controls_test.dart | 2 +- app/test/ui/layout/app_list_row_test.dart | 2 +- .../container_transform_route_test.dart | 2 - .../ui/navigation/bar_icon_button_test.dart | 2 - app/test/ui/theme/app_theme_test.dart | 13 ++- app/tool/app_host_probe_entry.dart | 5 +- app/tool/template_create_probe.dart | 1 - app/tool/templates_wiring_probe_entry.dart | 5 +- 222 files changed, 540 insertions(+), 1351 deletions(-) delete mode 100644 app/lib/ui/adaptive/host.dart create mode 100644 app/notes/material-final-api-cleanup.md diff --git a/app/lib/application/app.dart b/app/lib/application/app.dart index 38a0d568..cf1abe66 100644 --- a/app/lib/application/app.dart +++ b/app/lib/application/app.dart @@ -14,7 +14,6 @@ class MyApp extends StatelessWidget { const MyApp({ super.key, this.destinationBodies = const {}, - this.cupertino, this.destination, this.onDestinationSelected, this.fonts, @@ -26,7 +25,6 @@ class MyApp extends StatelessWidget { const MyApp.router({ super.key, required RouterConfig this.routerConfig, - this.cupertino, this.fonts, }) : destinationBodies = const {}, destination = null, @@ -34,9 +32,6 @@ class MyApp extends StatelessWidget { final Map destinationBodies; - /// Retained for source compatibility with older callers; Material is the - /// only application host. - final bool? cupertino; final AppDestination? destination; final ValueChanged? onDestinationSelected; final RouterConfig? routerConfig; diff --git a/app/lib/application/app_router.dart b/app/lib/application/app_router.dart index e9c2390f..7b7e6bc6 100644 --- a/app/lib/application/app_router.dart +++ b/app/lib/application/app_router.dart @@ -46,7 +46,6 @@ String routeLocation(Uri uri) { class AppRouterDelegate extends RouterDelegate with ChangeNotifier { AppRouterDelegate({ required this.builder, - this.cupertino, this.searchBuilder, this.templatesBuilder, this.schedulesBuilder, @@ -74,10 +73,6 @@ class AppRouterDelegate extends RouterDelegate with ChangeNotifier { /// state and selection, and the standard navigation bar supplies Back. final Widget Function(BuildContext context)? searchBuilder; - /// Retained for compatibility with older composition callers. Routes use - /// Material pages on every platform. - final bool? cupertino; - final _navigatorKey = GlobalKey(); static const _pageKey = ValueKey('pipelines-shell'); static const _searchPageKey = ValueKey('app-search'); diff --git a/app/lib/application/app_terminals.dart b/app/lib/application/app_terminals.dart index 475ccf6d..334ec583 100644 --- a/app/lib/application/app_terminals.dart +++ b/app/lib/application/app_terminals.dart @@ -53,24 +53,18 @@ class AppTerminals { /// app's floating [windows] above both. /// [onChat]: the phone shortcut that reopens the terminal shows on the /// Chat tab only. - Widget surround( - Widget shell, { - required bool cupertino, - bool onChat = true, - Widget? windows, - }) => TerminalSurface( - hub: hub, - layout: layout, - cupertino: cupertino, - shortcutHere: onChat, - windows: windows, - floating: floating, - child: shell, - ); + Widget surround(Widget shell, {bool onChat = true, Widget? windows}) => + TerminalSurface( + hub: hub, + layout: layout, + shortcutHere: onChat, + windows: windows, + floating: floating, + child: shell, + ); /// The bar button showing or hiding the terminal. - Widget toggle({required bool cupertino}) => - TerminalToggleButton(layout: layout, cupertino: cupertino); + Widget toggle() => TerminalToggleButton(layout: layout); void dispose() { floating?.dispose(); diff --git a/app/lib/application/connection_status.dart b/app/lib/application/connection_status.dart index d59fef81..75e639b4 100644 --- a/app/lib/application/connection_status.dart +++ b/app/lib/application/connection_status.dart @@ -14,12 +14,10 @@ class ConnectionGate extends StatelessWidget { super.key, required this.session, required this.server, - this.cupertino, }); final AppSession session; final ServerEndpoint server; - final bool? cupertino; @override Widget build(BuildContext context) { @@ -105,10 +103,9 @@ class ConnectionGate extends StatelessWidget { /// A compact status bar above retained content after the first connection. class ConnectionBanner extends StatelessWidget { - const ConnectionBanner({super.key, required this.session, this.cupertino}); + const ConnectionBanner({super.key, required this.session}); final AppSession session; - final bool? cupertino; @override Widget build(BuildContext context) { diff --git a/app/lib/application/pipelines_app.dart b/app/lib/application/pipelines_app.dart index 2c83a57b..afc06bfd 100644 --- a/app/lib/application/pipelines_app.dart +++ b/app/lib/application/pipelines_app.dart @@ -75,7 +75,6 @@ class PipelinesApp extends StatefulWidget { super.key, required this.server, this.client, - this.cupertino, this.routeInformationProvider, this.knownServer = false, this.serverAddresses, @@ -108,7 +107,6 @@ class PipelinesApp extends StatefulWidget { final WindowManager? windows; final ServerEndpoint server; final PipelinesClient? client; - final bool? cupertino; /// Test seam: the Router's initial and subsequent route information. final RouteInformationProvider? routeInformationProvider; @@ -145,7 +143,6 @@ class _PipelinesAppState extends State late final RouteInformationProvider _provider; late final bool _ownsProvider; late final RouterConfig _config; - late final bool _cupertino; /// Advances when a template create is accepted. The Pipelines destination /// uses it to re-read through its mounted controller; no row is inserted @@ -337,8 +334,6 @@ class _PipelinesAppState extends State type: RouteInformationReportingType.neglect, ); } - // Kept as a compatibility field on the widget; composition is Material-only. - _cupertino = false; _notifications.onOpenRun = (id) { if (mounted) _delegate.goTo(AppRoute.run(id)); }; @@ -355,7 +350,6 @@ class _PipelinesAppState extends State MachineElevation.defaultPrompt = _elevationPrompt; _delegate = AppRouterDelegate( initial: initial, - cupertino: _cupertino, templatesBuilder: _buildTemplates, schedulesBuilder: _buildSchedules, builder: _buildShell, @@ -445,7 +439,6 @@ class _PipelinesAppState extends State nativePlatform: update is AndroidLaunchUpdate ? update.update.platform : '', - cupertino: _cupertino, ); if (accepted != true || !mounted || !dialogContext.mounted) return; if (!widget.webPlatform && endpoint != _session.endpoint) return; @@ -457,16 +450,11 @@ class _PipelinesAppState extends State dialogContext, (update as AndroidLaunchUpdate).update, installer: widget.androidInstaller, - cupertino: _cupertino, ); } } catch (error) { if (mounted && dialogContext.mounted) { - await showLaunchUpdateFailure( - dialogContext, - error, - cupertino: _cupertino, - ); + await showLaunchUpdateFailure(dialogContext, error); } } } catch (_) { @@ -584,11 +572,11 @@ class _PipelinesAppState extends State @override Widget build(BuildContext context) => widget.servers == null - ? MyApp.router(cupertino: _cupertino, routerConfig: _config) + ? MyApp.router(routerConfig: _config) : ServerContext( connections: widget.servers!, serverId: widget.serverId, - child: MyApp.router(cupertino: _cupertino, routerConfig: _config), + child: MyApp.router(routerConfig: _config), ); /// Open a result through the exact identity the hit records. An unresolvable @@ -796,7 +784,6 @@ class _PipelinesAppState extends State valueListenable: _attentionCount, builder: (context, count, _) => _terminals.surround( _shellFor(route, count), - cupertino: _cupertino, onChat: route.kind == AppRouteKind.chat, windows: WindowHost(manager: _windows), ), @@ -823,10 +810,9 @@ class _PipelinesAppState extends State // Shown on every tab while the app has floating windows. WindowsMenuButton(manager: _windows), if (_destinationOf(route.kind) == AppDestination.chat) - _terminals.toggle(cupertino: _cupertino), + _terminals.toggle(), ], attentionCount: attentionCount, - cupertino: _cupertino, destination: _destinationOf(route.kind), onDestinationSelected: _selectDestination, onClosePage: () => _delegate.goTo( diff --git a/app/lib/application/schedules_destination.dart b/app/lib/application/schedules_destination.dart index 0140046b..5b5c6186 100644 --- a/app/lib/application/schedules_destination.dart +++ b/app/lib/application/schedules_destination.dart @@ -105,10 +105,8 @@ class _SchedulesDestinationState extends State { final body = _body(); // The round Back closes the page; Refresh sits in the actions pill. final bar = SegmentedBar( - cupertino: false, leading: SegmentedBackButton( key: schedulesPageBackKey, - cupertino: false, onPressed: widget.onBack, ), title: 'Schedules', @@ -116,7 +114,6 @@ class _SchedulesDestinationState extends State { if (widget.session.everConnected) ScheduleRefreshAction( controller: _controller, - cupertino: false, onRefresh: () => unawaited(_controller.refresh()), ), ], @@ -136,7 +133,6 @@ class _SchedulesDestinationState extends State { controller: _controller, searchController: _search, scrollController: _scroll, - cupertino: false, onOpen: (schedule) { final id = schedule.pipelineId; if (id != null) widget.onOpenPipeline(id); diff --git a/app/lib/application/search_destination.dart b/app/lib/application/search_destination.dart index f8e1691b..d908aa8e 100644 --- a/app/lib/application/search_destination.dart +++ b/app/lib/application/search_destination.dart @@ -64,7 +64,7 @@ class _SearchPage extends StatelessWidget { @override Widget build(BuildContext context) => Scaffold( extendBodyBehindAppBar: true, - appBar: const SegmentedBar(cupertino: false, title: 'Search'), + appBar: const SegmentedBar(title: 'Search'), body: SafeArea(child: child), ); } diff --git a/app/lib/application/templates_destination.dart b/app/lib/application/templates_destination.dart index abc59306..8be0a3ff 100644 --- a/app/lib/application/templates_destination.dart +++ b/app/lib/application/templates_destination.dart @@ -89,16 +89,13 @@ class _TemplatesDestinationState extends State { final spec = _bar.specFor(AppDestination.settings); final onDetailBack = spec?.onBack; return SegmentedBar( - cupertino: false, leading: onDetailBack != null ? SegmentedBackButton( key: templateDetailBackKey, - cupertino: false, onPressed: onDetailBack, ) : SegmentedBackButton( key: templatesPageBackKey, - cupertino: false, onPressed: widget.onBack, ), title: spec?.title ?? 'Templates', @@ -111,19 +108,12 @@ class _TemplatesDestinationState extends State { final session = widget.session; if (!session.everConnected) { return BelowTopBar( - child: ConnectionGate( - session: session, - server: widget.server, - cupertino: false, - ), + child: ConnectionGate(session: session, server: widget.server), ); } // A connection banner stays below the bar; the gallery keeps its place. return TopBarNotices( - notices: [ - if (!session.connected) - ConnectionBanner(session: session, cupertino: false), - ], + notices: [if (!session.connected) ConnectionBanner(session: session)], child: TemplatesScreen( gateway: session.gateway, embedded: true, @@ -142,8 +132,7 @@ class _BarSlot extends StatelessWidget implements PreferredSizeWidget { final Widget child; @override - Size get preferredSize => - const SegmentedBar(cupertino: false, title: '').preferredSize; + Size get preferredSize => const SegmentedBar(title: '').preferredSize; @override Widget build(BuildContext context) => child; diff --git a/app/lib/features/artifacts/actions/artifact_file_actions.dart b/app/lib/features/artifacts/actions/artifact_file_actions.dart index c2363367..7dd5a3a6 100644 --- a/app/lib/features/artifacts/actions/artifact_file_actions.dart +++ b/app/lib/features/artifacts/actions/artifact_file_actions.dart @@ -243,7 +243,7 @@ class ArtifactIconAction extends StatelessWidget { height: 18, child: CircularProgressIndicator(strokeWidth: 2), ) - : Icon(icon, size: GlassBarMetrics.iconSize(false)), + : Icon(icon, size: GlassBarMetrics.iconSize()), ); } } diff --git a/app/lib/features/artifacts/ui/artifact_fullscreen.dart b/app/lib/features/artifacts/ui/artifact_fullscreen.dart index 3362c4a4..405baa9c 100644 --- a/app/lib/features/artifacts/ui/artifact_fullscreen.dart +++ b/app/lib/features/artifacts/ui/artifact_fullscreen.dart @@ -30,12 +30,9 @@ class ArtifactFullscreenScope extends InheritedWidget { /// the shell's bars and list pane. A full-screen dialog route: its bar shows /// the platform's Close, and the system back gesture leaves it. /// -/// [cupertino] is retained for callers that still pass it; the route is always -/// the Material one. -Route artifactFullscreenRoute({ - bool? cupertino, - required WidgetBuilder builder, -}) => MaterialPageRoute(fullscreenDialog: true, builder: builder); +/// Uses the native Material fullscreen route. +Route artifactFullscreenRoute({required WidgetBuilder builder}) => + MaterialPageRoute(fullscreenDialog: true, builder: builder); /// The zoom factors Zoom in and Zoom out step through. const List artifactHtmlZoomSteps = [ diff --git a/app/lib/features/artifacts/ui/artifact_fullscreen_host.dart b/app/lib/features/artifacts/ui/artifact_fullscreen_host.dart index 48aea5d9..fbb1b2e0 100644 --- a/app/lib/features/artifacts/ui/artifact_fullscreen_host.dart +++ b/app/lib/features/artifacts/ui/artifact_fullscreen_host.dart @@ -41,7 +41,6 @@ mixin ArtifactFullscreenHost on State { if (_fullscreen != null) return; htmlZoom.value = 1; final route = artifactFullscreenRoute( - cupertino: false, builder: (_) => ArtifactFullscreenScope( htmlZoom: htmlZoom, child: ListenableBuilder( diff --git a/app/lib/features/artifacts/ui/artifact_gallery_page.dart b/app/lib/features/artifacts/ui/artifact_gallery_page.dart index adb1dd8c..3f55d203 100644 --- a/app/lib/features/artifacts/ui/artifact_gallery_page.dart +++ b/app/lib/features/artifacts/ui/artifact_gallery_page.dart @@ -562,7 +562,6 @@ class _ArtifactGalleryPageState extends State { return Scaffold( extendBodyBehindAppBar: true, appBar: SegmentedBar( - cupertino: false, title: artifactGalleryTitle, actions: [_debugToggle(context)], ), diff --git a/app/lib/features/artifacts/ui/artifact_tile.dart b/app/lib/features/artifacts/ui/artifact_tile.dart index b0f06421..f4b26f70 100644 --- a/app/lib/features/artifacts/ui/artifact_tile.dart +++ b/app/lib/features/artifacts/ui/artifact_tile.dart @@ -152,7 +152,7 @@ class _ArtifactThumbnailState extends State Widget build(BuildContext context) { super.build(context); final icon = Icon( - artifactKindIcon(widget.artifact, cupertino: false), + artifactKindIcon(widget.artifact), size: widget.iconSize, color: Theme.of(context).colorScheme.onSurfaceVariant, ); @@ -191,9 +191,8 @@ class _ArtifactThumbnailState extends State /// The icon for an artifact's kind of file, when it has no thumbnail. /// -/// [cupertino] is retained for callers that still pass it; the icon is always -/// the Material glyph the app draws. -IconData artifactKindIcon(ArtifactRecord artifact, {required bool cupertino}) { +/// The Material glyph the app draws for this file kind. +IconData artifactKindIcon(ArtifactRecord artifact) { final name = artifact.name.toLowerCase(); final format = artifactPreviewFormat(artifact.contentType, artifact.name); if (name.endsWith('.zip') || name.endsWith('.tar') || name.endsWith('.gz')) { diff --git a/app/lib/features/artifacts/ui/artifact_viewer_bar.dart b/app/lib/features/artifacts/ui/artifact_viewer_bar.dart index c212199c..3545e9bd 100644 --- a/app/lib/features/artifacts/ui/artifact_viewer_bar.dart +++ b/app/lib/features/artifacts/ui/artifact_viewer_bar.dart @@ -59,7 +59,7 @@ class ArtifactViewerBar extends StatelessWidget { @override Widget build(BuildContext context) { final actions = _actions(resolved, onFullscreen); - final pagerMin = count > 1 ? 2 * GlassBarMetrics.controlExtent(false) : 0.0; + final pagerMin = count > 1 ? 2 * GlassBarMetrics.controlExtent() : 0.0; final pager = ChevronPager( index: index, count: count, @@ -82,7 +82,6 @@ class ArtifactViewerBar extends StatelessWidget { alignment: AlignmentDirectional.centerStart, heightFactor: 1, child: GlassControlBar( - cupertino: false, child: LayoutBuilder( builder: (context, constraints) => Row( key: const Key('artifact-viewer-actions'), diff --git a/app/lib/features/artifacts/ui/artifact_viewer_scaffold.dart b/app/lib/features/artifacts/ui/artifact_viewer_scaffold.dart index d26b47d0..42f7d062 100644 --- a/app/lib/features/artifacts/ui/artifact_viewer_scaffold.dart +++ b/app/lib/features/artifacts/ui/artifact_viewer_scaffold.dart @@ -21,7 +21,6 @@ class ArtifactViewerScaffold extends StatelessWidget { @override Widget build(BuildContext context) { final bar = SegmentedBar( - cupertino: false, title: title, subtitle: subtitle, actions: actions, diff --git a/app/lib/features/attention/ui/notification_permission_tile.dart b/app/lib/features/attention/ui/notification_permission_tile.dart index 32762e46..c9a6d4fb 100644 --- a/app/lib/features/attention/ui/notification_permission_tile.dart +++ b/app/lib/features/attention/ui/notification_permission_tile.dart @@ -30,7 +30,6 @@ class NotificationPermissionTile extends StatelessWidget { required this.state, this.asked = false, this.onRequest, - this.cupertino, }); final NotificationPermissionState state; @@ -42,10 +41,6 @@ class NotificationPermissionTile extends StatelessWidget { /// request would be possible. final VoidCallback? onRequest; - /// Retained for callers that still pass it; the tile is the Material row - /// whether this is set or not. - final bool? cupertino; - @override Widget build(BuildContext context) { final view = notificationPermissionView(state, asked: asked); diff --git a/app/lib/features/changes/widgets/changes_viewer.dart b/app/lib/features/changes/widgets/changes_viewer.dart index 02caca8e..6247e356 100644 --- a/app/lib/features/changes/widgets/changes_viewer.dart +++ b/app/lib/features/changes/widgets/changes_viewer.dart @@ -245,9 +245,7 @@ class _ChangesViewerState extends State { ), child: Padding( padding: const EdgeInsets.all(8), - child: IntrinsicWidth( - child: GlassControlBar(cupertino: false, child: pager), - ), + child: IntrinsicWidth(child: GlassControlBar(child: pager)), ), ), ), diff --git a/app/lib/features/changes/widgets/file_diff_viewer.dart b/app/lib/features/changes/widgets/file_diff_viewer.dart index 5e2fde3d..2d8310b8 100644 --- a/app/lib/features/changes/widgets/file_diff_viewer.dart +++ b/app/lib/features/changes/widgets/file_diff_viewer.dart @@ -311,7 +311,7 @@ class _FileDiffPageState extends State { child: SafeArea( top: false, minimum: const EdgeInsets.all(8), - child: GlassControlBar(cupertino: false, child: pager), + child: GlassControlBar(child: pager), ), ), child: viewer, @@ -319,7 +319,7 @@ class _FileDiffPageState extends State { ); return Scaffold( extendBodyBehindAppBar: true, - appBar: SegmentedBar(cupertino: false, title: name), + appBar: SegmentedBar(title: name), body: body, ); } diff --git a/app/lib/features/chat/chat_screen_workspace.dart b/app/lib/features/chat/chat_screen_workspace.dart index 479db5af..5f0d6cc2 100644 --- a/app/lib/features/chat/chat_screen_workspace.dart +++ b/app/lib/features/chat/chat_screen_workspace.dart @@ -39,7 +39,6 @@ mixin _ChatScreenWorkspace on State { ChatCompactSidebar( navigation: navigation?.registry.canNavigate == true ? ShellDestinationMenu( - cupertino: false, current: AppDestination.chat, onSelected: navigation!.registry.navigateTo, ) diff --git a/app/lib/features/chat/conversation/chat_account_usage_section.dart b/app/lib/features/chat/conversation/chat_account_usage_section.dart index 9b36c5c3..86bac78b 100644 --- a/app/lib/features/chat/conversation/chat_account_usage_section.dart +++ b/app/lib/features/chat/conversation/chat_account_usage_section.dart @@ -12,12 +12,10 @@ class ChatAccountUsageSection extends StatefulWidget { const ChatAccountUsageSection({ super.key, required this.usage, - required this.cupertino, this.now = DateTime.now, }); final ChatAccountUsage? usage; - final bool cupertino; final DateTime Function() now; @override diff --git a/app/lib/features/chat/conversation/chat_bar_tint.dart b/app/lib/features/chat/conversation/chat_bar_tint.dart index 4e2ea740..2fad08c4 100644 --- a/app/lib/features/chat/conversation/chat_bar_tint.dart +++ b/app/lib/features/chat/conversation/chat_bar_tint.dart @@ -120,17 +120,13 @@ class ChatPaneActivity extends InheritedWidget { /// through the ambient icon colour, and the chat's own bar controls through /// [foregroundOf]. class ChatBarTintScope extends InheritedWidget { - ChatBarTintScope({ - super.key, - required this.tint, - required bool cupertino, - required Widget child, - }) : super( - child: IconTheme.merge( - data: IconThemeData(color: tint.foreground), - child: child, - ), - ); + ChatBarTintScope({super.key, required this.tint, required Widget child}) + : super( + child: IconTheme.merge( + data: IconThemeData(color: tint.foreground), + child: child, + ), + ); final ChatBarTint tint; diff --git a/app/lib/features/chat/conversation/chat_card_styles.dart b/app/lib/features/chat/conversation/chat_card_styles.dart index 033ac891..d42375c4 100644 --- a/app/lib/features/chat/conversation/chat_card_styles.dart +++ b/app/lib/features/chat/conversation/chat_card_styles.dart @@ -8,38 +8,37 @@ import 'package:flutter/material.dart'; /// size and colour; everything still comes from the active Material theme, so /// light, dark and text scaling follow the host. /// -/// The `cupertino` parameters are kept for existing callers; the app is -/// Material-only, so every helper returns its Material value. -TextStyle? chatCardTitleStyle(BuildContext context, bool cupertino) => +/// All helpers use the shared Material theme roles. +TextStyle? chatCardTitleStyle(BuildContext context) => Theme.of(context).textTheme.titleMedium; -TextStyle? chatCardBodyStyle(BuildContext context, bool cupertino) => +TextStyle? chatCardBodyStyle(BuildContext context) => Theme.of(context).textTheme.bodyMedium; /// A field or recorded-answer label: `titleSmall`, so labels sit visibly /// below the card title without reading as extra headings. -TextStyle? chatCardLabelStyle(BuildContext context, bool cupertino) => +TextStyle? chatCardLabelStyle(BuildContext context) => Theme.of(context).textTheme.titleSmall; /// Body text that supports a control, such as a field description. -TextStyle? chatCardSecondaryStyle(BuildContext context, bool cupertino) => - (chatCardBodyStyle(context, cupertino) ?? const TextStyle()).copyWith( - color: chatCardSecondaryColor(context, cupertino), +TextStyle? chatCardSecondaryStyle(BuildContext context) => + (chatCardBodyStyle(context) ?? const TextStyle()).copyWith( + color: chatCardSecondaryColor(context), ); -Color chatCardSecondaryColor(BuildContext context, bool cupertino) => +Color chatCardSecondaryColor(BuildContext context) => Theme.of(context).colorScheme.onSurfaceVariant; -Color chatCardErrorColor(BuildContext context, bool cupertino) => +Color chatCardErrorColor(BuildContext context) => Theme.of(context).colorScheme.error; /// The amber risk hue: the host's warning role, never a bespoke palette. -Color chatCardWarningColor(BuildContext context, bool cupertino) => +Color chatCardWarningColor(BuildContext context) => Theme.of(context).colorScheme.tertiary; /// A quiet inset surface for resource blocks and risk panels. -Color chatCardFillColor(BuildContext context, bool cupertino) => +Color chatCardFillColor(BuildContext context) => Theme.of(context).colorScheme.surfaceContainerHighest; -Color chatCardWarningFillColor(BuildContext context, bool cupertino) => +Color chatCardWarningFillColor(BuildContext context) => Theme.of(context).colorScheme.tertiaryContainer; diff --git a/app/lib/features/chat/conversation/chat_composer_bar.dart b/app/lib/features/chat/conversation/chat_composer_bar.dart index e755844b..20510b4e 100644 --- a/app/lib/features/chat/conversation/chat_composer_bar.dart +++ b/app/lib/features/chat/conversation/chat_composer_bar.dart @@ -979,7 +979,6 @@ class _ChatComposerBarState extends State { shape: _pillShape, child: GlassPill( key: const Key('chat-composer-pill'), - cupertino: false, shape: _pillShape, // The end controls keep the same gap from the pill's sides as from // its bottom (and its top while the field is one line). diff --git a/app/lib/features/chat/conversation/chat_delivery_indicator.dart b/app/lib/features/chat/conversation/chat_delivery_indicator.dart index fb6facd5..7caef61e 100644 --- a/app/lib/features/chat/conversation/chat_delivery_indicator.dart +++ b/app/lib/features/chat/conversation/chat_delivery_indicator.dart @@ -20,7 +20,6 @@ class ChatDeliveryIndicator extends StatelessWidget { const ChatDeliveryIndicator({ super.key, required this.state, - required this.cupertino, this.onRetry, this.onEdit, this.editLabel = 'Edit', @@ -28,7 +27,6 @@ class ChatDeliveryIndicator extends StatelessWidget { }); final ChatDelivery state; - final bool cupertino; final VoidCallback? onRetry; final VoidCallback? onEdit; final String editLabel; diff --git a/app/lib/features/chat/conversation/chat_permission_card.dart b/app/lib/features/chat/conversation/chat_permission_card.dart index 25ddb86c..e853e85a 100644 --- a/app/lib/features/chat/conversation/chat_permission_card.dart +++ b/app/lib/features/chat/conversation/chat_permission_card.dart @@ -22,8 +22,7 @@ class ChatPermissionCard extends StatelessWidget { final Future Function(String decision) onDecision; final String? error; - /// The card-style helpers keep their `cupertino` flag for existing callers; - /// the card is always Material, so every call passes `false`. + /// The card uses the shared Material card styles. @override Widget build(BuildContext context) => Card( // Consecutive cards must read as separate surfaces; the row itself adds only @@ -43,18 +42,15 @@ class ChatPermissionCard extends StatelessWidget { padding: const EdgeInsetsDirectional.only(end: 12), child: Icon( Icons.shield_outlined, - color: chatCardWarningColor(context, false), + color: chatCardWarningColor(context), ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(card.headline, style: chatCardTitleStyle(context, false)), - Text( - card.statusLine, - style: chatCardSecondaryStyle(context, false), - ), + Text(card.headline, style: chatCardTitleStyle(context)), + Text(card.statusLine, style: chatCardSecondaryStyle(context)), ], ), ), @@ -64,7 +60,7 @@ class ChatPermissionCard extends StatelessWidget { const SizedBox(height: 12), DecoratedBox( decoration: BoxDecoration( - color: chatCardFillColor(context, false), + color: chatCardFillColor(context), borderRadius: BorderRadius.circular(8), ), child: Padding( @@ -95,8 +91,7 @@ class ChatPermissionCard extends StatelessWidget { error!, style: chatCardBodyStyle( context, - false, - )?.copyWith(color: chatCardErrorColor(context, false)), + )?.copyWith(color: chatCardErrorColor(context)), ), ), ], @@ -105,10 +100,10 @@ class ChatPermissionCard extends StatelessWidget { ); Widget _risk(BuildContext context) { - final tint = chatCardWarningColor(context, false); + final tint = chatCardWarningColor(context); return DecoratedBox( decoration: BoxDecoration( - color: chatCardWarningFillColor(context, false), + color: chatCardWarningFillColor(context), borderRadius: BorderRadius.circular(8), ), child: Padding( @@ -123,16 +118,13 @@ class ChatPermissionCard extends StatelessWidget { Expanded( child: Text( chatRiskReviewLabel, - style: chatCardLabelStyle( - context, - false, - )?.copyWith(color: tint), + style: chatCardLabelStyle(context)?.copyWith(color: tint), ), ), ], ), const SizedBox(height: 4), - Text(card.risk, style: chatCardBodyStyle(context, false)), + Text(card.risk, style: chatCardBodyStyle(context)), ], ), ), diff --git a/app/lib/features/chat/conversation/chat_question_card.dart b/app/lib/features/chat/conversation/chat_question_card.dart index 79c0cb60..475b252f 100644 --- a/app/lib/features/chat/conversation/chat_question_card.dart +++ b/app/lib/features/chat/conversation/chat_question_card.dart @@ -142,9 +142,9 @@ class _ChatQuestionCardState extends State { '${widget.form['title'] ?? ''}'.trim().isEmpty ? 'Question' : '${widget.form['title']}'.trim(), - style: chatCardTitleStyle(context, false), + style: chatCardTitleStyle(context), ), - Text(_statusLine(), style: chatCardSecondaryStyle(context, false)), + Text(_statusLine(), style: chatCardSecondaryStyle(context)), if (error.isNotEmpty) Padding( padding: const EdgeInsets.only(top: 8), @@ -154,8 +154,7 @@ class _ChatQuestionCardState extends State { error, style: chatCardBodyStyle( context, - false, - )?.copyWith(color: chatCardErrorColor(context, false)), + )?.copyWith(color: chatCardErrorColor(context)), ), ), ), @@ -164,21 +163,15 @@ class _ChatQuestionCardState extends State { context: context, fields: _fields, answers: _answers, - cupertino: false, controllers: _controllers, onChanged: _changed, ) else - ...chatQuestionRecordedAnswers( - context: context, - form: widget.form, - cupertino: false, - ), + ...chatQuestionRecordedAnswers(context: context, form: widget.form), if (_pending) ...[ const SizedBox(height: 12), chatQuestionControls( context: context, - cupertino: false, actions: actions, submitLabel: _submitLabel, sending: _sending, diff --git a/app/lib/features/chat/conversation/chat_question_card_controls.dart b/app/lib/features/chat/conversation/chat_question_card_controls.dart index 67e3e1fd..3a175d87 100644 --- a/app/lib/features/chat/conversation/chat_question_card_controls.dart +++ b/app/lib/features/chat/conversation/chat_question_card_controls.dart @@ -4,11 +4,9 @@ import 'package:flutter/material.dart'; /// /// The web shows `Confirm completion` when every field is external, otherwise /// `Send answer`, and offers only the actions the form records. The labels are -/// passed in so this file stays layout only. `cupertino` is kept for existing -/// callers; the controls are always Material. +/// passed in so this file stays layout only. Controls use Material widgets. Widget chatQuestionControls({ required BuildContext context, - required bool cupertino, required Object? actions, required String submitLabel, required bool sending, diff --git a/app/lib/features/chat/conversation/chat_question_card_fields.dart b/app/lib/features/chat/conversation/chat_question_card_fields.dart index 1d37ad0a..9201c367 100644 --- a/app/lib/features/chat/conversation/chat_question_card_fields.dart +++ b/app/lib/features/chat/conversation/chat_question_card_fields.dart @@ -16,7 +16,6 @@ List chatQuestionFieldWidgets({ required BuildContext context, required List fields, required Map answers, - required bool cupertino, required Map controllers, required void Function(String key, Object? value) onChanged, }) { @@ -31,7 +30,6 @@ List chatQuestionFieldWidgets({ field: field, keyName: key, answers: answers, - cupertino: cupertino, controllers: controllers, onChanged: onChanged, ), @@ -45,7 +43,6 @@ Widget _field({ required JsonMap field, required String keyName, required Map answers, - required bool cupertino, required Map controllers, required void Function(String key, Object? value) onChanged, }) { @@ -60,18 +57,17 @@ Widget _field({ crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min, children: [ - Text(label, style: chatCardLabelStyle(context, cupertino)), + Text(label, style: chatCardLabelStyle(context)), if (description.isNotEmpty && description != title) - Text(description, style: chatCardSecondaryStyle(context, cupertino)), + Text(description, style: chatCardSecondaryStyle(context)), if ('${field['type'] ?? ''}' == 'external') - _external(context, field, cupertino) + _external(context, field) else if ('${field['type'] ?? ''}' == 'boolean') chatQuestionBooleanField( context: context, field: field, keyName: keyName, answers: answers, - cupertino: cupertino, onChanged: onChanged, ) else ...[ @@ -80,7 +76,6 @@ Widget _field({ field: field, keyName: keyName, answers: answers, - cupertino: cupertino, onChanged: onChanged, ), if (chatQuestionFieldNeedsInput(field)) @@ -139,15 +134,14 @@ Widget _input({ return Semantics(label: label, child: input); } -Widget _external(BuildContext context, JsonMap field, bool cupertino) { +Widget _external(BuildContext context, JsonMap field) { final raw = '${field['url'] ?? ''}'.trim(); if (!chatExternalUrlIsSafe(raw)) { return Text( 'This form has an unsupported external URL.', style: chatCardBodyStyle( context, - cupertino, - )?.copyWith(color: chatCardErrorColor(context, cupertino)), + )?.copyWith(color: chatCardErrorColor(context)), ); } return SelectableText(raw); diff --git a/app/lib/features/chat/conversation/chat_question_group.dart b/app/lib/features/chat/conversation/chat_question_group.dart index 880ddd0d..84f26682 100644 --- a/app/lib/features/chat/conversation/chat_question_group.dart +++ b/app/lib/features/chat/conversation/chat_question_group.dart @@ -178,17 +178,13 @@ class _QuestionSheet extends StatelessWidget { children: [ Text( title.isEmpty ? 'Question' : title, - style: chatCardTitleStyle(context, false), + style: chatCardTitleStyle(context), ), Text( chatQuestionSettledStatus(form), - style: chatCardSecondaryStyle(context, false), - ), - ...chatQuestionRecordedAnswers( - context: context, - form: form, - cupertino: false, + style: chatCardSecondaryStyle(context), ), + ...chatQuestionRecordedAnswers(context: context, form: form), ], ), ), diff --git a/app/lib/features/chat/conversation/chat_question_option_controls.dart b/app/lib/features/chat/conversation/chat_question_option_controls.dart index efc8ceb4..57afa880 100644 --- a/app/lib/features/chat/conversation/chat_question_option_controls.dart +++ b/app/lib/features/chat/conversation/chat_question_option_controls.dart @@ -11,7 +11,6 @@ Widget chatQuestionOptionsField({ required JsonMap field, required String keyName, required Map answers, - required bool cupertino, required void Function(String key, Object? value) onChanged, }) { final options = chatQuestionOptions(field); @@ -69,7 +68,6 @@ Widget chatQuestionBooleanField({ required JsonMap field, required String keyName, required Map answers, - required bool cupertino, required void Function(String key, Object? value) onChanged, }) { final value = answers[keyName]; diff --git a/app/lib/features/chat/conversation/chat_question_recorded_answers.dart b/app/lib/features/chat/conversation/chat_question_recorded_answers.dart index 5cea2d72..b531aacf 100644 --- a/app/lib/features/chat/conversation/chat_question_recorded_answers.dart +++ b/app/lib/features/chat/conversation/chat_question_recorded_answers.dart @@ -9,7 +9,6 @@ import 'chat_question_card_model.dart'; List chatQuestionRecordedAnswers({ required BuildContext context, required JsonMap form, - required bool cupertino, }) { final answers = form['answers'] is Map ? Map.from(form['answers'] as Map) @@ -25,27 +24,18 @@ List chatQuestionRecordedAnswers({ context, chatQuestionFieldLabel(field, key), chatQuestionAnswerText(field, answers[key]), - cupertino, ), ); } for (final entry in answers.entries) { if (shown.contains(entry.key)) continue; widgets.add( - _recorded( - context, - entry.key, - chatQuestionAnswerText(null, entry.value), - cupertino, - ), + _recorded(context, entry.key, chatQuestionAnswerText(null, entry.value)), ); } if (widgets.isEmpty) { return [ - Text( - 'No answer was recorded.', - style: chatCardSecondaryStyle(context, cupertino), - ), + Text('No answer was recorded.', style: chatCardSecondaryStyle(context)), ]; } return widgets; @@ -61,19 +51,14 @@ String chatQuestionFieldLabel(JsonMap field, String key) { return key; } -Widget _recorded( - BuildContext context, - String label, - String value, - bool cupertino, -) => Padding( +Widget _recorded(BuildContext context, String label, String value) => Padding( padding: const EdgeInsets.only(top: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - Text(label, style: chatCardLabelStyle(context, cupertino)), - Text(value, style: chatCardBodyStyle(context, cupertino)), + Text(label, style: chatCardLabelStyle(context)), + Text(value, style: chatCardBodyStyle(context)), ], ), ); diff --git a/app/lib/features/chat/conversation/chat_session_section.dart b/app/lib/features/chat/conversation/chat_session_section.dart index d0a5b3d0..86fe75a6 100644 --- a/app/lib/features/chat/conversation/chat_session_section.dart +++ b/app/lib/features/chat/conversation/chat_session_section.dart @@ -12,18 +12,16 @@ import 'chat_export_controller.dart'; /// copy control, the harness and the working directory, the verified terminal /// command that resumes the session, and the export actions. /// -/// `cupertino` is kept for existing callers; the section is always Material. +/// The section uses the shared Material surface. class ChatSessionSection extends StatefulWidget { const ChatSessionSection({ super.key, required this.handoff, required this.exporter, - required this.cupertino, }); final ChatSessionHandoff handoff; final ChatExportController exporter; - final bool cupertino; @override State createState() => _ChatSessionSectionState(); diff --git a/app/lib/features/chat/conversation/chat_thread_header.dart b/app/lib/features/chat/conversation/chat_thread_header.dart index 68956371..09711905 100644 --- a/app/lib/features/chat/conversation/chat_thread_header.dart +++ b/app/lib/features/chat/conversation/chat_thread_header.dart @@ -69,7 +69,6 @@ class ChatThreadHeader extends StatelessWidget { if (action is! SegmentedOverflowable) action, if (moreActions.whereType().isNotEmpty) SegmentedMoreButton( - cupertino: false, entries: [ for (final action in moreActions.whereType()) @@ -78,7 +77,6 @@ class ChatThreadHeader extends StatelessWidget { ), ]; final Widget bar = SegmentedBar( - cupertino: false, pillColor: tint?.fill, foregroundColor: tint?.foreground, automaticallyImplyLeading: false, @@ -87,7 +85,6 @@ class ChatThreadHeader extends StatelessWidget { leading: showBack ? SegmentedBackButton( key: const Key('chat-back'), - cupertino: false, onPressed: onBack, ) : null, @@ -131,7 +128,6 @@ class ChatThreadHeader extends StatelessWidget { : ChatBarTintScope( key: const Key('chat-bar-tint'), tint: tint, - cupertino: false, child: bar, ), ); diff --git a/app/lib/features/chat/conversation/chat_thread_view.dart b/app/lib/features/chat/conversation/chat_thread_view.dart index 05321f8f..2a904eb4 100644 --- a/app/lib/features/chat/conversation/chat_thread_view.dart +++ b/app/lib/features/chat/conversation/chat_thread_view.dart @@ -1608,11 +1608,7 @@ class _ChatThreadViewState extends State { footer: [ ...chips, if (delivery != null) - ChatDeliveryIndicator( - state: delivery, - cupertino: false, - onRemove: onRemove, - ), + ChatDeliveryIndicator(state: delivery, onRemove: onRemove), ], images: _images, ), @@ -1650,7 +1646,6 @@ class _ChatThreadViewState extends State { footer: [ ChatDeliveryIndicator( state: ChatDelivery.queued, - cupertino: false, onRemove: _removeAction('${prompt['operation_id'] ?? ''}'), ), ], @@ -1672,7 +1667,6 @@ class _ChatThreadViewState extends State { footer: [ ChatDeliveryIndicator( state: ChatDelivery.failed, - cupertino: false, onRetry: send.canRetry && !composer.sending ? () => unawaited(composer.retry(send.operationId)) : null, @@ -1902,17 +1896,13 @@ class _ChatInfoSheet extends StatelessWidget { children: [ AppSheetHeader( title: 'Chat information', - cupertino: false, doneKey: const Key('chat-info-close'), ), if (onColorSelected case final onSelected?) ChatColorSection(selected: color, onSelected: onSelected), for (final metric in _chatInfoMetrics(controller.usage)) _ChatInfoRow(metric: metric), - ChatAccountUsageSection( - usage: controller.accountUsage, - cupertino: false, - ), + ChatAccountUsageSection(usage: controller.accountUsage), Padding( padding: const EdgeInsetsDirectional.fromSTEB(24, 8, 24, 16), child: Text( @@ -1923,11 +1913,7 @@ class _ChatInfoSheet extends StatelessWidget { ), ), ), - ChatSessionSection( - handoff: handoff, - exporter: exporter, - cupertino: false, - ), + ChatSessionSection(handoff: handoff, exporter: exporter), const SizedBox(height: 12), ], ); diff --git a/app/lib/features/chat/shell/chat_shell_history_chip.dart b/app/lib/features/chat/shell/chat_shell_history_chip.dart index 430cc9eb..62e81836 100644 --- a/app/lib/features/chat/shell/chat_shell_history_chip.dart +++ b/app/lib/features/chat/shell/chat_shell_history_chip.dart @@ -36,7 +36,7 @@ class ChatShellHistoryChip extends StatelessWidget { ); } - Future _open(BuildContext context, bool _) { + Future _open(BuildContext context) { // A dialog in the tiled app on a wide layout. A phone keeps the // full-screen page, and a floating window opens it as a page of that // window, so what it opens next (a diff, a command's output) stays in diff --git a/app/lib/features/chat/shell/chat_shell_history_output_page.dart b/app/lib/features/chat/shell/chat_shell_history_output_page.dart index 37ae53fe..9da27490 100644 --- a/app/lib/features/chat/shell/chat_shell_history_output_page.dart +++ b/app/lib/features/chat/shell/chat_shell_history_output_page.dart @@ -98,7 +98,7 @@ class _ChatShellHistoryOutputPageState if (snapshot.hasError) { return Text( "Couldn't read the output: ${snapshot.error}", - style: chatCardSecondaryStyle(context, false), + style: chatCardSecondaryStyle(context), ); } final full = snapshot.data; @@ -134,10 +134,7 @@ class _ChatShellHistoryOutputPageState children: [ ChatShellStatus(run: full), if (full.directory.isNotEmpty) - Text( - full.directory, - style: chatCardSecondaryStyle(context, false), - ), + Text(full.directory, style: chatCardSecondaryStyle(context)), ], ), ), @@ -146,7 +143,7 @@ class _ChatShellHistoryOutputPageState ? Text( 'No output.', key: const Key('chat-shell-output-empty'), - style: chatCardSecondaryStyle(context, false), + style: chatCardSecondaryStyle(context), ) : ChatShellTerminalView(session: session, fill: true), ), @@ -207,8 +204,7 @@ class _ChatShellHistoryOutputPageState error, style: chatCardSecondaryStyle( context, - false, - )?.copyWith(color: chatCardErrorColor(context, false)), + )?.copyWith(color: chatCardErrorColor(context)), ), ), ], diff --git a/app/lib/features/chat/shell/chat_shell_history_view.dart b/app/lib/features/chat/shell/chat_shell_history_view.dart index eaccb238..23c709f6 100644 --- a/app/lib/features/chat/shell/chat_shell_history_view.dart +++ b/app/lib/features/chat/shell/chat_shell_history_view.dart @@ -76,7 +76,7 @@ class _ChatShellHistoryViewState extends State { padding: const EdgeInsets.all(16), child: Text( 'Every command here was restored to the transcript.', - style: chatCardSecondaryStyle(context, false), + style: chatCardSecondaryStyle(context), ), ), for (final run in runs) _entry(context, run), @@ -100,7 +100,7 @@ class _ChatShellHistoryViewState extends State { } Widget _entry(BuildContext context, ChatShellRun run) { - final secondary = chatCardSecondaryStyle(context, false); + final secondary = chatCardSecondaryStyle(context); final refusal = _refusals[run.id]; final command = run.purged || run.command.isEmpty ? Text(chatShellCommandNotKept, style: secondary) @@ -125,9 +125,7 @@ class _ChatShellHistoryViewState extends State { Text( refusal, key: const Key('chat-shell-history-refusal'), - style: secondary?.copyWith( - color: chatCardErrorColor(context, false), - ), + style: secondary?.copyWith(color: chatCardErrorColor(context)), ), ], ); diff --git a/app/lib/features/chat/shell/chat_shell_mode_indicator.dart b/app/lib/features/chat/shell/chat_shell_mode_indicator.dart index bed86ad3..dc0eda02 100644 --- a/app/lib/features/chat/shell/chat_shell_mode_indicator.dart +++ b/app/lib/features/chat/shell/chat_shell_mode_indicator.dart @@ -11,8 +11,10 @@ class ChatShellModeIndicator extends StatelessWidget { @override Widget build(BuildContext context) { final accent = Theme.of(context).colorScheme.primary; - final label = (chatCardBodyStyle(context, false) ?? const TextStyle()) - .copyWith(color: accent, fontWeight: FontWeight.w600); + final label = (chatCardBodyStyle(context) ?? const TextStyle()).copyWith( + color: accent, + fontWeight: FontWeight.w600, + ); return Semantics( key: const Key('chat-composer-shell-mode'), container: true, @@ -40,10 +42,7 @@ class ChatShellModeIndicator extends StatelessWidget { Text(chatShellModeLabel, style: label), ], ), - Text( - chatShellModeHint, - style: chatCardSecondaryStyle(context, false), - ), + Text(chatShellModeHint, style: chatCardSecondaryStyle(context)), ], ), ), diff --git a/app/lib/features/chat/shell/chat_shell_output_view.dart b/app/lib/features/chat/shell/chat_shell_output_view.dart index 97925d1b..5fbd597d 100644 --- a/app/lib/features/chat/shell/chat_shell_output_view.dart +++ b/app/lib/features/chat/shell/chat_shell_output_view.dart @@ -34,7 +34,7 @@ class ChatShellOutputView extends StatelessWidget { return Text( 'No output.', key: const Key('chat-shell-output-empty'), - style: chatCardSecondaryStyle(context, false), + style: chatCardSecondaryStyle(context), ); } final session = controller.terminals.session(run); diff --git a/app/lib/features/chat/shell/chat_shell_run_card.dart b/app/lib/features/chat/shell/chat_shell_run_card.dart index 7b1d1702..ba876583 100644 --- a/app/lib/features/chat/shell/chat_shell_run_card.dart +++ b/app/lib/features/chat/shell/chat_shell_run_card.dart @@ -77,8 +77,10 @@ class _ChatShellRunCardState extends State { Widget _body(BuildContext context, ChatShellRun run) { final controller = widget.controller; final error = controller.errorFor(run.id); - final command = (chatCardBodyStyle(context, false) ?? const TextStyle()) - .copyWith(fontFamily: appMonospaceFamily, fontWeight: FontWeight.w600); + final command = (chatCardBodyStyle(context) ?? const TextStyle()).copyWith( + fontFamily: appMonospaceFamily, + fontWeight: FontWeight.w600, + ); return Column( key: ValueKey('chat-shell-run-${run.id}'), mainAxisSize: MainAxisSize.min, @@ -91,7 +93,7 @@ class _ChatShellRunCardState extends State { padding: const EdgeInsetsDirectional.only(end: 12), child: Icon( Icons.terminal, - color: chatCardSecondaryColor(context, false), + color: chatCardSecondaryColor(context), ), ), Expanded( @@ -104,10 +106,7 @@ class _ChatShellRunCardState extends State { style: command, ), if (run.directory.isNotEmpty) - Text( - run.directory, - style: chatCardSecondaryStyle(context, false), - ), + Text(run.directory, style: chatCardSecondaryStyle(context)), ], ), ), @@ -132,10 +131,7 @@ class _ChatShellRunCardState extends State { if (run.error.isNotEmpty && !run.running) Padding( padding: const EdgeInsets.only(top: 8), - child: Text( - run.error, - style: chatCardSecondaryStyle(context, false), - ), + child: Text(run.error, style: chatCardSecondaryStyle(context)), ), const SizedBox(height: 4), ChatShellCardActions( @@ -149,8 +145,9 @@ class _ChatShellRunCardState extends State { child: Text( error, key: const Key('chat-shell-run-error'), - style: (chatCardBodyStyle(context, false) ?? const TextStyle()) - .copyWith(color: chatCardErrorColor(context, false)), + style: (chatCardBodyStyle(context) ?? const TextStyle()).copyWith( + color: chatCardErrorColor(context), + ), ), ), ], diff --git a/app/lib/features/chat/shell/chat_shell_status.dart b/app/lib/features/chat/shell/chat_shell_status.dart index 3f35b420..ffbb51cc 100644 --- a/app/lib/features/chat/shell/chat_shell_status.dart +++ b/app/lib/features/chat/shell/chat_shell_status.dart @@ -30,8 +30,8 @@ class ChatShellStatus extends StatelessWidget { : chatShellStatusLabel(run); final color = switch (run.state) { ChatShellRunState.succeeded => Theme.of(context).colorScheme.primary, - ChatShellRunState.failed => chatCardErrorColor(context, false), - _ => chatCardSecondaryColor(context, false), + ChatShellRunState.failed => chatCardErrorColor(context), + _ => chatCardSecondaryColor(context), }; final icon = switch (run.state) { ChatShellRunState.succeeded => Icons.check_circle_outline, diff --git a/app/lib/features/chat/shell/chat_shell_terminal_theme.dart b/app/lib/features/chat/shell/chat_shell_terminal_theme.dart index 936096ed..319b86af 100644 --- a/app/lib/features/chat/shell/chat_shell_terminal_theme.dart +++ b/app/lib/features/chat/shell/chat_shell_terminal_theme.dart @@ -12,7 +12,7 @@ import '../conversation/chat_card_styles.dart'; /// darkened on a light surface so coloured output stays readable. TerminalTheme chatShellTerminalTheme(BuildContext context) { final dark = Theme.of(context).brightness == Brightness.dark; - final background = chatCardFillColor(context, false); + final background = chatCardFillColor(context); final foreground = Theme.of(context).colorScheme.onSurface; final accent = Theme.of(context).colorScheme.primary; final base = TerminalThemes.defaultTheme; @@ -55,7 +55,7 @@ TerminalTheme chatShellTerminalTheme(BuildContext context) { /// The terminal's text: the host's monospace family at the card body size. TerminalStyle chatShellTerminalStyle(BuildContext context) { - final body = chatCardBodyStyle(context, false) ?? const TextStyle(); + final body = chatCardBodyStyle(context) ?? const TextStyle(); return TerminalStyle( fontFamily: appMonospaceFamily, fontSize: (body.fontSize ?? 14) * 0.95, diff --git a/app/lib/features/chat/ui/folder_picker/folder_picker_page.dart b/app/lib/features/chat/ui/folder_picker/folder_picker_page.dart index df25c8a6..7b63d799 100644 --- a/app/lib/features/chat/ui/folder_picker/folder_picker_page.dart +++ b/app/lib/features/chat/ui/folder_picker/folder_picker_page.dart @@ -103,9 +103,8 @@ class _FolderPickerPageState extends State { /// The app's segmented bar: Back (climbing one folder), the title, and /// Cancel in the actions pill, each popping in like every other bar. SegmentedBar _bar() => SegmentedBar( - cupertino: false, automaticallyImplyLeading: false, - leading: SegmentedBackButton(cupertino: false, onPressed: _back), + leading: SegmentedBackButton(onPressed: _back), title: widget.purpose.title, actions: [ TextButton( diff --git a/app/lib/features/chat/ui/sessions/chat_adaptive.dart b/app/lib/features/chat/ui/sessions/chat_adaptive.dart index 9326fa8a..5831c600 100644 --- a/app/lib/features/chat/ui/sessions/chat_adaptive.dart +++ b/app/lib/features/chat/ui/sessions/chat_adaptive.dart @@ -7,7 +7,6 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable { required this.label, required this.onPressed, required this.materialIcon, - this.cupertinoIcon, this.identifier, }); @@ -15,10 +14,6 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable { final VoidCallback onPressed; final IconData materialIcon; - /// Compatibility for callers not yet migrated; Material always uses - /// [materialIcon]. - final IconData? cupertinoIcon; - final String? identifier; /// A narrow bar moves it into its More menu, under the bar's host's icon. diff --git a/app/lib/features/chat/ui/sessions/chat_compact_avatar.dart b/app/lib/features/chat/ui/sessions/chat_compact_avatar.dart index eb078207..a56f7e42 100644 --- a/app/lib/features/chat/ui/sessions/chat_compact_avatar.dart +++ b/app/lib/features/chat/ui/sessions/chat_compact_avatar.dart @@ -13,11 +13,10 @@ class ChatCompactAvatar extends StatelessWidget { required this.running, required this.backgroundTasks, required this.unread, - required this.cupertino, }); final String title; final Color color; - final bool active, visible, running, unread, cupertino; + final bool active, visible, running, unread; final int backgroundTasks; @override @@ -45,7 +44,6 @@ class ChatCompactAvatar extends StatelessWidget { ), ), if (chatSessionActivityBadge( - cupertino: cupertino, running: running, backgroundTasks: backgroundTasks, ) diff --git a/app/lib/features/chat/ui/sessions/chat_compact_sidebar.dart b/app/lib/features/chat/ui/sessions/chat_compact_sidebar.dart index 33b17e2e..587e205c 100644 --- a/app/lib/features/chat/ui/sessions/chat_compact_sidebar.dart +++ b/app/lib/features/chat/ui/sessions/chat_compact_sidebar.dart @@ -107,7 +107,6 @@ class ChatCompactSidebar extends StatelessWidget { running: running, backgroundTasks: backgroundTasks, unread: unread, - cupertino: false, ), if (machineName case final name?) Text( diff --git a/app/lib/features/chat/ui/sessions/chat_prompt_chooser.dart b/app/lib/features/chat/ui/sessions/chat_prompt_chooser.dart index 2e02340b..4e7bee43 100644 --- a/app/lib/features/chat/ui/sessions/chat_prompt_chooser.dart +++ b/app/lib/features/chat/ui/sessions/chat_prompt_chooser.dart @@ -6,7 +6,6 @@ import 'chat_create_fields.dart'; class ChatPromptChooser extends StatelessWidget { const ChatPromptChooser({ super.key, - required this.cupertino, required this.enabled, required this.choice, required this.hasLastUsed, @@ -18,8 +17,6 @@ class ChatPromptChooser extends StatelessWidget { static const careful = 'careful'; static const lastUsed = 'last-used'; - /// Kept for callers; the Material switch and picker are always drawn. - final bool cupertino; final bool enabled; final String choice; final bool hasLastUsed; diff --git a/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart b/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart index 118ef1d3..0cdb7c5c 100644 --- a/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart +++ b/app/lib/features/chat/ui/sessions/chat_sessions_screen.dart @@ -417,11 +417,7 @@ class _ChatSessionsScreenState extends State { return Scaffold( extendBodyBehindAppBar: true, - appBar: SegmentedBar( - cupertino: false, - title: 'Chats', - actions: _actions(), - ), + appBar: SegmentedBar(title: 'Chats', actions: _actions()), // The list scrolls behind the floating bar; New chat is the bar's // own action, so there is no second create button. body: body, diff --git a/app/lib/features/chat/ui/sessions/create_chat_dialog.dart b/app/lib/features/chat/ui/sessions/create_chat_dialog.dart index 2ec73fe9..fe59daa1 100644 --- a/app/lib/features/chat/ui/sessions/create_chat_dialog.dart +++ b/app/lib/features/chat/ui/sessions/create_chat_dialog.dart @@ -335,7 +335,6 @@ class _CreateChatDialogState extends State { ), const SizedBox(height: 12), ChatPromptChooser( - cupertino: false, enabled: _sendPrompt, choice: _promptChoice, hasLastUsed: _savedPrompt?.text.trim().isNotEmpty == true, diff --git a/app/lib/features/chat/ui/sessions/session_activity_badge.dart b/app/lib/features/chat/ui/sessions/session_activity_badge.dart index 53865680..2eb4936a 100644 --- a/app/lib/features/chat/ui/sessions/session_activity_badge.dart +++ b/app/lib/features/chat/ui/sessions/session_activity_badge.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; /// background tasks still run, a quiet muted glyph (never a second spinner). /// Null when the chat is idle. Widget? chatSessionActivityBadge({ - required bool cupertino, required bool running, required int backgroundTasks, }) { diff --git a/app/lib/features/chat/ui/sessions/session_row_content.dart b/app/lib/features/chat/ui/sessions/session_row_content.dart index 46ddc514..21eca855 100644 --- a/app/lib/features/chat/ui/sessions/session_row_content.dart +++ b/app/lib/features/chat/ui/sessions/session_row_content.dart @@ -64,7 +64,7 @@ class ChatSessionRow extends StatelessWidget { final accent = Theme.of(context).colorScheme.primary; final shade = chatColorShade(context, chatSessionColor(session)); final marker = shade ?? accent; - final tint = AppListRow.tintFor(context, shade, cupertino: false); + final tint = AppListRow.tintFor(context, shade); final background = Theme.of(context).scaffoldBackgroundColor; // On a phone the chat's page grows out of this row and shrinks back // into it; the surface it starts from is the row's tint over the list. @@ -97,7 +97,6 @@ class ChatSessionRow extends StatelessWidget { active: selected, child: AppListRow( key: Key('chat-row-$id'), - cupertino: false, selected: selected, selectedFill: Colors.transparent, emphasized: unread, @@ -236,7 +235,6 @@ class ChatSessionAvatar extends StatelessWidget { foreground: mark, background: fill, badge: chatSessionActivityBadge( - cupertino: false, running: running, backgroundTasks: backgroundTasks, ), diff --git a/app/lib/features/chat/ui/transcript/chat_attachment_gallery.dart b/app/lib/features/chat/ui/transcript/chat_attachment_gallery.dart index d13729f1..d3c38419 100644 --- a/app/lib/features/chat/ui/transcript/chat_attachment_gallery.dart +++ b/app/lib/features/chat/ui/transcript/chat_attachment_gallery.dart @@ -18,13 +18,11 @@ class ChatAttachmentGallery extends StatelessWidget { super.key, required this.parts, required this.images, - required this.cupertino, }); /// File parts for which [chatPartIsThumbnail] holds. final List parts; final ChatAttachmentImages images; - final bool cupertino; @override Widget build(BuildContext context) => Wrap( @@ -39,7 +37,6 @@ class ChatAttachmentGallery extends StatelessWidget { name: chatAttachmentPartName(part), uri: '${part['uri'] ?? ''}'.trim(), images: images, - cupertino: cupertino, ), ], ); diff --git a/app/lib/features/chat/ui/transcript/chat_attachment_thumbnail.dart b/app/lib/features/chat/ui/transcript/chat_attachment_thumbnail.dart index 9bfce1a4..d8079b2c 100644 --- a/app/lib/features/chat/ui/transcript/chat_attachment_thumbnail.dart +++ b/app/lib/features/chat/ui/transcript/chat_attachment_thumbnail.dart @@ -20,13 +20,11 @@ class ChatAttachmentThumbnail extends StatefulWidget { required this.name, required this.uri, required this.images, - required this.cupertino, }); final String name; final String uri; final ChatAttachmentImages images; - final bool cupertino; @override State createState() => @@ -121,12 +119,8 @@ class _ChatAttachmentThumbnailState extends State { _placeholder(context, 'Image could not be read'), ), ); - void open() => openChatImageViewer( - context, - name: widget.name, - bytes: bytes, - cupertino: widget.cupertino, - ); + void open() => + openChatImageViewer(context, name: widget.name, bytes: bytes); final constrained = ConstrainedBox( constraints: const BoxConstraints( maxWidth: chatThumbnailMaxWidth, diff --git a/app/lib/features/chat/ui/transcript/chat_code_hover.dart b/app/lib/features/chat/ui/transcript/chat_code_hover.dart index 5f002184..18acc455 100644 --- a/app/lib/features/chat/ui/transcript/chat_code_hover.dart +++ b/app/lib/features/chat/ui/transcript/chat_code_hover.dart @@ -11,13 +11,7 @@ class ChatCodeHover { Object? _active; bool _disposed = false; - void show( - BuildContext context, - Object token, - String text, - Offset pointer, { - bool? cupertino, - }) { + void show(BuildContext context, Object token, String text, Offset pointer) { if (_disposed) return; hide(); final overlay = Overlay.maybeOf(context, rootOverlay: true); @@ -128,12 +122,10 @@ class ChatCodeCopyRegion extends StatefulWidget { const ChatCodeCopyRegion({ super.key, required this.code, - this.cupertino, required this.label, required this.child, }); final String code; - final bool? cupertino; final Widget label, child; @override State createState() => _ChatCodeCopyRegionState(); diff --git a/app/lib/features/chat/ui/transcript/chat_image_viewer.dart b/app/lib/features/chat/ui/transcript/chat_image_viewer.dart index 076affd6..ea508e40 100644 --- a/app/lib/features/chat/ui/transcript/chat_image_viewer.dart +++ b/app/lib/features/chat/ui/transcript/chat_image_viewer.dart @@ -9,16 +9,10 @@ const String chatImageViewerClose = 'Close'; /// One attached image full screen: pinch or scroll to zoom, drag to pan once /// zoomed, and the host's own close control in the navigation bar. class ChatImageViewer extends StatelessWidget { - const ChatImageViewer({ - super.key, - required this.name, - required this.bytes, - required this.cupertino, - }); + const ChatImageViewer({super.key, required this.name, required this.bytes}); final String name; final Uint8List bytes; - final bool cupertino; @override Widget build(BuildContext context) { @@ -45,7 +39,6 @@ class ChatImageViewer extends StatelessWidget { extendBodyBehindAppBar: true, backgroundColor: Colors.black, appBar: SegmentedBar( - cupertino: false, automaticallyImplyLeading: false, leading: IconButton( key: const Key('chat-image-viewer-close'), @@ -68,9 +61,8 @@ Future openChatImageViewer( BuildContext context, { required String name, required Uint8List bytes, - required bool cupertino, }) { - final page = ChatImageViewer(name: name, bytes: bytes, cupertino: cupertino); + final page = ChatImageViewer(name: name, bytes: bytes); return Navigator.of( context, ).push(MaterialPageRoute(fullscreenDialog: true, builder: (_) => page)); diff --git a/app/lib/features/chat/ui/transcript/chat_injected_rows.dart b/app/lib/features/chat/ui/transcript/chat_injected_rows.dart index e47f6c54..13346a20 100644 --- a/app/lib/features/chat/ui/transcript/chat_injected_rows.dart +++ b/app/lib/features/chat/ui/transcript/chat_injected_rows.dart @@ -116,7 +116,7 @@ class _ChatAgentReportCardState extends State { ? Padding( padding: const EdgeInsetsDirectional.fromSTEB(12, 0, 12, 12), child: DefaultTextStyle.merge( - style: chatMessageTextStyle(context, false), + style: chatMessageTextStyle(context), child: widget.textBuilder?.call(context, content.text) ?? SelectableText(content.text), diff --git a/app/lib/features/chat/ui/transcript/chat_message_bubble.dart b/app/lib/features/chat/ui/transcript/chat_message_bubble.dart index db8e70fe..495a068a 100644 --- a/app/lib/features/chat/ui/transcript/chat_message_bubble.dart +++ b/app/lib/features/chat/ui/transcript/chat_message_bubble.dart @@ -71,7 +71,7 @@ class ChatAgentSurface extends StatelessWidget { /// The transcript's reading text: the host's large body role, so answers read /// at a comfortable size and still follow the operator's text scaling. -TextStyle? chatMessageTextStyle(BuildContext context, [bool? cupertino]) => +TextStyle? chatMessageTextStyle(BuildContext context) => Theme.of(context).textTheme.bodyLarge; /// The empty-line gap between two paragraphs of a reply: about one line of diff --git a/app/lib/features/chat/ui/transcript/chat_message_view.dart b/app/lib/features/chat/ui/transcript/chat_message_view.dart index 8a87b9fd..1fee3081 100644 --- a/app/lib/features/chat/ui/transcript/chat_message_view.dart +++ b/app/lib/features/chat/ui/transcript/chat_message_view.dart @@ -55,7 +55,7 @@ class ChatMessageView extends StatelessWidget { // that shrinks to its content; the agent's answer sits on the page with no // bubble, so long replies read as a document rather than a balloon. final body = DefaultTextStyle.merge( - style: chatMessageTextStyle(context, false), + style: chatMessageTextStyle(context), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -127,7 +127,6 @@ class ChatMessageView extends StatelessWidget { ChatAttachmentGallery( parts: thumbnails, images: images ?? _inlineImages, - cupertino: false, ), if (thumbnails.isNotEmpty && content.isNotEmpty) const SizedBox(height: 6), @@ -284,7 +283,7 @@ class ChatMessageView extends StatelessWidget { // empty line between consecutive ones keeps them reading as paragraphs. final gap = chatParagraphGap( context, - chatMessageTextStyle(context, false)?.fontSize, + chatMessageTextStyle(context)?.fontSize, ); var previousText = false; for (var index = 0; index < parts.length; index++) { diff --git a/app/lib/features/chat/ui/transcript/chat_turn_chip.dart b/app/lib/features/chat/ui/transcript/chat_turn_chip.dart index 1ca47eb0..124d4492 100644 --- a/app/lib/features/chat/ui/transcript/chat_turn_chip.dart +++ b/app/lib/features/chat/ui/transcript/chat_turn_chip.dart @@ -28,7 +28,7 @@ class ChatTurnChip extends StatelessWidget { final Widget? sheet; /// A custom presentation (a full-screen route on a narrow window). - final Future Function(BuildContext context, bool cupertino)? open; + final Future Function(BuildContext context)? open; /// Shrink a long label to one ellipsized line. Only for a chip whose parent /// bounds its width (a turn footer's Wrap, an aligned row). @@ -91,7 +91,7 @@ class ChatTurnChip extends StatelessWidget { } Future _open(BuildContext context) { - if (open case final open?) return open(context, false); + if (open case final open?) return open(context); return showChatTurnSheet(context, sheet!); } } diff --git a/app/lib/features/chat/ui/transcript/chat_turn_diff_chip.dart b/app/lib/features/chat/ui/transcript/chat_turn_diff_chip.dart index e52a3512..f2bcc9fb 100644 --- a/app/lib/features/chat/ui/transcript/chat_turn_diff_chip.dart +++ b/app/lib/features/chat/ui/transcript/chat_turn_diff_chip.dart @@ -55,8 +55,7 @@ class ChatTurnDiffChip extends StatelessWidget { ); } - // The flag is unused: the Material presentation is the only one. - Future _open(BuildContext context, bool cupertino) { + Future _open(BuildContext context) { // A dialog in the tiled app on a wide layout. A phone keeps the // full-screen page, and a floating window opens it as a page of that // window, so what it opens next (a diff, a command's output) stays in diff --git a/app/lib/features/chat/ui/transcript/shown/chat_shown_html_card.dart b/app/lib/features/chat/ui/transcript/shown/chat_shown_html_card.dart index 5ff10247..8f49c2b3 100644 --- a/app/lib/features/chat/ui/transcript/shown/chat_shown_html_card.dart +++ b/app/lib/features/chat/ui/transcript/shown/chat_shown_html_card.dart @@ -46,7 +46,6 @@ class ChatShownHtmlCard extends StatelessWidget { // The Material host: the route is a MaterialPageRoute whatever // this flag says, so the flag is always false here. artifactFullscreenRoute( - cupertino: false, builder: (_) => ChatShownHtmlPage( title: title, html: html, diff --git a/app/lib/features/graph/viewport/graph_expanded_view.dart b/app/lib/features/graph/viewport/graph_expanded_view.dart index 012196d7..ef25deea 100644 --- a/app/lib/features/graph/viewport/graph_expanded_view.dart +++ b/app/lib/features/graph/viewport/graph_expanded_view.dart @@ -101,10 +101,9 @@ class _GraphExpandedViewState extends State { return Scaffold( extendBodyBehindAppBar: true, appBar: SegmentedBar( - cupertino: false, title: widget.title, automaticallyImplyLeading: false, - leading: SegmentedBackButton(cupertino: false, onPressed: _close), + leading: SegmentedBackButton(onPressed: _close), actions: [_GraphFitButton(onPressed: _controller.fitToViewport)], ), body: BelowTopBar(child: body), diff --git a/app/lib/features/graph/viewport/graph_viewport.dart b/app/lib/features/graph/viewport/graph_viewport.dart index 787741fd..7465462f 100644 --- a/app/lib/features/graph/viewport/graph_viewport.dart +++ b/app/lib/features/graph/viewport/graph_viewport.dart @@ -119,7 +119,6 @@ class _GraphViewportState extends State { top: 8, end: 8, child: GlassPill( - cupertino: false, child: Wrap( spacing: 2, children: [ diff --git a/app/lib/features/graph/widgets/stage_definition_view.dart b/app/lib/features/graph/widgets/stage_definition_view.dart index 42ba6dc9..26fd3fec 100644 --- a/app/lib/features/graph/widgets/stage_definition_view.dart +++ b/app/lib/features/graph/widgets/stage_definition_view.dart @@ -161,7 +161,7 @@ Future openStageDefinition( settings: settings, builder: (_) => Scaffold( extendBodyBehindAppBar: true, - appBar: SegmentedBar(cupertino: false, title: title, subtitle: identity), + appBar: SegmentedBar(title: title, subtitle: identity), body: SafeArea(top: false, bottom: false, child: view), ), ); diff --git a/app/lib/features/pipelines/screen.dart b/app/lib/features/pipelines/screen.dart index ac00caee..f6a1a810 100644 --- a/app/lib/features/pipelines/screen.dart +++ b/app/lib/features/pipelines/screen.dart @@ -335,7 +335,6 @@ class _PipelinesScreenState extends State { return Scaffold( extendBodyBehindAppBar: true, appBar: SegmentedBar( - cupertino: false, title: 'Pipelines', actions: [ ...pipelineListActions(context, _controller), diff --git a/app/lib/features/pipelines/ui/run_pipeline_dialog.dart b/app/lib/features/pipelines/ui/run_pipeline_dialog.dart index 3155f854..3c0e25d8 100644 --- a/app/lib/features/pipelines/ui/run_pipeline_dialog.dart +++ b/app/lib/features/pipelines/ui/run_pipeline_dialog.dart @@ -266,7 +266,6 @@ class _RunPipelineDialogState extends State<_RunPipelineDialog> { prompt: _prompt, workspace: _workspace, directories: _directories, - cupertino: false, onChooseDirectory: _chooseDirectory, notifyMode: _notify, outputFormat: _outputFormat, diff --git a/app/lib/features/pipelines/ui/run_pipeline_fields.dart b/app/lib/features/pipelines/ui/run_pipeline_fields.dart index 387a3237..18a5e3ef 100644 --- a/app/lib/features/pipelines/ui/run_pipeline_fields.dart +++ b/app/lib/features/pipelines/ui/run_pipeline_fields.dart @@ -13,7 +13,6 @@ class RunPipelineFields extends StatelessWidget { required this.prompt, required this.workspace, required this.directories, - required this.cupertino, required this.onChooseDirectory, required this.notifyMode, required this.outputFormat, @@ -26,9 +25,6 @@ class RunPipelineFields extends StatelessWidget { final TextEditingController workspace; final List directories; - /// Retained for callers; the fields are Material on every host. - final bool cupertino; - final ValueChanged onChooseDirectory; final RunNotifyMode notifyMode; final RunOutputFormat outputFormat; diff --git a/app/lib/features/pipelines/widgets/pipeline_bar_buttons.dart b/app/lib/features/pipelines/widgets/pipeline_bar_buttons.dart index 8b10f045..a1b57a18 100644 --- a/app/lib/features/pipelines/widgets/pipeline_bar_buttons.dart +++ b/app/lib/features/pipelines/widgets/pipeline_bar_buttons.dart @@ -10,8 +10,6 @@ Widget pipelineBarIconButton( required Key key, required String label, required IconData icon, - // Compatibility for callers outside this lane; Material is always drawn. - IconData? cupertinoIcon, required VoidCallback? onPressed, }) { return SegmentedOverflowAction( diff --git a/app/lib/features/pipelines/widgets/pipeline_controls.dart b/app/lib/features/pipelines/widgets/pipeline_controls.dart index e62e411a..1d1ede8e 100644 --- a/app/lib/features/pipelines/widgets/pipeline_controls.dart +++ b/app/lib/features/pipelines/widgets/pipeline_controls.dart @@ -49,10 +49,7 @@ class PipelineBackButton extends StatelessWidget { Widget build(BuildContext context) { return Semantics( label: 'Back to pipelines', - child: SegmentedPill( - cupertino: false, - child: SegmentedBackButton(cupertino: false, onPressed: onPressed), - ), + child: SegmentedPill(child: SegmentedBackButton(onPressed: onPressed)), ); } } diff --git a/app/lib/features/pipelines/widgets/pipeline_filter_page.dart b/app/lib/features/pipelines/widgets/pipeline_filter_page.dart index fa06a8ea..56bdbb1c 100644 --- a/app/lib/features/pipelines/widgets/pipeline_filter_page.dart +++ b/app/lib/features/pipelines/widgets/pipeline_filter_page.dart @@ -18,7 +18,6 @@ Future openPipelineFilters( initial: initial, hasUnclassified: hasUnclassified, onApply: onApply, - cupertino: false, ), ), ); @@ -32,16 +31,12 @@ class PipelineFilterPage extends StatefulWidget { required this.initial, required this.hasUnclassified, required this.onApply, - required this.cupertino, }); final PipelineFilters initial; final bool hasUnclassified; final ValueChanged onApply; - /// Retained for callers; the page is Material on every host. - final bool cupertino; - @override State createState() => _PipelineFilterPageState(); } @@ -75,7 +70,6 @@ class _PipelineFilterPageState extends State { return Scaffold( extendBodyBehindAppBar: true, appBar: SegmentedBar( - cupertino: false, title: 'Filter pipelines', actions: [TextButton(onPressed: _apply, child: const Text('Done'))], ), diff --git a/app/lib/features/pipelines/widgets/pipeline_list_panel.dart b/app/lib/features/pipelines/widgets/pipeline_list_panel.dart index 619b701d..f03b518d 100644 --- a/app/lib/features/pipelines/widgets/pipeline_list_panel.dart +++ b/app/lib/features/pipelines/widgets/pipeline_list_panel.dart @@ -226,7 +226,6 @@ class PipelineListPanel extends StatelessWidget { final badge = run == null ? null : runBadge(run, now); return AppListRow( key: Key('pipeline-row-${pipeline.id}'), - cupertino: false, selected: controller.selectedId == pipeline.id, divider: index < header.length + items.length - 1, onTap: () => diff --git a/app/lib/features/pipelines/widgets/pipeline_summary_view.dart b/app/lib/features/pipelines/widgets/pipeline_summary_view.dart index 96977693..68f730d0 100644 --- a/app/lib/features/pipelines/widgets/pipeline_summary_view.dart +++ b/app/lib/features/pipelines/widgets/pipeline_summary_view.dart @@ -83,7 +83,6 @@ class PipelineSummaryView extends StatelessWidget { if (fields.isEmpty) return const SizedBox.shrink(); return FactsGrid( key: pipelineSummaryFactsKey, - cupertino: false, items: [ for (final field in fields) FactsGridItem( @@ -106,7 +105,6 @@ class PipelineSummaryView extends StatelessWidget { if (!showingLatest) AppListRow( key: const Key('pipeline-latest-version'), - cupertino: false, title: Text('View latest v${detail.latestVersion}'), subtitle: const Text('Return to the latest version'), divider: versions.isNotEmpty, @@ -115,7 +113,6 @@ class PipelineSummaryView extends StatelessWidget { for (var index = 0; index < versions.length; index += 1) AppListRow( key: Key('pipeline-version-${versions[index].version}'), - cupertino: false, selected: versions[index].version == effective, title: Text('v${versions[index].version}'), time: formatLocalTimestamp(versions[index].createdAt), diff --git a/app/lib/features/pipelines/widgets/pipeline_tabs.dart b/app/lib/features/pipelines/widgets/pipeline_tabs.dart index e66eb210..98c2bbc0 100644 --- a/app/lib/features/pipelines/widgets/pipeline_tabs.dart +++ b/app/lib/features/pipelines/widgets/pipeline_tabs.dart @@ -33,7 +33,6 @@ class PipelineDetailTabs extends StatelessWidget { return KeyedSubtree( key: const Key('pipeline-detail-tabs'), child: FloatingDestinationBar( - cupertino: false, currentIndex: tabs.indexOf(selected), edge: edge, onTap: (value) => onSelected(tabs[value]), diff --git a/app/lib/features/runs/actions/cancel_dialog.dart b/app/lib/features/runs/actions/cancel_dialog.dart index 6a80880d..f5ac4455 100644 --- a/app/lib/features/runs/actions/cancel_dialog.dart +++ b/app/lib/features/runs/actions/cancel_dialog.dart @@ -15,13 +15,9 @@ typedef CancelSubmit = Future Function(); Future showCancelRunPrompt({ required BuildContext context, required num runId, - required bool cupertino, required CancelSubmit onSubmit, }) { - final prompt = _CancelPrompt( - runId: runId, - onSubmit: onSubmit, - ); + final prompt = _CancelPrompt(runId: runId, onSubmit: onSubmit); return showDialog( context: context, barrierDismissible: false, diff --git a/app/lib/features/runs/actions/cancel_run_action.dart b/app/lib/features/runs/actions/cancel_run_action.dart index 38a687e9..d228a074 100644 --- a/app/lib/features/runs/actions/cancel_run_action.dart +++ b/app/lib/features/runs/actions/cancel_run_action.dart @@ -43,7 +43,6 @@ class _CancelRunActionState extends State { await showCancelRunPrompt( context: context, runId: id, - cupertino: false, onSubmit: () => _submit(id), ); } finally { diff --git a/app/lib/features/runs/actions/decision_action.dart b/app/lib/features/runs/actions/decision_action.dart index 51ac651c..78f6a154 100644 --- a/app/lib/features/runs/actions/decision_action.dart +++ b/app/lib/features/runs/actions/decision_action.dart @@ -22,17 +22,12 @@ class HumanDecisionAction extends StatefulWidget { required this.run, required this.gateway, required this.onRunChanged, - this.cupertino, }); final JsonMap run; final ApiGateway gateway; final ValueChanged onRunChanged; - /// Retained for callers that still pass a host style; the Material prompt is - /// used everywhere now. - final bool? cupertino; - @override State createState() => _HumanDecisionActionState(); } @@ -103,7 +98,6 @@ Future showRunDecisionPrompt({ required JsonMap run, required ApiGateway gateway, required ValueChanged onRunChanged, - bool? cupertino, bool Function()? isCurrent, }) async { final decision = pendingDecision(run); diff --git a/app/lib/features/runs/actions/decision_dialog.dart b/app/lib/features/runs/actions/decision_dialog.dart index d8c11988..5157097d 100644 --- a/app/lib/features/runs/actions/decision_dialog.dart +++ b/app/lib/features/runs/actions/decision_dialog.dart @@ -14,7 +14,6 @@ typedef DecisionSubmit = Future Function(DecisionDraft draft); Future showHumanDecisionPrompt({ required BuildContext context, required PendingDecision decision, - bool? cupertino, required DecisionSubmit onSubmit, }) { final prompt = _DecisionPrompt(decision: decision, onSubmit: onSubmit); diff --git a/app/lib/features/runs/actions/delete_runs_action.dart b/app/lib/features/runs/actions/delete_runs_action.dart index d0fd904e..0ec2c665 100644 --- a/app/lib/features/runs/actions/delete_runs_action.dart +++ b/app/lib/features/runs/actions/delete_runs_action.dart @@ -15,7 +15,6 @@ Future confirmDeleteRuns( required Iterable runs, required ApiGateway gateway, required ValueChanged onDeleted, - bool? cupertino, }) { final deletable = runs.where(runIsDeletable).toList(); final ids = deletableRunIds(deletable); @@ -24,7 +23,6 @@ Future confirmDeleteRuns( context: context, count: ids.length, size: runsSizeLabel(deletable), - cupertino: cupertino ?? false, onSubmit: () async { try { onDeleted(await RunsRepository(gateway).deleteRuns(ids)); diff --git a/app/lib/features/runs/actions/delete_runs_dialog.dart b/app/lib/features/runs/actions/delete_runs_dialog.dart index 44e48bac..b4e0b75c 100644 --- a/app/lib/features/runs/actions/delete_runs_dialog.dart +++ b/app/lib/features/runs/actions/delete_runs_dialog.dart @@ -18,10 +18,13 @@ Future showDeleteRunsPrompt({ required BuildContext context, required int count, required String? size, - required bool cupertino, required DeleteRunsSubmit onSubmit, }) async { - final prompt = _DeleteRunsPrompt(count: count, size: size, onSubmit: onSubmit); + final prompt = _DeleteRunsPrompt( + count: count, + size: size, + onSubmit: onSubmit, + ); final result = await showDialog( context: context, barrierDismissible: false, @@ -72,10 +75,8 @@ class _DeleteRunsPromptState extends State<_DeleteRunsPrompt> { } @override - Widget build(BuildContext context) => PopScope( - canPop: !_sending, - child: _material(context), - ); + Widget build(BuildContext context) => + PopScope(canPop: !_sending, child: _material(context)); Widget _material(BuildContext context) { final scheme = Theme.of(context).colorScheme; diff --git a/app/lib/features/runs/actions/retry_action.dart b/app/lib/features/runs/actions/retry_action.dart index c38ef52c..1ba6c8c2 100644 --- a/app/lib/features/runs/actions/retry_action.dart +++ b/app/lib/features/runs/actions/retry_action.dart @@ -106,7 +106,6 @@ Future openRetryRunPrompt( await showRetryRunPrompt( context: context, runId: id, - cupertino: false, onSubmit: (intent) async { try { final updated = await repository.retryRun( diff --git a/app/lib/features/runs/actions/retry_dialog.dart b/app/lib/features/runs/actions/retry_dialog.dart index c0f8d1a3..7ce7409c 100644 --- a/app/lib/features/runs/actions/retry_dialog.dart +++ b/app/lib/features/runs/actions/retry_dialog.dart @@ -18,13 +18,9 @@ typedef RetrySubmit = Future Function(RetryIntent intent); Future showRetryRunPrompt({ required BuildContext context, required num runId, - required bool cupertino, required RetrySubmit onSubmit, }) { - final prompt = _RetryPrompt( - runId: runId, - onSubmit: onSubmit, - ); + final prompt = _RetryPrompt(runId: runId, onSubmit: onSubmit); return showDialog( context: context, barrierDismissible: false, diff --git a/app/lib/features/runs/actions/title_action.dart b/app/lib/features/runs/actions/title_action.dart index e4e01d0e..22db3e2f 100644 --- a/app/lib/features/runs/actions/title_action.dart +++ b/app/lib/features/runs/actions/title_action.dart @@ -77,7 +77,6 @@ Future openRunTitleEditor( context: context, runId: id, initialTitle: storedRunTitle(run), - cupertino: false, onSubmit: (title) async { if (saving) return const ActionRefusal(actionAlreadySending); saving = true; diff --git a/app/lib/features/runs/actions/title_dialog.dart b/app/lib/features/runs/actions/title_dialog.dart index d9dd0302..964a4e97 100644 --- a/app/lib/features/runs/actions/title_dialog.dart +++ b/app/lib/features/runs/actions/title_dialog.dart @@ -19,7 +19,6 @@ Future showRunTitlePrompt({ required BuildContext context, required num runId, required String initialTitle, - required bool cupertino, required TitleSubmit onSubmit, }) { final prompt = _TitlePrompt( diff --git a/app/lib/features/runs/ui/run_changes_action.dart b/app/lib/features/runs/ui/run_changes_action.dart index aa622d37..270b7ceb 100644 --- a/app/lib/features/runs/ui/run_changes_action.dart +++ b/app/lib/features/runs/ui/run_changes_action.dart @@ -144,7 +144,7 @@ class _MaterialChangesPage extends StatelessWidget { @override Widget build(BuildContext context) => Scaffold( extendBodyBehindAppBar: true, - appBar: SegmentedBar(cupertino: false, title: title), + appBar: SegmentedBar(title: title), body: ChangesViewer(steps: steps, showSummary: showSummary), ); } diff --git a/app/lib/features/runs/ui/run_detail_material.dart b/app/lib/features/runs/ui/run_detail_material.dart index dca0856d..e07bb2f3 100644 --- a/app/lib/features/runs/ui/run_detail_material.dart +++ b/app/lib/features/runs/ui/run_detail_material.dart @@ -28,7 +28,6 @@ Widget buildMaterialRunDetail({ }) { return RunDetailTabs( run: run, - cupertino: false, copying: copying, copyStatus: copyStatus, onCopy: onCopy, diff --git a/app/lib/features/runs/ui/run_detail_tab_bodies.dart b/app/lib/features/runs/ui/run_detail_tab_bodies.dart index 6cd83c34..134ba8a1 100644 --- a/app/lib/features/runs/ui/run_detail_tab_bodies.dart +++ b/app/lib/features/runs/ui/run_detail_tab_bodies.dart @@ -23,7 +23,6 @@ import '../../../ui/adaptive/floating_bar_layout.dart'; Widget runDetailSummaryTab({ required BuildContext context, required JsonMap run, - required bool cupertino, required bool copying, required String? copyStatus, required VoidCallback onCopy, @@ -101,22 +100,14 @@ Widget runDetailSummaryTab({ title: 'Input', controller: inputController, copyText: runFieldCopyText(run['input']), - body: RunFieldBody( - value: run['input'], - empty: visitEmptyInput, - cupertino: false, - ), + body: RunFieldBody(value: run['input'], empty: visitEmptyInput), ), _StickyField( key: const ValueKey('run-detail-summary-output'), title: 'Output', controller: outputController, copyText: runFieldCopyText(run['output']), - body: RunFieldBody( - value: run['output'], - empty: visitEmptyOutput, - cupertino: false, - ), + body: RunFieldBody(value: run['output'], empty: visitEmptyOutput), ), const SliverToBoxAdapter(child: SizedBox(height: 16)), const SliverFloatingBarClearance(), @@ -195,10 +186,9 @@ Widget runDetailFieldTab({ required String tabKey, required dynamic value, required String empty, - required bool cupertino, }) { // The recorded fields by name, as values, never raw JSON. - final body = RunFieldBody(value: value, empty: empty, cupertino: false); + final body = RunFieldBody(value: value, empty: empty); // Flat on the page on both hosts, like the Summary. return Builder( builder: (context) => ListView( diff --git a/app/lib/features/runs/ui/run_detail_tab_strip.dart b/app/lib/features/runs/ui/run_detail_tab_strip.dart index 99df9763..76122032 100644 --- a/app/lib/features/runs/ui/run_detail_tab_strip.dart +++ b/app/lib/features/runs/ui/run_detail_tab_strip.dart @@ -46,7 +46,6 @@ class RunDetailTabStrip extends StatelessWidget { return KeyedSubtree( key: const Key('run-detail-tabs'), child: FloatingDestinationBar( - cupertino: false, currentIndex: index < 0 ? 0 : index, edge: edge, onTap: (value) => onSelected(tabs[value]), diff --git a/app/lib/features/runs/ui/run_detail_tabs.dart b/app/lib/features/runs/ui/run_detail_tabs.dart index 683fa9b4..d303ba93 100644 --- a/app/lib/features/runs/ui/run_detail_tabs.dart +++ b/app/lib/features/runs/ui/run_detail_tabs.dart @@ -46,7 +46,6 @@ class RunDetailTabs extends StatefulWidget { super.key, required this.run, required this.header, - required this.cupertino, required this.copying, required this.copyStatus, required this.onCopy, @@ -63,7 +62,6 @@ class RunDetailTabs extends StatefulWidget { /// outside the tab body, so switching tabs never drops an action. final Widget header; - final bool cupertino; final bool copying; final String? copyStatus; final VoidCallback onCopy; @@ -329,7 +327,6 @@ class _RunDetailTabsState extends State { gateway: widget.gateway, onRunChanged: widget.onRunChanged, configuredEndpoint: widget.configuredEndpoint, - cupertino: false, onClose: () => Navigator.of(pageContext).pop(), ) : const Center(child: Text('This visit is no longer recorded.')); @@ -337,10 +334,8 @@ class _RunDetailTabsState extends State { // repeats neither; the sections scroll behind it. final known = index < visits.length; final bar = SegmentedBar( - cupertino: false, leading: SegmentedBackButton( key: const Key('run-visit-back'), - cupertino: false, onPressed: () => Navigator.of(pageContext).pop(), ), title: known ? visits[index].stage : detailTitle(run), @@ -417,11 +412,7 @@ class _RunDetailTabsState extends State { // strip) sits above the tab's content. return FloatingBarOverlay( edge: FloatingBarEdge.top, - bar: RunDetailWideChrome( - cupertino: false, - tabs: tabStrip, - header: header, - ), + bar: RunDetailWideChrome(tabs: tabStrip, header: header), child: body, ); } @@ -437,7 +428,6 @@ class _RunDetailTabsState extends State { edge: FloatingBarEdge.top, bar: TopGlassStrip( key: const Key('run-detail-header'), - cupertino: false, padding: const EdgeInsets.symmetric(vertical: 4), child: header, ), @@ -453,7 +443,6 @@ class _RunDetailTabsState extends State { return runDetailSummaryTab( context: context, run: widget.run, - cupertino: false, copying: widget.copying, copyStatus: widget.copyStatus, onCopy: widget.onCopy, @@ -482,14 +471,12 @@ class _RunDetailTabsState extends State { tabKey: 'input', value: widget.run['input'], empty: 'No input recorded.', - cupertino: false, ); case RunDetailTab.output: return runDetailFieldTab( tabKey: 'output', value: widget.run['output'], empty: 'No output recorded.', - cupertino: false, ); case RunDetailTab.artifacts: return ArtifactGalleryPage( @@ -520,7 +507,6 @@ class _RunDetailTabsState extends State { selectedSequence: index != null && index >= 0 && index < visits.length ? visits[index].sequence : null, - cupertino: false, onSelected: _openVisit, ); } diff --git a/app/lib/features/runs/ui/run_detail_timeline.dart b/app/lib/features/runs/ui/run_detail_timeline.dart index f0784202..047c6f75 100644 --- a/app/lib/features/runs/ui/run_detail_timeline.dart +++ b/app/lib/features/runs/ui/run_detail_timeline.dart @@ -25,13 +25,11 @@ class RunTimelineList extends StatelessWidget { const RunTimelineList({ super.key, required this.visits, - required this.cupertino, this.selectedSequence, this.onSelected, }); final List visits; - final bool cupertino; final int? selectedSequence; final ValueChanged? onSelected; @@ -61,7 +59,6 @@ class RunTimelineList extends StatelessWidget { ), visit: visits[index], selected: visits[index].sequence == selectedSequence, - cupertino: false, divider: index < visits.length - 1, palette: palette, onTap: onSelected == null ? null : () => onSelected!(index), @@ -79,7 +76,6 @@ class RunTimelineRow extends StatelessWidget { super.key, required this.visit, required this.selected, - required this.cupertino, this.divider = false, this.onTap, this.palette, @@ -87,7 +83,6 @@ class RunTimelineRow extends StatelessWidget { final DetailVisit visit; final bool selected; - final bool cupertino; final bool divider; final VoidCallback? onTap; @@ -140,7 +135,6 @@ class RunTimelineRow extends StatelessWidget { // The outcome chip leads the second line, then where the visit went and // the tokens it reported; the duration is the row's time. return AppListRow( - cupertino: false, selected: selected, divider: divider, onTap: onTap, diff --git a/app/lib/features/runs/ui/run_detail_view.dart b/app/lib/features/runs/ui/run_detail_view.dart index 9a99fd59..555dc8ec 100644 --- a/app/lib/features/runs/ui/run_detail_view.dart +++ b/app/lib/features/runs/ui/run_detail_view.dart @@ -112,7 +112,6 @@ class _RunDetailViewState extends State { run: run, gateway: widget.gateway, onRunChanged: widget.controller.acceptRunDetail, - cupertino: false, onRunOpened: widget.onRunOpened, onDeleted: widget.controller.applyDeletion, ); @@ -132,10 +131,8 @@ class _RunDetailViewState extends State { // On its own the run draws the same bar over its content. return SegmentedBarOverlay( bar: SegmentedBar( - cupertino: false, leading: SegmentedBackButton( key: const Key('run-detail-back'), - cupertino: false, onPressed: widget.onBack, ), title: title, diff --git a/app/lib/features/runs/ui/run_detail_visit.dart b/app/lib/features/runs/ui/run_detail_visit.dart index da2116e6..90d4e0fc 100644 --- a/app/lib/features/runs/ui/run_detail_visit.dart +++ b/app/lib/features/runs/ui/run_detail_visit.dart @@ -21,7 +21,6 @@ class RunVisitPane extends StatefulWidget { required this.gateway, required this.onRunChanged, required this.configuredEndpoint, - required this.cupertino, required this.onClose, }); @@ -41,7 +40,6 @@ class RunVisitPane extends StatefulWidget { final ValueChanged onRunChanged; final String configuredEndpoint; - final bool cupertino; final VoidCallback onClose; @override @@ -88,7 +86,6 @@ class _RunVisitPaneState extends State { gateway: widget.gateway, onRunChanged: widget.onRunChanged, configuredEndpoint: widget.configuredEndpoint, - cupertino: false, facts: RunVisitFactsView(step: widget.step), ), ], diff --git a/app/lib/features/runs/ui/run_detail_visit_sections.dart b/app/lib/features/runs/ui/run_detail_visit_sections.dart index 16fc233e..df811ae2 100644 --- a/app/lib/features/runs/ui/run_detail_visit_sections.dart +++ b/app/lib/features/runs/ui/run_detail_visit_sections.dart @@ -53,7 +53,6 @@ class RunVisitSectionStrip extends StatelessWidget { return KeyedSubtree( key: const Key('run-visit-tabs'), child: FloatingDestinationBar( - cupertino: false, currentIndex: index < 0 ? 0 : index, onTap: (value) => onSelected(shownVisitSections[value]), items: [ @@ -97,7 +96,6 @@ Widget runVisitSectionBody({ required ApiGateway gateway, required ValueChanged onRunChanged, required String configuredEndpoint, - required bool cupertino, Widget? facts, }) { Widget body(RunVisitSection section) => runVisitSectionBody( @@ -110,7 +108,6 @@ Widget runVisitSectionBody({ gateway: gateway, onRunChanged: onRunChanged, configuredEndpoint: configuredEndpoint, - cupertino: cupertino, ); switch (section) { case RunVisitSection.summary: @@ -128,14 +125,12 @@ Widget runVisitSectionBody({ tabKey: 'visit-input', value: step['input'], empty: visitEmptyInput, - cupertino: cupertino, ); case RunVisitSection.output: return runDetailFieldTab( tabKey: 'visit-output', value: step['output'], empty: visitEmptyOutput, - cupertino: cupertino, ); case RunVisitSection.artifacts: return RunVisitArtifacts( @@ -212,7 +207,7 @@ class _VisitSummaryState extends State<_VisitSummary> { trailing: [copy], body: Padding( padding: const EdgeInsets.fromLTRB(16, 0, 16, 16), - child: RunFieldBody(value: value, empty: empty, cupertino: false), + child: RunFieldBody(value: value, empty: empty), ), ); } diff --git a/app/lib/features/runs/ui/run_detail_wide_chrome.dart b/app/lib/features/runs/ui/run_detail_wide_chrome.dart index 4b66d2ff..4f9b512f 100644 --- a/app/lib/features/runs/ui/run_detail_wide_chrome.dart +++ b/app/lib/features/runs/ui/run_detail_wide_chrome.dart @@ -24,13 +24,10 @@ const double kRunDetailWideTabsShare = 0.6; class RunDetailWideChrome extends StatelessWidget { const RunDetailWideChrome({ super.key, - required this.cupertino, required this.tabs, required this.header, }); - final bool cupertino; - /// The tab strip at [FloatingBarEdge.top]; it brings its own 12px margins. final Widget tabs; @@ -66,7 +63,6 @@ class RunDetailWideChrome extends StatelessWidget { heightFactor: 1, child: GlassPill( key: const Key('run-detail-header'), - cupertino: false, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(kTopGlassStripRadius), ), diff --git a/app/lib/features/runs/ui/run_field_body.dart b/app/lib/features/runs/ui/run_field_body.dart index 897c7b6d..d1ce93ad 100644 --- a/app/lib/features/runs/ui/run_field_body.dart +++ b/app/lib/features/runs/ui/run_field_body.dart @@ -44,13 +44,11 @@ class RunFieldBody extends StatelessWidget { super.key, required this.value, required this.empty, - required this.cupertino, this.textBuilder, }); final dynamic value; final String empty; - final bool cupertino; /// Draws a plain value; the host's selectable text by default. final Widget Function(String text)? textBuilder; diff --git a/app/lib/features/runs/ui/run_graph_preview.dart b/app/lib/features/runs/ui/run_graph_preview.dart index 7fc92cea..9d37c81e 100644 --- a/app/lib/features/runs/ui/run_graph_preview.dart +++ b/app/lib/features/runs/ui/run_graph_preview.dart @@ -108,7 +108,7 @@ class RunGraphPreview extends StatelessWidget { MaterialPageRoute( builder: (page) => Scaffold( extendBodyBehindAppBar: true, - appBar: const SegmentedBar(cupertino: false, title: 'Graph'), + appBar: const SegmentedBar(title: 'Graph'), body: BelowTopBar(child: graphView(page)), ), ), diff --git a/app/lib/features/runs/ui/run_list_row.dart b/app/lib/features/runs/ui/run_list_row.dart index 00b1d1c8..a7f50114 100644 --- a/app/lib/features/runs/ui/run_list_row.dart +++ b/app/lib/features/runs/ui/run_list_row.dart @@ -119,7 +119,6 @@ class RunListRow extends StatelessWidget { final state = runStateOf(run['status']); return AppListRow( key: ValueKey('run-row-$id'), - cupertino: false, selected: selected, divider: divider, onTap: selecting ? (runIsDeletable(run) ? onToggle : null) : onTap, @@ -148,7 +147,6 @@ class RunListRow extends StatelessWidget { onRunChanged: onRunChanged!, onRunOpened: onRunOpened, onDeleted: onDeleted, - cupertino: false, menuKey: ValueKey('run-list-more-menu-$id'), ) : null, diff --git a/app/lib/features/runs/ui/run_more_menu.dart b/app/lib/features/runs/ui/run_more_menu.dart index 81788d35..7c7f9a1e 100644 --- a/app/lib/features/runs/ui/run_more_menu.dart +++ b/app/lib/features/runs/ui/run_more_menu.dart @@ -54,7 +54,6 @@ class RunMoreMenu extends StatefulWidget { required this.run, required this.gateway, required this.onRunChanged, - required this.cupertino, this.onRunOpened, this.onDeleted, this.menuKey = runMoreMenuKey, @@ -63,7 +62,6 @@ class RunMoreMenu extends StatefulWidget { final JsonMap run; final ApiGateway gateway; final ValueChanged onRunChanged; - final bool cupertino; /// Opens the new run an accepted retry names. final ValueChanged? onRunOpened; @@ -118,7 +116,6 @@ class _RunMoreMenuState extends State { runs: [run], gateway: widget.gateway, onDeleted: widget.onDeleted!, - cupertino: false, ); } } diff --git a/app/lib/features/runs/ui/run_pipeline_link.dart b/app/lib/features/runs/ui/run_pipeline_link.dart index fde5befd..bff1c5e9 100644 --- a/app/lib/features/runs/ui/run_pipeline_link.dart +++ b/app/lib/features/runs/ui/run_pipeline_link.dart @@ -17,15 +17,9 @@ int? runPipelineId(JsonMap run) { /// The run's pipeline name, a link to that pipeline at the run's pinned /// version when the run names one and the host can navigate. class RunPipelineLink extends StatelessWidget { - const RunPipelineLink({ - super.key, - required this.run, - required this.cupertino, - this.onOpenPipeline, - }); + const RunPipelineLink({super.key, required this.run, this.onOpenPipeline}); final JsonMap run; - final bool cupertino; final OpenPipeline? onOpenPipeline; @override diff --git a/app/lib/features/runs/ui/runs_selection_bar.dart b/app/lib/features/runs/ui/runs_selection_bar.dart index 4b78f926..ed689cd9 100644 --- a/app/lib/features/runs/ui/runs_selection_bar.dart +++ b/app/lib/features/runs/ui/runs_selection_bar.dart @@ -59,7 +59,6 @@ Widget runsSelectAction(BuildContext context, RunsController controller) { runs: selected, gateway: controller.repository.gateway, onDeleted: controller.applyDeletion, - cupertino: false, ); final deleteLabel = count == 0 ? 'Delete selected runs' diff --git a/app/lib/features/runs/ui/runs_stats_page.dart b/app/lib/features/runs/ui/runs_stats_page.dart index a0fac91f..38835be5 100644 --- a/app/lib/features/runs/ui/runs_stats_page.dart +++ b/app/lib/features/runs/ui/runs_stats_page.dart @@ -34,7 +34,7 @@ class RunsStatsPage extends StatelessWidget { ); return Scaffold( extendBodyBehindAppBar: true, - appBar: const SegmentedBar(cupertino: false, title: 'Usage'), + appBar: const SegmentedBar(title: 'Usage'), body: SafeArea(top: false, bottom: false, child: body), ); } diff --git a/app/lib/features/schedules/screen.dart b/app/lib/features/schedules/screen.dart index 5dfafd82..e23d3af9 100644 --- a/app/lib/features/schedules/screen.dart +++ b/app/lib/features/schedules/screen.dart @@ -79,7 +79,6 @@ class _SchedulesScreenState extends State { controller: _controller, searchController: _searchController, scrollController: _scrollController, - cupertino: false, onOpen: widget.onOpen, onRefresh: () => unawaited(_controller.refresh()), ), diff --git a/app/lib/features/schedules/ui/list/schedule_list_row.dart b/app/lib/features/schedules/ui/list/schedule_list_row.dart index 11e9bb49..e8176fac 100644 --- a/app/lib/features/schedules/ui/list/schedule_list_row.dart +++ b/app/lib/features/schedules/ui/list/schedule_list_row.dart @@ -13,23 +13,20 @@ class ScheduleListRow extends StatelessWidget { const ScheduleListRow({ super.key, required this.schedule, - required this.cupertino, required this.onOpen, this.divider = true, }); final SavedSchedule schedule; - final bool cupertino; final VoidCallback onOpen; final bool divider; @override Widget build(BuildContext context) { return AppListRow( - cupertino: false, divider: divider, onTap: onOpen, - leading: ScheduleAvatar(schedule: schedule, cupertino: false), + leading: ScheduleAvatar(schedule: schedule), title: Text(scheduleDisplayName(schedule)), time: scheduleNextDueShort(schedule), subtitle: Text( @@ -44,14 +41,9 @@ class ScheduleListRow extends StatelessWidget { /// state is also a word on the row (its time reads `Paused`), so colour is /// never the only signal. class ScheduleAvatar extends StatelessWidget { - const ScheduleAvatar({ - super.key, - required this.schedule, - required this.cupertino, - }); + const ScheduleAvatar({super.key, required this.schedule}); final SavedSchedule schedule; - final bool cupertino; @override Widget build(BuildContext context) { diff --git a/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart b/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart index d571e795..6d492f68 100644 --- a/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart +++ b/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart @@ -18,19 +18,16 @@ class ScheduleRefreshAction extends StatelessWidget { const ScheduleRefreshAction({ super.key, required this.controller, - this.cupertino, required this.onRefresh, }); final SchedulesController controller; - final bool? cupertino; final VoidCallback onRefresh; @override Widget build(BuildContext context) => BarIconButton( key: controller.isLoading ? null : scheduleRefreshKey, icon: Icons.refresh, - cupertinoIcon: Icons.refresh, label: 'Refresh schedules', busy: controller.isLoading, busyLabel: 'Refreshing schedules', @@ -49,13 +46,11 @@ class ScheduleListToolbar extends StatelessWidget { super.key, required this.controller, required this.searchController, - this.cupertino, this.onRefresh, }); final SchedulesController controller; final TextEditingController searchController; - final bool? cupertino; final VoidCallback? onRefresh; @override diff --git a/app/lib/features/schedules/ui/list/schedule_list_view.dart b/app/lib/features/schedules/ui/list/schedule_list_view.dart index fe30ffe3..1841cf8b 100644 --- a/app/lib/features/schedules/ui/list/schedule_list_view.dart +++ b/app/lib/features/schedules/ui/list/schedule_list_view.dart @@ -32,7 +32,6 @@ class SchedulesListView extends StatelessWidget { required this.controller, required this.searchController, required this.scrollController, - required this.cupertino, required this.onOpen, required this.onRefresh, this.refreshInToolbar = true, @@ -41,7 +40,6 @@ class SchedulesListView extends StatelessWidget { final SchedulesController controller; final TextEditingController searchController; final ScrollController scrollController; - final bool cupertino; final ValueChanged onOpen; final VoidCallback onRefresh; @@ -54,13 +52,11 @@ class SchedulesListView extends StatelessWidget { edge: FloatingBarEdge.top, bar: TopGlassStrip( key: scheduleToolbarKey, - cupertino: false, maxWidth: kScheduleToolbarMaxWidth, padding: EdgeInsets.zero, child: ScheduleListToolbar( controller: controller, searchController: searchController, - cupertino: false, onRefresh: refreshInToolbar ? onRefresh : null, ), ), @@ -117,7 +113,6 @@ class SchedulesListView extends StatelessWidget { 'schedule-row-$index-${schedule.id ?? 'unknown'}', ), schedule: schedule, - cupertino: false, divider: index < schedules.length - 1, onOpen: () => onOpen(schedule), ), diff --git a/app/lib/features/schedules/ui/pipeline/schedule_pipeline_editor.dart b/app/lib/features/schedules/ui/pipeline/schedule_pipeline_editor.dart index babf467b..fc64739c 100644 --- a/app/lib/features/schedules/ui/pipeline/schedule_pipeline_editor.dart +++ b/app/lib/features/schedules/ui/pipeline/schedule_pipeline_editor.dart @@ -42,7 +42,7 @@ Future openSchedulePipelineEditor( settings: settings, builder: (_) => Scaffold( extendBodyBehindAppBar: true, - appBar: SegmentedBar(cupertino: false, title: title), + appBar: SegmentedBar(title: title), body: SafeArea(child: page), ), ); diff --git a/app/lib/features/schedules/ui/pipeline/schedule_pipeline_row.dart b/app/lib/features/schedules/ui/pipeline/schedule_pipeline_row.dart index db7a78af..ca1705e0 100644 --- a/app/lib/features/schedules/ui/pipeline/schedule_pipeline_row.dart +++ b/app/lib/features/schedules/ui/pipeline/schedule_pipeline_row.dart @@ -39,10 +39,9 @@ class SchedulePipelineRow extends StatelessWidget { Widget build(BuildContext context) { final id = schedule.id; final row = AppListRow( - cupertino: false, divider: divider && error == null, onTap: busy ? null : onEdit, - leading: ScheduleAvatar(schedule: schedule, cupertino: false), + leading: ScheduleAvatar(schedule: schedule), title: Text(scheduleDisplayName(schedule)), time: scheduleNextDueShort(schedule), subtitle: Text( diff --git a/app/lib/features/search/search_screen.dart b/app/lib/features/search/search_screen.dart index a0965ef8..6451a7ea 100644 --- a/app/lib/features/search/search_screen.dart +++ b/app/lib/features/search/search_screen.dart @@ -21,16 +21,12 @@ class SearchScreen extends StatefulWidget { super.key, required this.gateway, required this.onOpen, - this.cupertino, this.embedded = false, }); final ApiGateway gateway; final ValueChanged onOpen; - /// Retained for the shell's surface contract; search is Material-only. - final bool? cupertino; - /// True as the Search tab: the controls go into the shell's bar. final bool embedded; @@ -130,26 +126,14 @@ class _SearchScreenState extends State { return _body(controls: _controls()); } // The field takes the title's place and fills the bar. - return ShellBar( - titleWidget: _controls(), - child: _body(), - ); + return ShellBar(titleWidget: _controls(), child: _body()); } - final bar = SegmentedBar( - cupertino: false, - title: 'Search', - titleWidget: _controls(), - ); - return Scaffold( - extendBodyBehindAppBar: true, - appBar: bar, - body: _body(), - ); + final bar = SegmentedBar(title: 'Search', titleWidget: _controls()); + return Scaffold(extendBodyBehindAppBar: true, appBar: bar, body: _body()); } Widget _controls() => SearchBarControls( focusNode: _focus, - cupertino: false, text: _text, kind: _controller.parsed.kind, onChanged: _controller.updateQuery, diff --git a/app/lib/features/search/ui/material_search_body.dart b/app/lib/features/search/ui/material_search_body.dart index 17008700..60254304 100644 --- a/app/lib/features/search/ui/material_search_body.dart +++ b/app/lib/features/search/ui/material_search_body.dart @@ -54,7 +54,6 @@ class MaterialSearchBody extends StatelessWidget { controller: controller, query: query, onOpen: onOpen, - cupertino: false, message: (text) => _SearchMessage(message: text), ); case SearchBodyKind.empty: diff --git a/app/lib/features/search/ui/search_bar_controls.dart b/app/lib/features/search/ui/search_bar_controls.dart index 7b409fdf..fba770f3 100644 --- a/app/lib/features/search/ui/search_bar_controls.dart +++ b/app/lib/features/search/ui/search_bar_controls.dart @@ -20,7 +20,6 @@ const searchTokenHint = class SearchBarControls extends StatelessWidget { const SearchBarControls({ super.key, - this.cupertino, required this.text, required this.kind, required this.onChanged, @@ -31,7 +30,6 @@ class SearchBarControls extends StatelessWidget { this.focusNode, }); - final bool? cupertino; final TextEditingController text; final SearchKind kind; final ValueChanged onChanged; @@ -69,7 +67,6 @@ class SearchBarControls extends StatelessWidget { BarIconButton( key: searchHelpKey, icon: Icons.info_outline, - cupertinoIcon: Icons.info_outline, label: 'Search syntax', onPressed: () => showSearchHelp(context), ), @@ -83,12 +80,10 @@ class SearchBarControls extends StatelessWidget { class SearchKindButton extends StatelessWidget { const SearchKindButton({ super.key, - this.cupertino, required this.kind, required this.onSelected, }); - final bool? cupertino; final SearchKind kind; final ValueChanged onSelected; @@ -128,7 +123,7 @@ class SearchKindButton extends StatelessWidget { } /// The query syntax, on demand instead of a paragraph above the results. -Future showSearchHelp(BuildContext context, {bool? cupertino}) { +Future showSearchHelp(BuildContext context) { return showDialog( context: context, builder: (context) => AlertDialog( diff --git a/app/lib/features/search/ui/search_result_row.dart b/app/lib/features/search/ui/search_result_row.dart index 7f6b03f3..6cfd6a7d 100644 --- a/app/lib/features/search/ui/search_result_row.dart +++ b/app/lib/features/search/ui/search_result_row.dart @@ -19,14 +19,12 @@ class SearchResultRow extends StatelessWidget { required this.hit, required this.query, required this.onOpen, - required this.cupertino, this.divider = true, }); final JsonMap hit; final String query; final ValueChanged onOpen; - final bool cupertino; final bool divider; @override @@ -35,7 +33,6 @@ class SearchResultRow extends StatelessWidget { final kind = '${hit['kind'] ?? ''}'; return AppListRow( key: ValueKey('search.result.${hit['target']}'), - cupertino: false, divider: divider, onTap: row.openable ? () => onOpen(hit) : null, leading: diff --git a/app/lib/features/search/ui/search_result_slivers.dart b/app/lib/features/search/ui/search_result_slivers.dart index 3c926426..7d4731fb 100644 --- a/app/lib/features/search/ui/search_result_slivers.dart +++ b/app/lib/features/search/ui/search_result_slivers.dart @@ -19,7 +19,6 @@ List searchResultSlivers({ required OmniSearchController controller, required String query, required ValueChanged onOpen, - required bool cupertino, required Widget Function(String message) message, }) { final chats = controller.shownChats; @@ -32,7 +31,6 @@ List searchResultSlivers({ hit: hits[index], query: query, onOpen: onOpen, - cupertino: false, divider: index < hits.length - 1, ), ); diff --git a/app/lib/features/settings/saved_server_editor.dart b/app/lib/features/settings/saved_server_editor.dart index 34c59871..fd88e248 100644 --- a/app/lib/features/settings/saved_server_editor.dart +++ b/app/lib/features/settings/saved_server_editor.dart @@ -25,9 +25,9 @@ Future editSavedServer( authenticator: authenticator, discovery: discovery ?? platformServerDiscovery(), ); - return Navigator.of(context).push( - MaterialPageRoute(builder: (_) => page), - ); + return Navigator.of( + context, + ).push(MaterialPageRoute(builder: (_) => page)); } class _ServerEditor extends StatefulWidget { @@ -200,9 +200,7 @@ class _ServerEditorState extends State<_ServerEditor> { liveRegion: true, child: Text( _error!, - style: TextStyle( - color: Theme.of(context).colorScheme.error, - ), + style: TextStyle(color: Theme.of(context).colorScheme.error), ), ), ), @@ -216,7 +214,7 @@ class _ServerEditorState extends State<_ServerEditor> { Widget _scaffold(String title, Widget body) => Scaffold( extendBodyBehindAppBar: true, - appBar: SegmentedBar(cupertino: false, title: title), + appBar: SegmentedBar(title: title), body: body, ); } diff --git a/app/lib/features/settings/settings_screen.dart b/app/lib/features/settings/settings_screen.dart index 463a8c4b..f63093ec 100644 --- a/app/lib/features/settings/settings_screen.dart +++ b/app/lib/features/settings/settings_screen.dart @@ -191,7 +191,7 @@ class _SettingsScreenState extends State { if (widget.embedded) return content; return Scaffold( extendBodyBehindAppBar: true, - appBar: const SegmentedBar(cupertino: false, title: 'Settings'), + appBar: const SegmentedBar(title: 'Settings'), body: content, ); } diff --git a/app/lib/features/templates/screen.dart b/app/lib/features/templates/screen.dart index 0620bf45..9c80ab1f 100644 --- a/app/lib/features/templates/screen.dart +++ b/app/lib/features/templates/screen.dart @@ -169,7 +169,6 @@ class _TemplatesScreenState extends State { context: context, template: template, repository: _repository, - cupertino: false, onCreated: (detail) => widget.onCreated?.call(detail), ), ); diff --git a/app/lib/features/templates/ui/template_create_controls.dart b/app/lib/features/templates/ui/template_create_controls.dart index 8dbfe8b5..02c9b4a9 100644 --- a/app/lib/features/templates/ui/template_create_controls.dart +++ b/app/lib/features/templates/ui/template_create_controls.dart @@ -6,15 +6,11 @@ import 'template_create_wording.dart'; class TemplateCreateNameField extends StatelessWidget { const TemplateCreateNameField({ super.key, - required this.cupertino, required this.controller, required this.enabled, required this.onSubmit, }); - /// Retained for callers that still pass it; the field is always the - /// Material one whether this is set or not. - final bool cupertino; final TextEditingController controller; final bool enabled; final VoidCallback onSubmit; @@ -42,7 +38,6 @@ class TemplateCreateNameField extends StatelessWidget { Widget templateCreateDialogAction({ required Key key, - required bool cupertino, required VoidCallback? onPressed, required Widget child, bool primary = false, diff --git a/app/lib/features/templates/ui/template_create_dialog.dart b/app/lib/features/templates/ui/template_create_dialog.dart index 324d1d0a..9f185dff 100644 --- a/app/lib/features/templates/ui/template_create_dialog.dart +++ b/app/lib/features/templates/ui/template_create_dialog.dart @@ -12,13 +12,11 @@ import 'template_create_controls.dart'; /// validate submits it create-only. A refusal keeps the typed name; an accepted /// `detail` is delivered through [onCreated] once. /// -/// [cupertino] is retained for callers that still pass it; the prompt is -/// always the Material dialog. +/// The prompt uses the shared Material dialog. Future showTemplateCreateDialog({ required BuildContext context, required TemplateEntry template, required TemplateRepository repository, - required bool cupertino, required ValueChanged onCreated, }) { final dialog = _TemplateCreateDialog( @@ -149,7 +147,6 @@ class _TemplateCreateDialogState extends State<_TemplateCreateDialog> { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ TemplateCreateNameField( - cupertino: false, controller: _name, enabled: _fieldEnabled, onSubmit: _create, @@ -187,7 +184,6 @@ class _TemplateCreateDialogState extends State<_TemplateCreateDialog> { ); final actions = [ templateCreateDialogAction( - cupertino: false, key: templateCreateCancelKey, onPressed: _sending ? null : _cancel, child: Text( @@ -197,7 +193,6 @@ class _TemplateCreateDialogState extends State<_TemplateCreateDialog> { ), ), templateCreateDialogAction( - cupertino: false, key: templateCreateConfirmKey, primary: true, onPressed: _canSubmit ? _create : null, diff --git a/app/lib/features/templates/ui/template_detail.dart b/app/lib/features/templates/ui/template_detail.dart index d8f41b6e..efd3c62c 100644 --- a/app/lib/features/templates/ui/template_detail.dart +++ b/app/lib/features/templates/ui/template_detail.dart @@ -145,12 +145,7 @@ class TemplateDetail extends StatelessWidget { Widget _backRow(BuildContext context) { // Only without a bar above: the same round Back the bar would show. final back = SegmentedPill( - cupertino: false, - child: SegmentedBackButton( - key: templateDetailBackKey, - cupertino: false, - onPressed: onBack, - ), + child: SegmentedBackButton(key: templateDetailBackKey, onPressed: onBack), ); return Padding( padding: const EdgeInsets.fromLTRB(12, 8, 16, 0), diff --git a/app/lib/features/templates/ui/template_gallery.dart b/app/lib/features/templates/ui/template_gallery.dart index 4032b832..e77091d1 100644 --- a/app/lib/features/templates/ui/template_gallery.dart +++ b/app/lib/features/templates/ui/template_gallery.dart @@ -113,7 +113,6 @@ class TemplateGallery extends StatelessWidget { return templatesColumn( AppListRow( key: templateRowKey(entry.key), - cupertino: false, divider: index < templates.length - 1, onTap: () => onOpen(entry.key), leading: ExcludeSemantics( diff --git a/app/lib/features/templates/ui/templates_frame.dart b/app/lib/features/templates/ui/templates_frame.dart index a678d69b..aed1f421 100644 --- a/app/lib/features/templates/ui/templates_frame.dart +++ b/app/lib/features/templates/ui/templates_frame.dart @@ -66,13 +66,8 @@ class TemplatesFrame extends StatelessWidget { ); } final bar = SegmentedBar( - cupertino: false, leading: canGoBack - ? SegmentedBackButton( - key: templatesBackKey, - cupertino: false, - onPressed: onBack, - ) + ? SegmentedBackButton(key: templatesBackKey, onPressed: onBack) : null, title: title, subtitle: subtitle, @@ -85,9 +80,7 @@ class TemplatesFrame extends StatelessWidget { Widget _refreshButton() => BarIconButton( key: templatesRefreshKey, - cupertino: false, icon: Icons.refresh, - cupertinoIcon: Icons.refresh, label: 'Refresh', onPressed: refreshing ? null : onRefresh, ); diff --git a/app/lib/features/terminal/terminal_surface.dart b/app/lib/features/terminal/terminal_surface.dart index 6a070b19..404d391a 100644 --- a/app/lib/features/terminal/terminal_surface.dart +++ b/app/lib/features/terminal/terminal_surface.dart @@ -31,7 +31,6 @@ class TerminalSurface extends StatefulWidget { super.key, required this.hub, required this.layout, - this.cupertino, required this.child, this.shortcutHere = true, this.windows, @@ -41,8 +40,6 @@ class TerminalSurface extends StatefulWidget { final TerminalHub hub; final TerminalLayout layout; - /// Kept for callers migrating from the former alternate host; ignored. - final bool? cupertino; final Widget child; /// Whether the current page offers the phone shortcut to reopen the diff --git a/app/lib/features/terminal/terminal_toggle_button.dart b/app/lib/features/terminal/terminal_toggle_button.dart index 6adbd880..104fd351 100644 --- a/app/lib/features/terminal/terminal_toggle_button.dart +++ b/app/lib/features/terminal/terminal_toggle_button.dart @@ -7,13 +7,10 @@ import 'terminal_shortcuts.dart'; /// The shell bar's Terminal button: shows or hides the terminal (also /// Alt+T, Ctrl+T, Cmd+T and Ctrl+`, where the platform delivers them). class TerminalToggleButton extends StatelessWidget { - const TerminalToggleButton({super.key, required this.layout, this.cupertino}); + const TerminalToggleButton({super.key, required this.layout}); final TerminalLayout layout; - /// Kept for callers migrating from the former alternate host; ignored. - final bool? cupertino; - /// The tooltip, naming the platform's most convenient shortcut. static String get label => TerminalShortcutLabels.current().button; diff --git a/app/lib/features/updates/launch_update_dialog.dart b/app/lib/features/updates/launch_update_dialog.dart index 78c9ad25..34acbf64 100644 --- a/app/lib/features/updates/launch_update_dialog.dart +++ b/app/lib/features/updates/launch_update_dialog.dart @@ -6,7 +6,6 @@ import 'launch_update.dart'; Future showLaunchUpdateDialog( BuildContext context, { required bool web, - required bool cupertino, String sourceName = '', String nativePlatform = 'android', }) => showDialog( @@ -45,11 +44,7 @@ Future showLaunchUpdateDialog( ), ); -Future showLaunchUpdateFailure( - BuildContext context, - Object error, { - required bool cupertino, -}) async { +Future showLaunchUpdateFailure(BuildContext context, Object error) async { await showDialog( context: context, builder: (context) => AlertDialog( @@ -70,7 +65,6 @@ Future installLaunchUpdate( BuildContext context, AppUpdate update, { required UpdateInstaller installer, - required bool cupertino, }) async { final result = await showDialog<_InstallResult>( context: context, diff --git a/app/lib/shell/adaptive_shell.dart b/app/lib/shell/adaptive_shell.dart index 00727af8..53ec95f7 100644 --- a/app/lib/shell/adaptive_shell.dart +++ b/app/lib/shell/adaptive_shell.dart @@ -18,7 +18,6 @@ class AdaptiveShell extends StatefulWidget { const AdaptiveShell({ super.key, this.destinationBodies = const {}, - this.cupertino = false, this.destination, this.onDestinationSelected, this.onClosePage, @@ -37,9 +36,6 @@ class AdaptiveShell extends StatefulWidget { final Map destinationBodies; - /// Retained for callers that still pass it; the shell always draws Material. - final bool cupertino; - /// The destination a route owner selected. When null the shell keeps its own /// selection, which preserves the plain-shell tests and native composition. final AppDestination? destination; @@ -121,7 +117,6 @@ class _AdaptiveShellState extends State { key: const ValueKey('shell.badge.chat.unread'), count: _bar.badge(destination, ShellBadgeKind.unread), label: 'unread chats', - cupertino: false, child: icon, ); } @@ -131,12 +126,10 @@ class _AdaptiveShellState extends State { final attention = widget.attentionCount > 0; return AttentionDestinationIcon( count: widget.attentionCount, - cupertino: false, child: ActivityBadge( key: const ValueKey('shell.badge.runs.running'), count: attention ? 0 : _bar.badge(destination, ShellBadgeKind.running), label: 'runs in progress', - cupertino: false, child: icon, ), ); @@ -203,7 +196,6 @@ class _AdaptiveShellState extends State { alignment: AlignmentDirectional.bottomStart, child: FloatingDestinationBar( showLabels: true, - cupertino: false, currentIndex: index, onTap: (value) => _select(shellTabDestinations[value]), items: _destinationItems(), @@ -351,13 +343,11 @@ class _AdaptiveShellState extends State { final published = spec?.actions ?? const []; final onSearch = widget.onSearch; return SegmentedBar( - cupertino: false, automaticallyImplyLeading: false, leading: onBack == null ? null : SegmentedBackButton( key: const ValueKey('shell.back'), - cupertino: false, onPressed: onBack, ), title: spec?.title ?? label, diff --git a/app/lib/shell/attention_badge.dart b/app/lib/shell/attention_badge.dart index 207871da..68f5369e 100644 --- a/app/lib/shell/attention_badge.dart +++ b/app/lib/shell/attention_badge.dart @@ -14,15 +14,11 @@ class AttentionDestinationIcon extends StatelessWidget { const AttentionDestinationIcon({ super.key, required this.count, - this.cupertino = false, required this.child, }); final int count; - /// Retained for callers that still pass it; the icon is always the Material - /// [Badge] whether this is set or not. - final bool cupertino; final Widget child; @override @@ -55,7 +51,6 @@ class ActivityBadge extends StatelessWidget { super.key, required this.count, required this.label, - this.cupertino = false, required this.child, this.bottom = false, }); @@ -63,9 +58,6 @@ class ActivityBadge extends StatelessWidget { final int count; final String label; - /// Retained for callers that still pass it; the badge uses the Material - /// theme colours whether this is set or not. - final bool cupertino; final bool bottom; final Widget child; diff --git a/app/lib/shell/destination.dart b/app/lib/shell/destination.dart index 72a6766b..a62eb13e 100644 --- a/app/lib/shell/destination.dart +++ b/app/lib/shell/destination.dart @@ -21,32 +21,17 @@ AppDestination shellTabFor(AppDestination destination) => /// The label and icons for [value]. /// -({String label, IconData icon, IconData cupertinoIcon}) destinationDetails( - AppDestination value, -) => switch (value) { - AppDestination.pipelines => ( - label: 'Pipelines', - icon: Icons.account_tree_outlined, - cupertinoIcon: Icons.account_tree_outlined, - ), - AppDestination.runs => ( - label: 'Runs', - icon: Icons.play_circle_outline, - cupertinoIcon: Icons.play_circle_outline, - ), - AppDestination.chat => ( - label: 'Chat', - icon: Icons.chat_bubble_outline, - cupertinoIcon: Icons.chat_bubble_outline, - ), - AppDestination.search => ( - label: 'Search', - icon: Icons.search, - cupertinoIcon: Icons.search, - ), - AppDestination.settings => ( - label: 'Settings', - icon: Icons.settings_outlined, - cupertinoIcon: Icons.settings_outlined, - ), -}; +({String label, IconData icon}) destinationDetails(AppDestination value) => + switch (value) { + AppDestination.pipelines => ( + label: 'Pipelines', + icon: Icons.account_tree_outlined, + ), + AppDestination.runs => (label: 'Runs', icon: Icons.play_circle_outline), + AppDestination.chat => (label: 'Chat', icon: Icons.chat_bubble_outline), + AppDestination.search => (label: 'Search', icon: Icons.search), + AppDestination.settings => ( + label: 'Settings', + icon: Icons.settings_outlined, + ), + }; diff --git a/app/lib/shell/detail_page.dart b/app/lib/shell/detail_page.dart index 375f2aae..4bfae210 100644 --- a/app/lib/shell/detail_page.dart +++ b/app/lib/shell/detail_page.dart @@ -94,7 +94,6 @@ PageRoute detailPageRoute( if (growFrom != null) { return ContainerTransformPageRoute( link: growFrom, - cupertino: false, builder: (_) => page, ); } @@ -149,7 +148,6 @@ class _DetailPaneState extends State { final bar = barless ? null : SegmentedBar( - cupertino: false, automaticallyImplyLeading: widget.implyBack, title: title, subtitle: spec?.subtitle, diff --git a/app/lib/shell/shell_destination_menu.dart b/app/lib/shell/shell_destination_menu.dart index 04b13daa..9b3e436d 100644 --- a/app/lib/shell/shell_destination_menu.dart +++ b/app/lib/shell/shell_destination_menu.dart @@ -5,14 +5,10 @@ import 'destination.dart'; class ShellDestinationMenu extends StatelessWidget { const ShellDestinationMenu({ super.key, - required this.cupertino, required this.current, required this.onSelected, }); - /// Retained for callers that still pass it; the menu is always the Material - /// popup whether this is set or not. - final bool cupertino; final AppDestination current; final ValueChanged onSelected; diff --git a/app/lib/ui/adaptive/floating_destination_bar.dart b/app/lib/ui/adaptive/floating_destination_bar.dart index 1f534470..5e230c41 100644 --- a/app/lib/ui/adaptive/floating_destination_bar.dart +++ b/app/lib/ui/adaptive/floating_destination_bar.dart @@ -29,12 +29,10 @@ import 'floating_destination_labels.dart'; /// visible, scalable captions. Each tab's label stays its accessible name /// (and the Material tooltip), announced as a selectable tab with "tab n of /// m" the way the platform navigation controls announce theirs (see -/// [FloatingTabButton]); the icons must be distinct within a bar. The -/// Cupertino path builds no Material widget. +/// [FloatingTabButton]); the icons must be distinct within a bar. class FloatingDestinationBar extends StatefulWidget { const FloatingDestinationBar({ super.key, - required this.cupertino, required this.currentIndex, required this.onTap, required this.items, @@ -43,8 +41,6 @@ class FloatingDestinationBar extends StatefulWidget { this.showLabels = false, }); - final bool cupertino; - /// Main app navigation keeps names visible; dense page tabs can stay icons. final bool showLabels; @@ -63,15 +59,12 @@ class FloatingDestinationBar extends StatefulWidget { /// The icon size inside each button, as in the host navigation controls. static const double materialIconSize = 28; - static const double cupertinoIconSize = 30; /// The diameter of each tab button, which is also the bar's height. static const double materialButtonSize = 52; - static const double cupertinoButtonSize = 50; /// The gap between neighbouring buttons. static const double materialButtonGap = 12; - static const double cupertinoButtonGap = 10; /// The side margin at [FloatingBarEdge.top], matching the top bar's own. static const double topMargin = 12; @@ -79,28 +72,23 @@ class FloatingDestinationBar extends StatefulWidget { /// The row of buttons inside each bar, for tests and measurement. static const Key rowKey = ValueKey('floating-destination-bar.row'); - static double buttonSize({required bool cupertino}) => - cupertino ? cupertinoButtonSize : materialButtonSize; + static double buttonSize() => materialButtonSize; - static double buttonGap({required bool cupertino}) => - cupertino ? cupertinoButtonGap : materialButtonGap; + static double buttonGap() => materialButtonGap; /// The selected button's size, about [Motion.tabSelectedScale] times the /// others (whole pixels, so layout stays exact). static const double materialSelectedButtonSize = 62; - static const double cupertinoSelectedButtonSize = 60; - static double selectedButtonSize({required bool cupertino}) => - cupertino ? cupertinoSelectedButtonSize : materialSelectedButtonSize; + static double selectedButtonSize() => materialSelectedButtonSize; /// The width of a row of [tabs] buttons (one of them selected), when the /// space allows it. - static double rowWidth({required bool cupertino, required int tabs}) => - tabs == 0 + static double rowWidth({required int tabs}) => tabs == 0 ? 0 - : buttonSize(cupertino: cupertino) * (tabs - 1) + - selectedButtonSize(cupertino: cupertino) + - buttonGap(cupertino: cupertino) * math.max(0, tabs - 1); + : buttonSize() * (tabs - 1) + + selectedButtonSize() + + buttonGap() * math.max(0, tabs - 1); @override State createState() => _FloatingDestinationBarState(); @@ -112,7 +100,6 @@ class _FloatingDestinationBarState extends State final _backdrop = BackdropKey(); bool _entered = false; - bool get cupertino => widget.cupertino; List get items => widget.items; int get currentIndex => widget.currentIndex; @@ -144,9 +131,8 @@ class _FloatingDestinationBarState extends State static String _tabSetIdentity(List items) => items.map((item) => '${item.key ?? item.label}:${item.label}').join('|'); - double get _size => FloatingDestinationBar.buttonSize(cupertino: cupertino); - double get _selectedSize => - FloatingDestinationBar.selectedButtonSize(cupertino: cupertino); + double get _size => FloatingDestinationBar.buttonSize(); + double get _selectedSize => FloatingDestinationBar.selectedButtonSize(); /// The buttons' natural width side by side, the selected one larger. double get _buttonsWidth => @@ -194,7 +180,7 @@ class _FloatingDestinationBarState extends State /// The gap between neighbouring buttons in [width]: the named one, or less /// in a row squeezed below its natural width. double _gap(double width) { - final gap = FloatingDestinationBar.buttonGap(cupertino: cupertino); + final gap = FloatingDestinationBar.buttonGap(); final count = items.length; if (count < 2 || !width.isFinite) return gap; return (width - _buttonsWidth).clamp(0.0, gap * (count - 1)) / (count - 1); @@ -204,7 +190,6 @@ class _FloatingDestinationBarState extends State if (widget.showLabels) { return FloatingDestinationLabels( key: FloatingDestinationBar.rowKey, - cupertino: cupertino, labels: [for (final item in items) item.label], selected: currentIndex, buttonBuilder: (index) => _button(context, index), @@ -243,15 +228,13 @@ class _FloatingDestinationBarState extends State ); // The bar does not scale with text (its icons do not either); a badge // count keeps its size. - return cupertino ? MediaQuery.withNoTextScaling(child: row) : row; + return row; } Widget _button(BuildContext context, int index) { final item = items[index]; final selected = index == currentIndex; - final iconSize = cupertino - ? FloatingDestinationBar.cupertinoIconSize - : FloatingDestinationBar.materialIconSize; + final iconSize = FloatingDestinationBar.materialIconSize; // The selected button grows (and a deselected one shrinks back) in the // layout, so its neighbours move over and keep their gaps. return FloatingTabEntrance( @@ -263,7 +246,6 @@ class _FloatingDestinationBarState extends State curve: Motion.curve, builder: (context, size, _) => FloatingTabButton( key: item.key, - cupertino: cupertino, motion: _motion, index: index, count: items.length, diff --git a/app/lib/ui/adaptive/floating_destination_labels.dart b/app/lib/ui/adaptive/floating_destination_labels.dart index 192b7b6f..10e33bc0 100644 --- a/app/lib/ui/adaptive/floating_destination_labels.dart +++ b/app/lib/ui/adaptive/floating_destination_labels.dart @@ -6,13 +6,11 @@ import 'package:flutter/material.dart'; class FloatingDestinationLabels extends StatelessWidget { const FloatingDestinationLabels({ super.key, - required this.cupertino, required this.labels, required this.selected, required this.buttonBuilder, required this.onTap, }); - final bool cupertino; final List labels; final int selected; final Widget Function(int) buttonBuilder; diff --git a/app/lib/ui/adaptive/floating_tab_button.dart b/app/lib/ui/adaptive/floating_tab_button.dart index 62629a4d..9575e58a 100644 --- a/app/lib/ui/adaptive/floating_tab_button.dart +++ b/app/lib/ui/adaptive/floating_tab_button.dart @@ -11,21 +11,19 @@ import 'segmented_bar_motion.dart'; /// One tab of a floating tab bar: a round [GlassPill] of [size] with the /// tab's icon in the middle. /// -/// The selected tab fills its circle with the host's selection tint -/// (Material `secondaryContainer`, Cupertino active colour at -/// [cupertinoTintOpacity]) and draws its icon in the selected colour; the +/// The selected tab fills its circle with Material `secondaryContainer` +/// and draws its icon in the selected colour; the /// tint and colour cross-fade when the selection moves. A press sinks the /// button ([SegmentedPress]), the Material one with its circular ink. /// /// It is announced like the host navigation controls' tabs: a tab (and a /// button) named by [label], with its selected state and "tab n of m" -/// (in the Material label, or the Cupertino hint). Material shows [label] +/// in its accessible label. Material shows [label] /// as a tooltip. The icon is painted above the glass, unclipped, so a badge /// on its corner can reach past the circle. class FloatingTabButton extends StatelessWidget { const FloatingTabButton({ super.key, - required this.cupertino, required this.motion, required this.index, required this.count, @@ -37,7 +35,6 @@ class FloatingTabButton extends StatelessWidget { required this.onTap, }); - final bool cupertino; final FloatingTabMotion motion; final int index; final int count; @@ -50,11 +47,7 @@ class FloatingTabButton extends StatelessWidget { final Widget icon; final VoidCallback onTap; - /// The Cupertino selection fill: the active colour at this opacity. - static const double cupertinoTintOpacity = 0.18; - - /// The selection fill inside each button (an [Ink] on Material, a - /// [DecoratedBox] on Cupertino), for tests. + /// The selection [Ink] inside each button, for tests. static const Key fillKey = ValueKey('floating-tab-button.fill'); @override @@ -135,7 +128,6 @@ class FloatingTabButton extends StatelessWidget { ); } return SegmentedPress( - cupertino: cupertino, child: SizedBox.square( dimension: size, child: Stack( @@ -143,11 +135,7 @@ class FloatingTabButton extends StatelessWidget { alignment: Alignment.center, children: [ Positioned.fill( - child: GlassPill( - cupertino: cupertino, - shape: const CircleBorder(), - child: fill, - ), + child: GlassPill(shape: const CircleBorder(), child: fill), ), IgnorePointer(child: glyph), ], diff --git a/app/lib/ui/adaptive/glass_bar.dart b/app/lib/ui/adaptive/glass_bar.dart index 8a098e53..8ceb5144 100644 --- a/app/lib/ui/adaptive/glass_bar.dart +++ b/app/lib/ui/adaptive/glass_bar.dart @@ -19,48 +19,35 @@ abstract final class GlassBarMetrics { static const double fieldEdgeGap = 4; /// The square target of one control: the platform's minimum touch target. - static double controlExtent(bool cupertino) => kMinInteractiveDimension; + static double controlExtent() => kMinInteractiveDimension; /// The icon drawn inside a control's target. - static double iconSize(bool cupertino) => 28; + static double iconSize() => 28; /// The space between a control's icon and the edge of its target. - static double iconInset(bool cupertino) => - (controlExtent(cupertino) - iconSize(cupertino)) / 2; + static double iconInset() => (controlExtent() - iconSize()) / 2; /// The visible circle of a filled control (Send) inside its target: the - /// Material filled icon button's 40 in 48, and the same inset on Cupertino. - static double filledExtent(bool cupertino) => controlExtent(cupertino) - 8; + /// Material filled icon button's 40 in 48. + static double filledExtent() => controlExtent() - 8; /// The pill's height around one row of controls. - static double height(bool cupertino) => - controlExtent(cupertino) + 2 * edgeGap; + static double height() => controlExtent() + 2 * edgeGap; /// The Material target constraints of one control. - static BoxConstraints materialConstraints() => BoxConstraints( - minWidth: controlExtent(false), - minHeight: controlExtent(false), - ); - - /// Compatibility helper for callers still passing the old control family. - static Size cupertinoMinimumSize() => Size.square(controlExtent(false)); + static BoxConstraints materialConstraints() => + BoxConstraints(minWidth: controlExtent(), minHeight: controlExtent()); } /// A [GlassPill] padded by [GlassBarMetrics.edgeGap] on every side around /// [child], a row of controls each [GlassBarMetrics.controlExtent] tall. class GlassControlBar extends StatelessWidget { - const GlassControlBar({ - super.key, - required this.cupertino, - required this.child, - }); + const GlassControlBar({super.key, required this.child}); - final bool cupertino; final Widget child; @override Widget build(BuildContext context) => GlassPill( - cupertino: cupertino, child: Padding( padding: const EdgeInsets.all(GlassBarMetrics.edgeGap), child: child, diff --git a/app/lib/ui/adaptive/glass_pill.dart b/app/lib/ui/adaptive/glass_pill.dart index fece49a1..98b9d89f 100644 --- a/app/lib/ui/adaptive/glass_pill.dart +++ b/app/lib/ui/adaptive/glass_pill.dart @@ -4,14 +4,13 @@ import 'glass_surface.dart'; /// A frosted-glass piece floating over content: the content behind is /// blurred and its colour lifted inside the piece's [shape], under a -/// translucent fill in the host's raised surface role (Material -/// `surfaceContainerHigh`, Cupertino `systemGrey5`), a soft highlight along +/// translucent fill in Material `surfaceContainerHigh`, a soft highlight along /// its top, a faint rim over a hairline border, and a soft shadow /// outside it ([GlassLook], tuned for light and dark fills). /// /// Under the system's high-contrast setting the fill is solid, nothing is -/// blurred and only the hairline border is drawn. The Cupertino piece uses -/// no Material widget; the Material piece is a transparent [Material] so ink +/// blurred and only the hairline border is drawn. A transparent [Material] +/// lets ink /// responses inside it show. /// /// Shared by the segmented top bar and any floating bar (a tab bar) that @@ -19,13 +18,11 @@ import 'glass_surface.dart'; class GlassPill extends StatelessWidget { const GlassPill({ super.key, - required this.cupertino, required this.child, this.shape = const StadiumBorder(), this.fill, }); - final bool cupertino; final Widget child; final OutlinedBorder shape; diff --git a/app/lib/ui/adaptive/host.dart b/app/lib/ui/adaptive/host.dart deleted file mode 100644 index 80f68825..00000000 --- a/app/lib/ui/adaptive/host.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:flutter/material.dart'; - -/// Whether the nearest app host is a Cupertino one. -/// -/// A `CupertinoApp` supplies Cupertino localizations only, while `MaterialApp` -/// supplies [MaterialLocalizations]. Checking the host avoids guessing from a -/// desktop browser's target platform and keeps one answer for every control. -bool usesCupertinoHost(BuildContext context) => - Localizations.of(context, MaterialLocalizations) == - null; diff --git a/app/lib/ui/adaptive/platform.dart b/app/lib/ui/adaptive/platform.dart index 5ef017a5..e628746e 100644 --- a/app/lib/ui/adaptive/platform.dart +++ b/app/lib/ui/adaptive/platform.dart @@ -1,15 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -/// The app renders the same Material layout and design on every platform: -/// web, Android, iOS and macOS. The Cupertino host and controls remain -/// available only when a caller asks for them explicitly (`cupertino: true`); -/// they are never chosen from the target platform. -/// -/// Flutter's automatic platform behaviours (scroll physics, text selection, -/// page transitions and back-swipe) still follow the target platform. -bool prefersCupertino() => false; - /// Whether this runs on a desktop platform (macOS, Linux, Windows), /// including a desktop browser. Hover and click targets there hug their /// content; phones and tablets keep full-width touch rows. Uses the device's diff --git a/app/lib/ui/adaptive/segmented_bar.dart b/app/lib/ui/adaptive/segmented_bar.dart index 5e0a30a3..499c297a 100644 --- a/app/lib/ui/adaptive/segmented_bar.dart +++ b/app/lib/ui/adaptive/segmented_bar.dart @@ -1,6 +1,5 @@ import 'dart:math' as math; -import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -40,18 +39,15 @@ export 'segmented_bar_pieces.dart' show SegmentedBackButton, SegmentedPill; /// the leading piece (up to the widget's own width cap), with no title. /// /// Only the pieces take taps: a tap between them reaches the content behind. -/// It works as a [Scaffold.appBar] (with `extendBodyBehindAppBar`) and a -/// [CupertinoPageScaffold.navigationBar], which inset the content by the +/// It works as a [Scaffold.appBar] (with `extendBodyBehindAppBar`), which insets content by the /// bar's height through [MediaQuery.paddingOf], so a page keeps its /// scaffold's structure; [SegmentedBarOverlay] does the same anywhere else. /// It handles the top safe area itself, keeps its pieces clear of the /// system's window controls ([WindowControlsClearance]), and on a wide window /// keeps the wider [WindowMargins] from the top and the sides. -class SegmentedBar extends StatefulWidget - implements ObstructingPreferredSizeWidget { +class SegmentedBar extends StatefulWidget implements PreferredSizeWidget { const SegmentedBar({ super.key, - required this.cupertino, required this.title, this.titleWidget, this.titleWidgetMaxWidth = double.infinity, @@ -75,11 +71,6 @@ class SegmentedBar extends StatefulWidget this.backdrop, }); - /// Which control family to draw. Required because the bar's reserved - /// height differs: a Cupertino navigation bar never scales its text, so it - /// reserves exactly its height, while a Material app bar grows with text. - final bool cupertino; - /// The title; empty shows no title pill unless there is a [subtitle]. final String title; @@ -160,35 +151,16 @@ class SegmentedBar extends StatefulWidget @override Size get preferredSize { - final piece = segmentedPieceHeight(cupertino); - if (cupertino) { - // CupertinoPageScaffold disables text scaling for its navigation bar - // and reserves exactly this height for it. - return Size.fromHeight(_topPadding + piece + bottomPadding); - } + final piece = segmentedPieceHeight(); // A Material scaffold only caps its app bar at this height and lets it // size to its content: room for a title and subtitle at the largest // text scale. return Size.fromHeight(_topPadding + piece * maxTextScale + bottomPadding); } - @override - // Content scrolls behind the bar; the scaffold insets it by the bar's - // height through the media padding instead. - bool shouldFullyObstruct(BuildContext context) => false; - Color _background(BuildContext context) { if (backgroundColor case final color?) { - // A dynamic system colour (the grouped background) follows the theme. - return CupertinoDynamicColor.maybeResolve(color, context) ?? color; - } - if (cupertino) { - return context - .dependOnInheritedWidgetOfExactType< - CupertinoPageScaffoldBackgroundColor - >() - ?.color ?? - CupertinoTheme.of(context).scaffoldBackgroundColor; + return color; } return Scaffold.maybeOf(context)?.widget.backgroundColor ?? Theme.of(context).scaffoldBackgroundColor; @@ -252,7 +224,6 @@ class _SegmentedBarState extends State { return ConstrainedBox( constraints: BoxConstraints(maxWidth: widget.titleWidgetMaxWidth), child: SegmentedPill( - cupertino: widget.cupertino, fill: widget.pillColor, child: SizedBox(width: double.infinity, child: titleWidget), ), @@ -312,7 +283,6 @@ class _SegmentedBarState extends State { List actions, List ids, List entrances, { - required bool cupertino, required double overflowWidth, }) { final entries = [ @@ -329,9 +299,8 @@ class _SegmentedBarState extends State { more: ExcludeFocus( excluding: entries.isEmpty, child: SegmentedPress( - cupertino: cupertino, tint: widget.foregroundColor, - child: SegmentedMoreButton(cupertino: cupertino, entries: entries), + child: SegmentedMoreButton(entries: entries), ), ), actions: [ @@ -344,7 +313,6 @@ class _SegmentedBarState extends State { delay: entrances[index].delay, glass: false, child: SegmentedPress( - cupertino: cupertino, tint: widget.foregroundColor, enabled: actions.length > 1, child: widget.separateActionIslands @@ -353,7 +321,6 @@ class _SegmentedBarState extends State { start: index == 0 ? 0 : 8, ), child: SegmentedPill( - cupertino: cupertino, fill: widget.pillColor, child: action, ), @@ -366,17 +333,13 @@ class _SegmentedBarState extends State { ); } - Widget _actionsIsland({ - required bool cupertino, - Color? fill, - required Widget child, - }) => widget.separateActionIslands + Widget _actionsIsland({Color? fill, required Widget child}) => + widget.separateActionIslands ? child - : SegmentedPill(cupertino: cupertino, fill: fill, child: child); + : SegmentedPill(fill: fill, child: child); @override Widget build(BuildContext context) { - final cupertino = widget.cupertino; final title = widget.title; final titleWidget = widget.titleWidget; final leadingWidget = widget.leading; @@ -392,12 +355,9 @@ class _SegmentedBarState extends State { final bottomPadding = widget.bottomPadding; final leading = leadingWidget ?? - (automaticallyImplyLeading - ? impliedSegmentedLeading(context, cupertino) - : null); + (automaticallyImplyLeading ? impliedSegmentedLeading(context) : null); final showTitle = title.isNotEmpty || (subtitle ?? '').isNotEmpty; Widget titlePill(bool expanded) => SegmentedTitlePill( - cupertino: cupertino, title: title, subtitle: subtitle, subtitleIcon: subtitleIcon, @@ -437,7 +397,6 @@ class _SegmentedBarState extends State { math.min( segmentedTitleWidth( context, - cupertino: cupertino, title: title, subtitle: subtitle, subtitleIcon: subtitleIcon, @@ -450,9 +409,7 @@ class _SegmentedBarState extends State { ? .10 : SegmentedBar.minTitleShare; final besideTitle = - width - - (leading == null ? 0 : segmentedPieceHeight(cupertino) + 8) - - 8; + width - (leading == null ? 0 : segmentedPieceHeight() + 8) - 8; // Actions that cannot move (a model picker) may take the room down // to the title's minimum share; the rest leave for the More menu // before the title goes under its own width. @@ -468,13 +425,8 @@ class _SegmentedBarState extends State { key: const ValueKey('segmented.leading'), delay: entrances.leading, child: SegmentedPress( - cupertino: cupertino, tint: foregroundColor, - child: SegmentedPill( - cupertino: cupertino, - fill: pillColor, - child: leading, - ), + child: SegmentedPill(fill: pillColor, child: leading), ), ), const SizedBox(width: 8), @@ -508,17 +460,14 @@ class _SegmentedBarState extends State { // A lone action is the whole pill, so the pill sinks when it // is pressed; beside others, each action sinks on its own. child: SegmentedPress( - cupertino: cupertino, tint: foregroundColor, enabled: actions.length == 1, child: _actionsIsland( - cupertino: cupertino, fill: pillColor, child: _actionRow( actions, actionIds, entrances.actions, - cupertino: cupertino, overflowWidth: overflowWidth, ), ), diff --git a/app/lib/ui/adaptive/segmented_bar_motion.dart b/app/lib/ui/adaptive/segmented_bar_motion.dart index 77d4d07d..e0833089 100644 --- a/app/lib/ui/adaptive/segmented_bar_motion.dart +++ b/app/lib/ui/adaptive/segmented_bar_motion.dart @@ -9,7 +9,7 @@ import '../motion/motion.dart'; /// back. /// /// It only listens: the control below still takes the tap, and its own -/// feedback (an ink ripple, a Cupertino button's dimming) still shows. A +/// feedback (an ink ripple) still shows. A /// quick tap plays the whole press before springing back, so it is seen. /// Under reduced motion only the tint shows. When [enabled] is false it does /// nothing, so a bar can switch a piece's feedback on and off without @@ -17,13 +17,11 @@ import '../motion/motion.dart'; class SegmentedPress extends StatefulWidget { const SegmentedPress({ super.key, - required this.cupertino, required this.child, this.enabled = true, this.tint, }); - final bool cupertino; final Widget child; final bool enabled; diff --git a/app/lib/ui/adaptive/segmented_bar_overflow.dart b/app/lib/ui/adaptive/segmented_bar_overflow.dart index 807d5974..203673ca 100644 --- a/app/lib/ui/adaptive/segmented_bar_overflow.dart +++ b/app/lib/ui/adaptive/segmented_bar_overflow.dart @@ -5,8 +5,7 @@ import 'package:flutter/material.dart'; /// all fit. const segmentedMoreKey = ValueKey('segmented.more'); -/// One choice under a [SegmentedOverflowEntry] (a sort order): a submenu on -/// Material, a second action sheet on Cupertino. +/// One choice under a [SegmentedOverflowEntry] (a sort order): a Material submenu. class SegmentedMenuChoice { const SegmentedMenuChoice({ required this.label, @@ -69,15 +68,10 @@ class SegmentedOverflowAction extends StatelessWidget } /// The bar's More button: the host's overflow icon at the platform's touch -/// target, opening a Material menu or a Cupertino action sheet of [entries]. +/// target, opening a Material menu of [entries]. class SegmentedMoreButton extends StatelessWidget { - const SegmentedMoreButton({ - super.key, - required this.cupertino, - required this.entries, - }); + const SegmentedMoreButton({super.key, required this.entries}); - final bool cupertino; final List entries; static const String label = 'More actions'; diff --git a/app/lib/ui/adaptive/segmented_bar_pieces.dart b/app/lib/ui/adaptive/segmented_bar_pieces.dart index 0f770039..9e6952af 100644 --- a/app/lib/ui/adaptive/segmented_bar_pieces.dart +++ b/app/lib/ui/adaptive/segmented_bar_pieces.dart @@ -5,19 +5,13 @@ import 'segmented_bar_motion.dart'; /// The smallest height of every piece of a [SegmentedBar]: the platform's /// minimum touch target, so a round Back is a circle. -double segmentedPieceHeight(bool cupertino) => kMinInteractiveDimension; +double segmentedPieceHeight() => kMinInteractiveDimension; /// One rounded piece of a segmented bar: a [GlassPill] at least the /// platform's touch-target size. class SegmentedPill extends StatelessWidget { - const SegmentedPill({ - super.key, - required this.cupertino, - required this.child, - this.fill, - }); + const SegmentedPill({super.key, required this.child, this.fill}); - final bool cupertino; final Widget child; /// Overrides the fill (a dark viewer's pieces). @@ -25,10 +19,9 @@ class SegmentedPill extends StatelessWidget { @override Widget build(BuildContext context) { - final height = segmentedPieceHeight(cupertino); + final height = segmentedPieceHeight(); // A stadium whose content is as wide as it is tall is a circle. return GlassPill( - cupertino: cupertino, fill: fill, child: ConstrainedBox( // The minimum reaches the content, so a pressable piece is pressable @@ -43,13 +36,8 @@ class SegmentedPill extends StatelessWidget { /// The app's Material Back button for a segmented bar. A null [onPressed] keeps the /// stock action (pop the route). class SegmentedBackButton extends StatelessWidget { - const SegmentedBackButton({ - super.key, - required this.cupertino, - this.onPressed, - }); + const SegmentedBackButton({super.key, this.onPressed}); - final bool cupertino; final VoidCallback? onPressed; @override @@ -59,7 +47,7 @@ class SegmentedBackButton extends StatelessWidget { /// What a bar implies on the leading edge when the page gave none, matching /// the stock bars: Back on a route that can go back, the platform's close /// control on a full-screen dialog, nothing on a root page. -Widget? impliedSegmentedLeading(BuildContext context, bool cupertino) { +Widget? impliedSegmentedLeading(BuildContext context) { final route = ModalRoute.of(context); if (route == null) return null; final dialog = route is PageRoute && route.fullscreenDialog; @@ -70,7 +58,6 @@ Widget? impliedSegmentedLeading(BuildContext context, bool cupertino) { /// The title pill's title and subtitle styles, from the host's type scale. (TextStyle, TextStyle) segmentedTitleStyles( BuildContext context, { - required bool cupertino, Color? foreground, }) { final theme = Theme.of(context); @@ -92,7 +79,6 @@ const double segmentedTitlePadding = 16; /// the text scale at [context]). double segmentedTitleWidth( BuildContext context, { - required bool cupertino, required String title, String? subtitle, IconData? subtitleIcon, @@ -100,7 +86,6 @@ double segmentedTitleWidth( }) { final (titleStyle, subtitleStyle) = segmentedTitleStyles( context, - cupertino: cupertino, foreground: foreground, ); final scaler = MediaQuery.textScalerOf(context); @@ -136,7 +121,6 @@ double segmentedTitleWidth( class SegmentedTitlePill extends StatelessWidget { const SegmentedTitlePill({ super.key, - required this.cupertino, required this.title, this.subtitle, this.subtitleIcon, @@ -150,7 +134,6 @@ class SegmentedTitlePill extends StatelessWidget { this.fill, }); - final bool cupertino; final String title; final String? subtitle; final IconData? subtitleIcon; @@ -169,7 +152,6 @@ class SegmentedTitlePill extends StatelessWidget { Widget build(BuildContext context) { final (titleStyle, subtitleStyle) = segmentedTitleStyles( context, - cupertino: cupertino, foreground: foreground, ); final subtitle = this.subtitle ?? ''; @@ -258,7 +240,6 @@ class SegmentedTitlePill extends StatelessWidget { // title and the action each give their own feedback. final split = titleAction != null; final pill = SegmentedPill( - cupertino: cupertino, fill: fill, child: Row( mainAxisSize: MainAxisSize.min, @@ -267,24 +248,16 @@ class SegmentedTitlePill extends StatelessWidget { fit: FlexFit.loose, child: IntrinsicWidth( child: split && onPressed != null - ? SegmentedPress( - cupertino: cupertino, - tint: foreground, - child: body, - ) + ? SegmentedPress(tint: foreground, child: body) : body, ), ), if (titleAction != null) - SegmentedPress( - cupertino: cupertino, - tint: foreground, - child: titleAction, - ), + SegmentedPress(tint: foreground, child: titleAction), ], ), ); if (split || onPressed == null) return pill; - return SegmentedPress(cupertino: cupertino, tint: foreground, child: pill); + return SegmentedPress(tint: foreground, child: pill); } } diff --git a/app/lib/ui/adaptive/top_glass_strip.dart b/app/lib/ui/adaptive/top_glass_strip.dart index 00805d76..51441cc0 100644 --- a/app/lib/ui/adaptive/top_glass_strip.dart +++ b/app/lib/ui/adaptive/top_glass_strip.dart @@ -18,13 +18,11 @@ const double kTopGlassStripRadius = 22; class TopGlassStrip extends StatelessWidget { const TopGlassStrip({ super.key, - required this.cupertino, required this.child, this.maxWidth = double.infinity, this.padding = const EdgeInsets.symmetric(horizontal: 12, vertical: 8), }); - final bool cupertino; final Widget child; /// The widest the strip grows on a wide window. @@ -50,7 +48,6 @@ class TopGlassStrip extends StatelessWidget { child: ConstrainedBox( constraints: BoxConstraints(maxWidth: maxWidth), child: GlassPill( - cupertino: cupertino, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(kTopGlassStripRadius), ), diff --git a/app/lib/ui/input/app_search_field.dart b/app/lib/ui/input/app_search_field.dart index 050219bd..a90a7afb 100644 --- a/app/lib/ui/input/app_search_field.dart +++ b/app/lib/ui/input/app_search_field.dart @@ -19,7 +19,6 @@ class AppSearchField extends StatelessWidget { this.autofocus = false, this.focusNode, this.inBar = false, - this.cupertino, }); final TextEditingController controller; @@ -39,7 +38,6 @@ class AppSearchField extends StatelessWidget { final bool autofocus; final FocusNode? focusNode; final bool inBar; - final bool? cupertino; void _clear() { controller.clear(); diff --git a/app/lib/ui/layout/app_list_row.dart b/app/lib/ui/layout/app_list_row.dart index 2405e04a..30080904 100644 --- a/app/lib/ui/layout/app_list_row.dart +++ b/app/lib/ui/layout/app_list_row.dart @@ -65,7 +65,6 @@ class AppListRow extends StatelessWidget { this.emphasized = false, this.divider = true, this.compactWidth = kAppListRowCompactWidth, - this.cupertino, this.accent, this.showAccentBorder = true, }); @@ -107,22 +106,14 @@ class AppListRow extends StatelessWidget { final bool divider; final double compactWidth; - /// Ignored: rows are always Material. Kept so existing callers compile. - final bool? cupertino; - /// The faint tint an unselected row with [accent] wears over the list. - /// The [cupertino] argument is ignored; the tint is always Material. - static Color? tintFor( - BuildContext context, - Color? accent, { - required bool cupertino, - }) => accent?.withValues( - alpha: Theme.of(context).brightness == Brightness.dark ? 0.12 : 0.07, - ); + static Color? tintFor(BuildContext context, Color? accent) => + accent?.withValues( + alpha: Theme.of(context).brightness == Brightness.dark ? 0.12 : 0.07, + ); - /// The open row's fill. The [cupertino] argument is ignored; the fill is - /// always Material `secondaryContainer`. - static Color selectedColor(BuildContext context, {required bool cupertino}) => + /// The open row's fill is Material `secondaryContainer`. + static Color selectedColor(BuildContext context) => Theme.of(context).colorScheme.secondaryContainer; @override @@ -172,11 +163,11 @@ class AppListRow extends StatelessWidget { ], ), ); - final tint = tintFor(context, accent, cupertino: false); + final tint = tintFor(context, accent); final surface = Material( key: appListRowSurfaceKey, color: selected - ? selectedFill ?? selectedColor(context, cupertino: false) + ? selectedFill ?? selectedColor(context) : tint ?? Colors.transparent, child: InkWell( key: tapKey, diff --git a/app/lib/ui/layout/app_sheet_header.dart b/app/lib/ui/layout/app_sheet_header.dart index a0989cd8..a218429a 100644 --- a/app/lib/ui/layout/app_sheet_header.dart +++ b/app/lib/ui/layout/app_sheet_header.dart @@ -19,7 +19,6 @@ class AppSheetHeader extends StatelessWidget { this.actions = const [], this.onDone, this.doneKey, - this.cupertino, }); final String title; @@ -31,9 +30,6 @@ class AppSheetHeader extends StatelessWidget { final VoidCallback? onDone; final Key? doneKey; - /// Ignored: the header is always Material. Kept so existing callers compile. - final bool? cupertino; - @override Widget build(BuildContext context) { final done = onDone ?? () => Navigator.of(context).maybePop(); diff --git a/app/lib/ui/layout/facts_grid.dart b/app/lib/ui/layout/facts_grid.dart index 8a8b024d..56ae90e5 100644 --- a/app/lib/ui/layout/facts_grid.dart +++ b/app/lib/ui/layout/facts_grid.dart @@ -43,7 +43,6 @@ class FactsGrid extends StatelessWidget { required this.items, this.padding = const EdgeInsets.fromLTRB(16, 12, 16, 12), this.selectable = true, - this.cupertino, }); final List items; @@ -52,9 +51,6 @@ class FactsGrid extends StatelessWidget { /// Values are selectable text unless this is false. final bool selectable; - /// Ignored: the grid is always Material. Kept so existing callers compile. - final bool? cupertino; - @override Widget build(BuildContext context) { final labelStyle = Theme.of(context).textTheme.bodySmall?.copyWith( diff --git a/app/lib/ui/motion/container_transform_gestures.dart b/app/lib/ui/motion/container_transform_gestures.dart index da0abd03..0da7d047 100644 --- a/app/lib/ui/motion/container_transform_gestures.dart +++ b/app/lib/ui/motion/container_transform_gestures.dart @@ -25,12 +25,10 @@ class ContainerTransformBackGestures extends StatelessWidget { const ContainerTransformBackGestures({ super.key, required this.route, - required this.cupertino, required this.child, }); final ContainerTransformGestureRoute route; - final bool cupertino; final Widget child; @override diff --git a/app/lib/ui/motion/container_transform_route.dart b/app/lib/ui/motion/container_transform_route.dart index d6bbb51f..22db46ac 100644 --- a/app/lib/ui/motion/container_transform_route.dart +++ b/app/lib/ui/motion/container_transform_route.dart @@ -22,13 +22,11 @@ class ContainerTransformPageRoute extends PageRoute ContainerTransformPageRoute({ required this.builder, required this.link, - required this.cupertino, super.settings, }); final WidgetBuilder builder; final ContainerTransformLink link; - final bool cupertino; bool get _reducedMotion { final context = navigator?.context; @@ -89,11 +87,7 @@ class ContainerTransformPageRoute extends PageRoute scrimColor: Theme.of(context).colorScheme.scrim, child: child, ); - return ContainerTransformBackGestures( - route: this, - cupertino: cupertino, - child: page, - ); + return ContainerTransformBackGestures(route: this, child: page); } @override diff --git a/app/lib/ui/navigation/bar_icon_button.dart b/app/lib/ui/navigation/bar_icon_button.dart index 9d84285d..d671ae43 100644 --- a/app/lib/ui/navigation/bar_icon_button.dart +++ b/app/lib/ui/navigation/bar_icon_button.dart @@ -11,20 +11,15 @@ class BarIconButton extends StatelessWidget { const BarIconButton({ super.key, required this.icon, - this.cupertinoIcon, required this.label, required this.onPressed, this.selected = false, this.busy = false, this.busyLabel, - this.cupertino, }); final IconData icon; - /// Retained for source compatibility; Material rendering always uses [icon]. - final IconData? cupertinoIcon; - /// The tooltip and accessible name. final String label; final VoidCallback? onPressed; @@ -36,9 +31,6 @@ class BarIconButton extends StatelessWidget { /// The accessible name while [busy]; defaults to [label]. final String? busyLabel; - /// The control family; defaults to the host's. - final bool? cupertino; - @override Widget build(BuildContext context) { if (busy) { diff --git a/app/lib/ui/navigation/chevron_pager.dart b/app/lib/ui/navigation/chevron_pager.dart index 0cf39128..564eecc4 100644 --- a/app/lib/ui/navigation/chevron_pager.dart +++ b/app/lib/ui/navigation/chevron_pager.dart @@ -46,7 +46,7 @@ class ChevronPager extends StatelessWidget { onPressed: onPressed, icon: Icon( previous ? Icons.chevron_left : Icons.chevron_right, - size: GlassBarMetrics.iconSize(false), + size: GlassBarMetrics.iconSize(), ), ); } @@ -54,7 +54,7 @@ class ChevronPager extends StatelessWidget { // The surrounding glass bar supplies the edge gap ([GlassBarMetrics]). // The position keeps an icon's inset on each side, so it sits as far from // the bar's edge and from the chevrons as an icon would. - final inset = GlassBarMetrics.iconInset(false); + final inset = GlassBarMetrics.iconInset(); return Row( mainAxisAlignment: MainAxisAlignment.end, children: [ diff --git a/app/lib/ui/theme/app_theme.dart b/app/lib/ui/theme/app_theme.dart index adfca7fa..1f3ab294 100644 --- a/app/lib/ui/theme/app_theme.dart +++ b/app/lib/ui/theme/app_theme.dart @@ -1,34 +1,12 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/cupertino.dart'; +// Framework transition for Material routes: keeps Apple's interactive Back. +import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder; import 'package:flutter/material.dart'; -/// The app's backgrounds. Dark mode uses a near-black gray rather than pure -/// black, so cards, sections and bars read as layers above the page. -abstract final class AppColors { - /// A page. - static const background = CupertinoDynamicColor.withBrightness( - color: Color(0xFFFFFFFF), - darkColor: Color(0xFF141416), - ); - - /// Behind grouped sections (Settings-style lists). - static const groupedBackground = CupertinoDynamicColor.withBrightness( - color: Color(0xFFF2F2F7), - darkColor: Color(0xFF141416), - ); - - /// Bars over the page. - static const bar = CupertinoDynamicColor.withBrightness( - color: Color(0xF0F9F9F9), - darkColor: Color(0xF01C1C1F), - ); -} - const _seed = Color(0xFF6750A4); -/// [fontFamily] replaces the platform family throughout the text themes -/// (Material's, and Cupertino's for Cupertino widgets on a Material host), -/// keeping every size, weight and the text scaling; null keeps the system +/// [fontFamily] replaces the platform family throughout the Material text +/// themes, keeping every size, weight and text scaling. Null keeps the system /// typography. ThemeData appLightTheme({String? fontFamily}) { final scheme = ColorScheme.fromSeed(seedColor: _seed); @@ -111,36 +89,3 @@ ThemeData appDarkTheme({String? fontFamily}) { fontFamily: fontFamily, ); } - -const appCupertinoTheme = CupertinoThemeData( - scaffoldBackgroundColor: AppColors.background, - barBackgroundColor: AppColors.bar, -); - -/// [appCupertinoTheme] with every Cupertino text role in [fontFamily]; null -/// keeps the system typography. -CupertinoThemeData appCupertinoThemeWith({String? fontFamily}) => - fontFamily == null - ? appCupertinoTheme - : appCupertinoTheme.copyWith(textTheme: appCupertinoTextTheme(fontFamily)); - -/// The stock Cupertino text roles (sizes, weights, colours) in [fontFamily]. -/// Action roles take [primaryColor], as the stock roles do. -CupertinoTextThemeData appCupertinoTextTheme( - String fontFamily, { - Color primaryColor = CupertinoColors.systemBlue, -}) { - final base = CupertinoTextThemeData(primaryColor: primaryColor); - TextStyle face(TextStyle style) => style.copyWith(fontFamily: fontFamily); - return CupertinoTextThemeData( - textStyle: face(base.textStyle), - actionTextStyle: face(base.actionTextStyle), - actionSmallTextStyle: face(base.actionSmallTextStyle), - tabLabelTextStyle: face(base.tabLabelTextStyle), - navTitleTextStyle: face(base.navTitleTextStyle), - navLargeTitleTextStyle: face(base.navLargeTitleTextStyle), - navActionTextStyle: face(base.navActionTextStyle), - pickerTextStyle: face(base.pickerTextStyle), - dateTimePickerTextStyle: face(base.dateTimePickerTextStyle), - ); -} diff --git a/app/notes/material-final-api-cleanup.md b/app/notes/material-final-api-cleanup.md new file mode 100644 index 00000000..86369d78 --- /dev/null +++ b/app/notes/material-final-api-cleanup.md @@ -0,0 +1,85 @@ +# Material-only API cleanup + +## Manager completion (supersedes the original handoff) + +Integrated the complete tooling sweep and removed obsolete control-family +arguments, fields, icon metadata, forwarding and host helpers across application, +feature, shared UI, test and fixture callers. Removed the unused dynamic-color +and alternate-theme APIs. Native Material routing, predictive Back and Apple +interactive Back transitions remain intact. + +Final case-insensitive inventory over `app/lib app/test app/tool` is exactly +three lines: the restricted import and two uses of Flutter's +`CupertinoPageTransitionsBuilder` in `ui/theme/app_theme.dart`. This framework +transition is explicitly retained; there are no alternate app widgets, host +choices, flags, tests, capture options or fixture loops left. + +Checks so far: +- Root and explicit `tool/` analysis: clean. +- Full-app fixture web build and production web build: passed. +- Application regressions: 153 passed, zero failed. Navigation fixtures now + disable unrelated native update plugins; chat fixtures answer the auxiliary + shell-runs snapshot rather than blocking the correlated request queue. +- Dependency lock changed only by removing `cupertino_icons`; no SDK or other + dependency was upgraded. All changed Dart files were formatted. +- Complete test-suite rerun and the fresh desktop review follow this pass. + +The web compiler emits an expected-font warning for framework-reachable Apple +icon data after removing the optional icon font. The application has no such +icon references; actual Material Back controls and rendered evidence must be +checked rather than silently restoring obsolete UI dependencies. + +## Original failed-stage handoff (historical) + +## Status + +Blocked/incomplete. This visit removed the obsolete `cupertino_icons` dependency +from `app/pubspec.yaml` and regenerated `app/pubspec.lock` with the existing +dependency versions (`flutter pub get --no-example`; no upgrade was requested +or performed). + +The coordinated source/API cleanup was not completed. The clean integrated +baseline still contains compatibility fields and callers throughout +`app/lib`, Material/Cupertino fixture variants in `app/test`, and active +dual-platform hosts/loops in `app/tool`. The parallel run381 host/driver lane +has not landed in this worktree; its callers and host builders must be updated +together rather than removed piecemeal. No source/test behavior was weakened or +probes deleted to hide the dependency. + +## Inventory evidence + +At `2026-11-11T21:24:28Z`, a case-insensitive grep over `app/lib app/test +app/tool` reported **1,040 matching lines** across the remaining source, +tests, fixtures, probes, and historical notes. This is not an acceptable final +inventory: it includes active code and tests and therefore requires the next +coordinated cleanup lane. + +The active production hotspots include `lib/application/pipelines_app.dart`, +`lib/ui/adaptive/segmented_bar.dart`, `lib/ui/adaptive/floating_destination_bar.dart`, +`lib/ui/theme/app_theme.dart`, shared adaptive/layout primitives, and feature +callers retaining `cupertino`/`cupertinoIcon` compatibility arguments. The +remaining tool dependency includes host entries and JS loops such as +`tool/templates_wiring_probe_entry.dart`, `tool/attention_probe.dart`, and +the corresponding `*_probe.mjs` drivers. + +`CupertinoPageTransitionsBuilder` in `lib/ui/theme/app_theme.dart` is the one +explicitly permitted Material transition API and must be retained to preserve +the native iOS back-swipe behavior. It is not evidence that the active +Cupertino widget hosts are complete or removable independently. + +## Verification + +- `flutter pub get --no-example`: passed; removed `cupertino_icons` 1.0.9 from + the lockfile while preserving the other resolved versions. +- Focused watchdog tests: not run; the requested API cleanup was not complete. +- `tool/analyze.sh`: not run after the final clean-baseline decision; no source + edits requiring analysis were retained. +- Browser/device/build verification: not run. + +## Remaining work + +Land or otherwise provide run381's host/driver cleanup, then remove all +remaining compatibility APIs and callers, convert the named startup/routing, +native-back, shared UI/theme/status, selector/window/search tests to the single +Material path, format all changed Dart, run the explicitly scoped watchdog +regressions and analysis, and replace this handoff with complete evidence. diff --git a/app/pubspec.lock b/app/pubspec.lock index 5dea71ee..6d19a1ef 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -145,14 +145,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" - url: "https://pub.dev" - source: hosted - version: "1.0.9" dbus: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 7dc018df..c3d39b1a 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -31,10 +31,7 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. crypto: ^3.0.7 - cupertino_icons: ^1.0.8 web_socket_channel: ^3.0.3 shared_preferences: ^2.5.6 flutter_web_plugins: diff --git a/app/test/application/app_lifecycle_reconnect_test.dart b/app/test/application/app_lifecycle_reconnect_test.dart index 8a59339c..bfee06bd 100644 --- a/app/test/application/app_lifecycle_reconnect_test.dart +++ b/app/test/application/app_lifecycle_reconnect_test.dart @@ -17,9 +17,9 @@ Future pumpApp( }) async { await tester.pumpWidget( PipelinesApp( + androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); diff --git a/app/test/application/app_router_test.dart b/app/test/application/app_router_test.dart index ca92f80a..07e43b6b 100644 --- a/app/test/application/app_router_test.dart +++ b/app/test/application/app_router_test.dart @@ -5,7 +5,6 @@ import 'package:pipelines_app/application/app_router.dart'; AppRouterDelegate delegate(AppRoute initial) => AppRouterDelegate( builder: (context, route) => const SizedBox.shrink(), - cupertino: false, initial: initial, ); @@ -16,7 +15,6 @@ Future pumpRouter( final router = AppRouterDelegate( builder: (_, route) => Scaffold(body: Text(route.path)), templatesBuilder: (_) => const Scaffold(body: Text('Templates page')), - cupertino: false, initial: initial, ); addTearDown(router.dispose); diff --git a/app/test/application/chat_registration_test.dart b/app/test/application/chat_registration_test.dart index c80eb9f5..07901af5 100644 --- a/app/test/application/chat_registration_test.dart +++ b/app/test/application/chat_registration_test.dart @@ -1,6 +1,5 @@ import 'dart:convert'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -51,6 +50,17 @@ Future> waitForRequest( if (type != 'chat_automations') { for (final raw in channel.outgoing.toList()) { final metadata = jsonDecode(raw as String) as Map; + if (metadata['type'] == 'chat_shell_runs' && + type != 'chat_shell_runs' && + replied.add('${metadata['id']}')) { + channel.incoming.add( + jsonEncode({ + 'id': metadata['id'], + 'type': 'chat_shell_runs', + 'chat_shell_runs': const [], + }), + ); + } if (metadata['type'] == 'chat_automations' && replied.add('${metadata['id']}')) { channel.incoming.add( @@ -71,7 +81,10 @@ Future> waitForRequest( if (request != null) return request; await tester.pump(const Duration(milliseconds: 5)); } - fail('Timed out waiting for $type #$index'); + final emitted = channel.outgoing + .map((raw) => (jsonDecode(raw as String) as Map)['type']) + .toList(); + fail('Timed out waiting for $type #$index; emitted requests: $emitted'); } Future replySessions( @@ -246,7 +259,6 @@ void main() { androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); @@ -282,7 +294,6 @@ void main() { // The shell's bar and the conversation's own header. expect(find.byType(SegmentedBar), findsNWidgets(2)); expect(find.byType(AppBar), findsNothing); - expect(find.byType(CupertinoNavigationBar), findsNothing); expect(find.byKey(const Key('chat-thread-header')), findsOneWidget); expect(findNativeBack(), findsNothing); @@ -371,7 +382,6 @@ void main() { androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); @@ -580,7 +590,6 @@ void main() { androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); @@ -663,7 +672,6 @@ void main() { androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); @@ -733,7 +741,6 @@ void main() { androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); diff --git a/app/test/application/chat_scroll_back_test.dart b/app/test/application/chat_scroll_back_test.dart index 74593490..afe9ab63 100644 --- a/app/test/application/chat_scroll_back_test.dart +++ b/app/test/application/chat_scroll_back_test.dart @@ -74,7 +74,6 @@ void main() { late final AppRouterDelegate router; router = AppRouterDelegate( initial: AppRoute.chat, - cupertino: false, builder: (_, route) => AdaptiveShell( destination: AppDestination.chat, destinationBodies: { diff --git a/app/test/application/chat_wide_back_test.dart b/app/test/application/chat_wide_back_test.dart index 0dd50a78..c6e3678d 100644 --- a/app/test/application/chat_wide_back_test.dart +++ b/app/test/application/chat_wide_back_test.dart @@ -54,7 +54,6 @@ void main() { late final AppRouterDelegate router; router = AppRouterDelegate( initial: AppRoute.chat, - cupertino: false, builder: (_, route) => AdaptiveShell( destination: AppDestination.chat, destinationBodies: { diff --git a/app/test/application/list_detail_consistency_test.dart b/app/test/application/list_detail_consistency_test.dart index d39a67d3..cedf3093 100644 --- a/app/test/application/list_detail_consistency_test.dart +++ b/app/test/application/list_detail_consistency_test.dart @@ -184,7 +184,7 @@ void main() { tester.widget(surface).color, selected ? tester.widget(row).selectedFill ?? - AppListRow.selectedColor(context, cupertino: false) + AppListRow.selectedColor(context) : const Color(0x00000000), ); } diff --git a/app/test/application/pipeline_stage_deep_link_test.dart b/app/test/application/pipeline_stage_deep_link_test.dart index afd07e4f..1ec3fe60 100644 --- a/app/test/application/pipeline_stage_deep_link_test.dart +++ b/app/test/application/pipeline_stage_deep_link_test.dart @@ -66,9 +66,9 @@ void main() { await tester.pumpWidget( PipelinesApp( + androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); diff --git a/app/test/application/pipelines_app_test.dart b/app/test/application/pipelines_app_test.dart index 07a6e910..7a46e08c 100644 --- a/app/test/application/pipelines_app_test.dart +++ b/app/test/application/pipelines_app_test.dart @@ -39,7 +39,6 @@ Future pumpApp( client: client, // Navigation fixtures do not exercise native update plugins. androidSupported: false, - cupertino: false, routeInformationProvider: provider, ), ); diff --git a/app/test/application/pipelines_registration_test.dart b/app/test/application/pipelines_registration_test.dart index 0d181a08..4a1ad5c0 100644 --- a/app/test/application/pipelines_registration_test.dart +++ b/app/test/application/pipelines_registration_test.dart @@ -35,9 +35,9 @@ void main() { await tester.pumpWidget( PipelinesApp( + androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); @@ -64,9 +64,7 @@ void main() { await tester.tap(find.byKey(const Key('pipeline-detail-tab-source'))); await tester.pump(); expect( - selectableText( - 'name: Alpha review\nstages:\n review:\n type: model', - ), + selectableText('name: Alpha review\nstages:\n review:\n type: model'), findsOneWidget, ); diff --git a/app/test/application/run_start_wiring_test.dart b/app/test/application/run_start_wiring_test.dart index b393405b..97ad90f1 100644 --- a/app/test/application/run_start_wiring_test.dart +++ b/app/test/application/run_start_wiring_test.dart @@ -79,9 +79,9 @@ void main() { await tester.pumpWidget( PipelinesApp( + androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); diff --git a/app/test/application/search_wiring_test.dart b/app/test/application/search_wiring_test.dart index 66e6286b..6eb41471 100644 --- a/app/test/application/search_wiring_test.dart +++ b/app/test/application/search_wiring_test.dart @@ -807,7 +807,6 @@ void main() { test('openSearch keeps the previous route and closing restores it', () async { final router = AppRouterDelegate( builder: (context, route) => const SizedBox.shrink(), - cupertino: false, initial: AppRoute.run(3), ); addTearDown(router.dispose); diff --git a/app/test/application/settings_page_test.dart b/app/test/application/settings_page_test.dart index 28edd59f..73606176 100644 --- a/app/test/application/settings_page_test.dart +++ b/app/test/application/settings_page_test.dart @@ -33,9 +33,9 @@ void main() { addTearDown(provider.dispose); await tester.pumpWidget( PipelinesApp( + androidSupported: false, server: webServer(), client: PipelinesClient(channelFactory: (_) => channel), - cupertino: false, routeInformationProvider: provider, ), ); @@ -61,9 +61,7 @@ void main() { // Four tabs; Settings is none of them. expect( tester - .widget( - find.byType(FloatingDestinationBar), - ) + .widget(find.byType(FloatingDestinationBar)) .items .map((item) => item.label), ['Pipelines', 'Runs', 'Chat', 'Search'], diff --git a/app/test/application/settings_registration_test.dart b/app/test/application/settings_registration_test.dart index ccad068c..b96d23ab 100644 --- a/app/test/application/settings_registration_test.dart +++ b/app/test/application/settings_registration_test.dart @@ -31,9 +31,9 @@ void main() { addTearDown(provider.dispose); await tester.pumpWidget( PipelinesApp( + androidSupported: false, server: webServer(), client: client, - cupertino: false, routeInformationProvider: provider, ), ); diff --git a/app/test/application/startup_update_check_test.dart b/app/test/application/startup_update_check_test.dart index 0533d84e..c253a777 100644 --- a/app/test/application/startup_update_check_test.dart +++ b/app/test/application/startup_update_check_test.dart @@ -8,13 +8,14 @@ import 'package:pipelines_app/features/updates/app_updates.dart'; import '../core/transport/pipelines_client_test.dart' show FakeChannel; ServerEndpoint server() => ServerEndpoint.resolve( - base: Uri.parse('http://127.0.0.1:8096/'), - web: true, - ); + base: Uri.parse('http://127.0.0.1:8096/'), + web: true, +); void main() { - testWidgets('web launch check is injected, asks once, and does not refresh', - (tester) async { + testWidgets('web launch check is injected, asks once, and does not refresh', ( + tester, + ) async { final channel = FakeChannel()..readyCompleter.complete(); final client = PipelinesClient(channelFactory: (_) => channel); final provider = PlatformRouteInformationProvider( @@ -24,19 +25,20 @@ void main() { var reads = 0; var refreshes = 0; - await tester.pumpWidget(PipelinesApp( - server: server(), - client: client, - cupertino: false, - routeInformationProvider: provider, - webPlatform: true, - webBuildId: 'web-old', - webReleaseReader: (_) async { - reads++; - return '{"schema":1,"platform":"web","buildId":"web-new"}'; - }, - webRefresher: () async => refreshes++, - )); + await tester.pumpWidget( + PipelinesApp( + server: server(), + client: client, + routeInformationProvider: provider, + webPlatform: true, + webBuildId: 'web-old', + webReleaseReader: (_) async { + reads++; + return '{"schema":1,"platform":"web","buildId":"web-new"}'; + }, + webRefresher: () async => refreshes++, + ), + ); await tester.pump(); await tester.pump(); expect(find.text('Update available'), findsOneWidget); @@ -44,25 +46,28 @@ void main() { await tester.tap(find.text('Later')); await tester.pump(); - await tester.pumpWidget(PipelinesApp( - server: server(), - client: client, - cupertino: false, - routeInformationProvider: provider, - webPlatform: true, - webBuildId: 'web-old', - webReleaseReader: (_) async { - reads++; - return '{"schema":1,"platform":"web","buildId":"web-new"}'; - }, - webRefresher: () async => refreshes++, - )); + await tester.pumpWidget( + PipelinesApp( + server: server(), + client: client, + routeInformationProvider: provider, + webPlatform: true, + webBuildId: 'web-old', + webReleaseReader: (_) async { + reads++; + return '{"schema":1,"platform":"web","buildId":"web-new"}'; + }, + webRefresher: () async => refreshes++, + ), + ); await tester.pump(); expect(find.text('Update available'), findsNothing); expect(refreshes, 0); }); - testWidgets('Android launch choice uses the injected installer', (tester) async { + testWidgets('Android launch choice uses the injected installer', ( + tester, + ) async { final channel = FakeChannel()..readyCompleter.complete(); final client = PipelinesClient(channelFactory: (_) => channel); final provider = PlatformRouteInformationProvider( @@ -75,17 +80,18 @@ void main() { versionName: '4', apk: Uri.parse('https://example.test/pipelines.apk'), ); - await tester.pumpWidget(PipelinesApp( - server: server(), - client: client, - cupertino: false, - routeInformationProvider: provider, - webPlatform: false, - androidSupported: true, - installedVersionReader: () async => 3, - androidFeedReader: (_) async => update, - androidInstaller: (_, {onProgress}) async => installs++, - )); + await tester.pumpWidget( + PipelinesApp( + server: server(), + client: client, + routeInformationProvider: provider, + webPlatform: false, + androidSupported: true, + installedVersionReader: () async => 3, + androidFeedReader: (_) async => update, + androidInstaller: (_, {onProgress}) async => installs++, + ), + ); await tester.pump(); await tester.pump(); expect(find.text('Download'), findsOneWidget); diff --git a/app/test/application/startup_update_flow_test.dart b/app/test/application/startup_update_flow_test.dart index 06f8d30a..50234e5c 100644 --- a/app/test/application/startup_update_flow_test.dart +++ b/app/test/application/startup_update_flow_test.dart @@ -30,7 +30,6 @@ void main() { web: true, ), client: PipelinesClient(channelFactory: (_) => channel), - cupertino: false, routeInformationProvider: provider, webPlatform: web, webPageUri: Uri.parse('https://app.test/chats?selected=1'), @@ -75,7 +74,6 @@ void main() { PipelinesApp( server: ServerEndpoint.resolve(base: Uri(), web: false), client: client, - cupertino: false, routeInformationProvider: provider, webPlatform: false, androidSupported: true, @@ -124,7 +122,6 @@ void main() { web: true, ), client: client, - cupertino: false, routeInformationProvider: provider, webPlatform: false, androidSupported: true, diff --git a/app/test/application/tab_location_navigation_test.dart b/app/test/application/tab_location_navigation_test.dart index cae8dfb3..1197cd27 100644 --- a/app/test/application/tab_location_navigation_test.dart +++ b/app/test/application/tab_location_navigation_test.dart @@ -36,9 +36,9 @@ mount( addTearDown(client.dispose); await tester.pumpWidget( PipelinesApp( + androidSupported: false, server: webServer(), client: client, - cupertino: false, serverId: 'navigation-test', routeInformationProvider: provider, tabLocationsStore: store, @@ -210,11 +210,7 @@ void main() { ..value = const TabLocationsSnapshot( routes: {AppDestination.pipelines: AppRoute.settings}, ); - final app = await mount( - tester, - route: '/?appearance=cupertino', - store: store, - ); + final app = await mount(tester, route: '/?preview=1', store: store); await tester.pumpAndSettle(); expect(app.provider.value.uri.path, '/settings'); expect(find.byType(SettingsScreen), findsOneWidget); diff --git a/app/test/application/templates_behind_bar_test.dart b/app/test/application/templates_behind_bar_test.dart index e5db9b17..4036a787 100644 --- a/app/test/application/templates_behind_bar_test.dart +++ b/app/test/application/templates_behind_bar_test.dart @@ -21,13 +21,7 @@ void main() { initialRouteInformation: RouteInformation(uri: Uri.parse('/pipelines')), ); addTearDown(provider.dispose); - await pumpApp( - tester, - channel: channel, - client: client, - provider: provider, - cupertino: false, - ); + await pumpApp(tester, channel: channel, client: client, provider: provider); await replyPipelines(tester, channel, PipelineFixture()); await openSettings(tester, channel, provider); await openTemplates(tester, channel, provider); diff --git a/app/test/application/templates_wiring_test.dart b/app/test/application/templates_wiring_test.dart index 8be556a3..a3afe0dd 100644 --- a/app/test/application/templates_wiring_test.dart +++ b/app/test/application/templates_wiring_test.dart @@ -67,7 +67,6 @@ Future pumpApp( required FakeChannel channel, required PipelinesClient client, required PlatformRouteInformationProvider provider, - required bool cupertino, }) async { tester.view.physicalSize = const Size(1100, 900); tester.view.devicePixelRatio = 1; @@ -80,7 +79,6 @@ Future pumpApp( client: client, // This fixture tests template routing, not native update plugins. androidSupported: false, - cupertino: false, routeInformationProvider: provider, ), ); @@ -176,7 +174,6 @@ void main() { channel: channel, client: client, provider: provider, - cupertino: false, ); await replyPipelines(tester, channel, fixture); @@ -272,13 +269,7 @@ void main() { ); addTearDown(provider.dispose); - await pumpApp( - tester, - channel: channel, - client: client, - provider: provider, - cupertino: false, - ); + await pumpApp(tester, channel: channel, client: client, provider: provider); await replyPipelines(tester, channel, fixture); expect( find.byKey(const Key('pipeline-row-41'), skipOffstage: false), diff --git a/app/test/features/attention/ui/notification_permission_tile_test.dart b/app/test/features/attention/ui/notification_permission_tile_test.dart index e3742852..9543746c 100644 --- a/app/test/features/attention/ui/notification_permission_tile_test.dart +++ b/app/test/features/attention/ui/notification_permission_tile_test.dart @@ -81,16 +81,13 @@ void main() { expect(requested, 1); }); - testWidgets('a stale cupertino flag still draws the Material row', ( - tester, - ) async { + testWidgets('the permission prompt draws the Material row', (tester) async { await tester.pumpWidget( attentionApp( Scaffold( body: SingleChildScrollView( child: NotificationPermissionTile( state: NotificationPermissionState.notRequested, - cupertino: true, onRequest: _noop, ), ), diff --git a/app/test/features/chat/chat_composer_entrance_test.dart b/app/test/features/chat/chat_composer_entrance_test.dart index 24febb66..dc3dea88 100644 --- a/app/test/features/chat/chat_composer_entrance_test.dart +++ b/app/test/features/chat/chat_composer_entrance_test.dart @@ -55,7 +55,6 @@ Future _pumpShell( child: child!, ), home: AdaptiveShell( - cupertino: false, destination: AppDestination.chat, destinationBodies: { AppDestination.chat: (_) => ChatScreen(gateway: gateway), diff --git a/app/test/features/chat/chat_list_shortcuts_test.dart b/app/test/features/chat/chat_list_shortcuts_test.dart index 47589116..8ef30512 100644 --- a/app/test/features/chat/chat_list_shortcuts_test.dart +++ b/app/test/features/chat/chat_list_shortcuts_test.dart @@ -64,7 +64,6 @@ Future<_Gateway> _pumpShell( MaterialApp( theme: ThemeData(platform: platform, brightness: brightness), home: AdaptiveShell( - cupertino: false, destination: AppDestination.chat, destinationBodies: { AppDestination.chat: (_) => ChatScreen(gateway: gateway), diff --git a/app/test/features/chat/chat_open_transition_test.dart b/app/test/features/chat/chat_open_transition_test.dart index da19c01e..15068046 100644 --- a/app/test/features/chat/chat_open_transition_test.dart +++ b/app/test/features/chat/chat_open_transition_test.dart @@ -182,7 +182,6 @@ void main() { test('the route reads its timing from Motion', () { final route = ContainerTransformPageRoute( link: ContainerTransformLink(() => null), - cupertino: false, builder: (_) => const SizedBox(), ); expect(route.transitionDuration, Motion.containerTransform); diff --git a/app/test/features/chat/chat_screen_mode_test.dart b/app/test/features/chat/chat_screen_mode_test.dart index 3c671376..ebcb3f81 100644 --- a/app/test/features/chat/chat_screen_mode_test.dart +++ b/app/test/features/chat/chat_screen_mode_test.dart @@ -102,7 +102,7 @@ Future _pump( } /// The mode the drawn control names, or null when the bar has none. A -/// Cupertino phone bar draws only the shield, so read the control itself. +/// A narrow phone bar draws only the shield, so read the control itself. String? _shown(WidgetTester tester) { if (_modeControl.evaluate().isEmpty) return null; final control = find.byType(ChatModeControl); @@ -112,7 +112,7 @@ String? _shown(WidgetTester tester) { void main() { for (final platform in [TargetPlatform.android, TargetPlatform.iOS]) { - final style = platform == TargetPlatform.iOS ? 'Cupertino' : 'Material'; + final style = 'Material on ${platform.name}'; testWidgets( '$style: an existing chat opened from the list shows its mode', diff --git a/app/test/features/chat/chat_split_integration_test.dart b/app/test/features/chat/chat_split_integration_test.dart index 3e880af8..4d3eb558 100644 --- a/app/test/features/chat/chat_split_integration_test.dart +++ b/app/test/features/chat/chat_split_integration_test.dart @@ -64,7 +64,6 @@ Future<_Gateway> _setup(WidgetTester tester, {bool inShell = false}) async { inShell ? MaterialApp( home: AdaptiveShell( - cupertino: false, destination: AppDestination.chat, destinationBodies: { AppDestination.chat: (_) => ChatScreen(gateway: gateway), diff --git a/app/test/features/chat/chat_workspace_insets_color_test.dart b/app/test/features/chat/chat_workspace_insets_color_test.dart index 70af19f1..fab1170f 100644 --- a/app/test/features/chat/chat_workspace_insets_color_test.dart +++ b/app/test/features/chat/chat_workspace_insets_color_test.dart @@ -58,7 +58,6 @@ Future _mount(WidgetTester tester, Size size) async { MaterialApp( theme: ThemeData(platform: TargetPlatform.android), home: AdaptiveShell( - cupertino: false, destination: AppDestination.chat, destinationBodies: { AppDestination.chat: (_) => ChatScreen(gateway: gateway), diff --git a/app/test/features/chat/ui/sessions/chat_ios_material_test.dart b/app/test/features/chat/ui/sessions/chat_ios_material_test.dart index 6deafedb..35a82fd5 100644 --- a/app/test/features/chat/ui/sessions/chat_ios_material_test.dart +++ b/app/test/features/chat/ui/sessions/chat_ios_material_test.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -17,7 +16,6 @@ void main() { await pumpIosMaterialChat(tester, FakeChatGateway()); expect(find.byType(Scaffold), findsWidgets); - expect(find.byType(CupertinoPageScaffold), findsNothing); const message = 'No chat sessions on this server yet.'; expect(find.text(message), findsOneWidget); @@ -42,7 +40,15 @@ void main() { expect(find.text(message), findsOneWidget); expectNormalTextStyle(tester, message); expect(find.text('No chat sessions on this server yet.'), findsNothing); - expect(find.widgetWithText(CupertinoButton, 'Retry'), findsNothing); + expect( + find.ancestor( + of: find.text('Retry'), + matching: find.byWidgetPredicate( + (widget) => widget is ButtonStyleButton, + ), + ), + findsOneWidget, + ); expect(find.text('Retry'), findsOneWidget); }); } diff --git a/app/test/features/chat/ui/sessions/chat_test_harness.dart b/app/test/features/chat/ui/sessions/chat_test_harness.dart index 4023d4a4..2af00dc9 100644 --- a/app/test/features/chat/ui/sessions/chat_test_harness.dart +++ b/app/test/features/chat/ui/sessions/chat_test_harness.dart @@ -56,8 +56,7 @@ Future pumpMaterialChat( await tester.pumpAndSettle(); } -/// The screen's iOS/macOS path: Cupertino controls under the app's ordinary -/// `MaterialApp` root, with no Material or CupertinoTheme ancestor. +/// The screen's iOS/macOS path uses the same ordinary Material app root. Future pumpIosMaterialChat( WidgetTester tester, FakeChatGateway gateway, { diff --git a/app/test/features/chat/ui/transcript/chat_paragraph_spacing_test.dart b/app/test/features/chat/ui/transcript/chat_paragraph_spacing_test.dart index b66c66d5..d529dc32 100644 --- a/app/test/features/chat/ui/transcript/chat_paragraph_spacing_test.dart +++ b/app/test/features/chat/ui/transcript/chat_paragraph_spacing_test.dart @@ -69,7 +69,7 @@ void main() { await tester.pumpAndSettle(); final context = tester.element(find.byType(ChatMessageView)); - final fontSize = chatMessageTextStyle(context, false)!.fontSize!; + final fontSize = chatMessageTextStyle(context)!.fontSize!; final line = fontSize * scale; Rect rect(String text) => tester.getRect(find.textContaining(text, findRichText: true).first); diff --git a/app/test/features/pipelines/pipeline_summary_flat_test.dart b/app/test/features/pipelines/pipeline_summary_flat_test.dart index 24283204..6e0f823b 100644 --- a/app/test/features/pipelines/pipeline_summary_flat_test.dart +++ b/app/test/features/pipelines/pipeline_summary_flat_test.dart @@ -62,7 +62,6 @@ void main() { find.byKey(const Key('pipeline-version-3')), ); expect(row.selected, isTrue); - expect(row.cupertino, isFalse); expect(tester.takeException(), isNull); }); } diff --git a/app/test/features/pipelines/pipeline_tabs_test.dart b/app/test/features/pipelines/pipeline_tabs_test.dart index bf34be92..f4a87fd1 100644 --- a/app/test/features/pipelines/pipeline_tabs_test.dart +++ b/app/test/features/pipelines/pipeline_tabs_test.dart @@ -39,13 +39,14 @@ void main() { ), ); Widget scaled(BuildContext context, Widget? child) => MediaQuery( - data: MediaQuery.of( - context, - ).copyWith(textScaler: TextScaler.linear(2)), + data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(2)), child: child!, ); await tester.pumpWidget( - MaterialApp(builder: scaled, home: Scaffold(body: body)), + MaterialApp( + builder: scaled, + home: Scaffold(body: body), + ), ); await tester.pumpAndSettle(); // One floating bar of separate round tab buttons. @@ -55,10 +56,7 @@ void main() { expect(pill.right, width - 16); expect( pill.width, - FloatingDestinationBar.rowWidth( - cupertino: false, - tabs: PipelineDetailTab.values.length, - ), + FloatingDestinationBar.rowWidth(tabs: PipelineDetailTab.values.length), ); for (final tab in PipelineDetailTab.values) { final rect = tester.getRect( diff --git a/app/test/features/runs/ui/run_detail_tabs_test.dart b/app/test/features/runs/ui/run_detail_tabs_test.dart index fc856348..96ed3195 100644 --- a/app/test/features/runs/ui/run_detail_tabs_test.dart +++ b/app/test/features/runs/ui/run_detail_tabs_test.dart @@ -100,10 +100,7 @@ void main() { // Sized to its tabs at the right, floating above the bottom. expect( pill.width, - FloatingDestinationBar.rowWidth( - cupertino: false, - tabs: renderedRunDetailTabs.length, - ), + FloatingDestinationBar.rowWidth(tabs: renderedRunDetailTabs.length), ); expect(pill.right, 390 - 16); expect(pill.bottom, 844 - 16); diff --git a/app/test/features/runs/ui/run_live_duration_test.dart b/app/test/features/runs/ui/run_live_duration_test.dart index a7244a68..99743c6b 100644 --- a/app/test/features/runs/ui/run_live_duration_test.dart +++ b/app/test/features/runs/ui/run_live_duration_test.dart @@ -114,7 +114,6 @@ void main() { builder: (context) => runDetailSummaryTab( context: context, run: _running, - cupertino: false, copying: false, copyStatus: null, onCopy: () {}, @@ -152,11 +151,7 @@ void main() { await tester.pumpWidget( _host( time, - RunTimelineList( - visits: detailTimeline(steps), - cupertino: false, - onSelected: (_) {}, - ), + RunTimelineList(visits: detailTimeline(steps), onSelected: (_) {}), ), ); expect(find.text('2m 0s'), findsOneWidget); diff --git a/app/test/features/runs/ui/run_timeline_row_test.dart b/app/test/features/runs/ui/run_timeline_row_test.dart index c3c3db6e..f4d98b84 100644 --- a/app/test/features/runs/ui/run_timeline_row_test.dart +++ b/app/test/features/runs/ui/run_timeline_row_test.dart @@ -29,7 +29,6 @@ void main() { testWidgets('timeline rows lead with their real status', (tester) async { final list = RunTimelineList( visits: detailTimeline(_steps), - cupertino: false, onSelected: (_) {}, ); await tester.pumpWidget(MaterialApp(home: Scaffold(body: list))); @@ -71,10 +70,7 @@ void main() { 'outcome': outcome, }, ]; - final list = RunTimelineList( - visits: detailTimeline(steps), - cupertino: false, - ); + final list = RunTimelineList(visits: detailTimeline(steps)); await tester.pumpWidget(MaterialApp(home: Scaffold(body: list))); Color chip(String text, [int at = 0]) => tester.widget(find.text(text).at(at)).style!.color!; diff --git a/app/test/features/schedules/ui/list/schedules_behind_bar_test.dart b/app/test/features/schedules/ui/list/schedules_behind_bar_test.dart index 2aef251a..fb11bba6 100644 --- a/app/test/features/schedules/ui/list/schedules_behind_bar_test.dart +++ b/app/test/features/schedules/ui/list/schedules_behind_bar_test.dart @@ -19,14 +19,10 @@ void main() { (type, fields) async => schedulesReply(longScheduleList(30)), ); final screen = SchedulesScreen(gateway: gateway, onOpen: (_) {}); - final bar = const SegmentedBar(cupertino: false, title: 'Schedules'); + final bar = const SegmentedBar(title: 'Schedules'); await tester.pumpWidget( MaterialApp( - home: Scaffold( - extendBodyBehindAppBar: true, - appBar: bar, - body: screen, - ), + home: Scaffold(extendBodyBehindAppBar: true, appBar: bar, body: screen), ), ); await tester.pumpAndSettle(); diff --git a/app/test/features/schedules/ui/run/schedule_run_action_test.dart b/app/test/features/schedules/ui/run/schedule_run_action_test.dart index ae105832..96faaa24 100644 --- a/app/test/features/schedules/ui/run/schedule_run_action_test.dart +++ b/app/test/features/schedules/ui/run/schedule_run_action_test.dart @@ -189,12 +189,7 @@ void main() { Future openMenu(JsonMap run) async { await pumpAction( tester, - RunMoreMenu( - run: run, - gateway: gateway, - onRunChanged: (_) {}, - cupertino: false, - ), + RunMoreMenu(run: run, gateway: gateway, onRunChanged: (_) {}), ); // A run with nothing to offer shows no menu at all. if (find.byKey(runMoreMenuKey).evaluate().isEmpty) return; diff --git a/app/test/features/search/search_bar_layout_test.dart b/app/test/features/search/search_bar_layout_test.dart index aec06ef2..0d753b2d 100644 --- a/app/test/features/search/search_bar_layout_test.dart +++ b/app/test/features/search/search_bar_layout_test.dart @@ -31,7 +31,7 @@ void main() { _size(tester, 390); final gateway = ImmediateGateway((_, _) => response([pipeline])); await tester.pumpWidget( - _app(SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false)), + _app(SearchScreen(gateway: gateway, onOpen: (_) {})), ); for (final key in [searchFieldKey, searchKindKey, searchHelpKey]) { @@ -63,7 +63,7 @@ void main() { return reply; }); await tester.pumpWidget( - _app(SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false)), + _app(SearchScreen(gateway: gateway, onOpen: (_) {})), ); await _search(tester, 'release'); @@ -81,13 +81,13 @@ void main() { _size(tester, 390); final gateway = ImmediateGateway((_, _) => response([field])); await tester.pumpWidget( - _app(SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false)), + _app(SearchScreen(gateway: gateway, onOpen: (_) {})), ); await _search(tester, 'release'); final row = find.byKey(const ValueKey('search.result.run:11:4:output')); expect(row, findsOneWidget); - expect(tester.widget(row).cupertino, isFalse); + expect(tester.widget(row).title, isNotNull); // The kind leads the one muted line, before the snippet. expect( find.descendant(of: row, matching: find.textContaining('Field ยท ')), @@ -106,7 +106,7 @@ void main() { _size(tester, 1200); final gateway = ImmediateGateway((_, _) => response([pipeline])); await tester.pumpWidget( - _app(SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false)), + _app(SearchScreen(gateway: gateway, onOpen: (_) {})), ); await _search(tester, 'release'); @@ -130,7 +130,7 @@ void main() { _size(tester, width); final gateway = ImmediateGateway((_, _) => response([pipeline])); await tester.pumpWidget( - _app(SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false)), + _app(SearchScreen(gateway: gateway, onOpen: (_) {})), ); await _search(tester, 'release'); diff --git a/app/test/features/search/search_chat_screen_test.dart b/app/test/features/search/search_chat_screen_test.dart index 154b6cc5..240e8940 100644 --- a/app/test/features/search/search_chat_screen_test.dart +++ b/app/test/features/search/search_chat_screen_test.dart @@ -25,13 +25,7 @@ void main() { final gateway = ImmediateGateway(replies); JsonMap? opened; await tester.pumpWidget( - host( - SearchScreen( - gateway: gateway, - onOpen: (value) => opened = value, - cupertino: false, - ), - ), + host(SearchScreen(gateway: gateway, onOpen: (value) => opened = value)), ); await search(tester, 'release'); @@ -77,7 +71,7 @@ void main() { final gateway = ImmediateGateway(replies); await tester.pumpWidget( MaterialApp( - home: SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false), + home: SearchScreen(gateway: gateway, onOpen: (_) {}), ), ); await search(tester, 't:chat release'); @@ -100,7 +94,7 @@ void main() { }); await tester.pumpWidget( MaterialApp( - home: SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false), + home: SearchScreen(gateway: gateway, onOpen: (_) {}), ), ); await search(tester, 'release'); diff --git a/app/test/features/search/search_screen_test.dart b/app/test/features/search/search_screen_test.dart index aa6ab7f3..661fa859 100644 --- a/app/test/features/search/search_screen_test.dart +++ b/app/test/features/search/search_screen_test.dart @@ -110,11 +110,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: largeText( - SearchScreen( - gateway: gateway, - onOpen: (value) => opened = value, - cupertino: false, - ), + SearchScreen(gateway: gateway, onOpen: (value) => opened = value), ), ), ); @@ -155,11 +151,7 @@ void main() { JsonMap? opened; await tester.pumpWidget( MaterialApp( - home: SearchScreen( - gateway: gateway, - onOpen: (value) => opened = value, - cupertino: false, - ), + home: SearchScreen(gateway: gateway, onOpen: (value) => opened = value), ), ); await search(tester, 'widget'); @@ -176,7 +168,7 @@ void main() { final gateway = FailingThenSucceedingGateway(response([pipeline])); await tester.pumpWidget( MaterialApp( - home: SearchScreen(gateway: gateway, onOpen: (_) {}, cupertino: false), + home: SearchScreen(gateway: gateway, onOpen: (_) {}), ), ); await search(tester, 'release'); diff --git a/app/test/features/templates/ui/template_create_test_support.dart b/app/test/features/templates/ui/template_create_test_support.dart index 6a19b933..2d3e0ace 100644 --- a/app/test/features/templates/ui/template_create_test_support.dart +++ b/app/test/features/templates/ui/template_create_test_support.dart @@ -63,15 +63,12 @@ class TemplateCreateHost extends StatelessWidget { super.key, required this.gateway, required this.onCreated, - this.cupertino = false, this.template = templateCreateFixture, }); final FakeTemplateCreateGateway gateway; final ValueChanged onCreated; - /// Retained for callers that still pass it; the host is always Material. - final bool cupertino; final TemplateEntry template; void _open(BuildContext context) { @@ -79,7 +76,6 @@ class TemplateCreateHost extends StatelessWidget { context: context, template: template, repository: TemplateRepository(gateway), - cupertino: cupertino, onCreated: onCreated, ); } @@ -97,11 +93,7 @@ class TemplateCreateHost extends StatelessWidget { } } -Widget templateCreateApp( - Widget child, { - bool cupertino = false, - double textScale = 1, -}) { +Widget templateCreateApp(Widget child, {double textScale = 1}) { Widget media(BuildContext context, Widget? app) => MediaQuery( data: MediaQuery.of( context, diff --git a/app/test/features/templates/ui/template_gallery_test_support.dart b/app/test/features/templates/ui/template_gallery_test_support.dart index 5a617e98..a1e61909 100644 --- a/app/test/features/templates/ui/template_gallery_test_support.dart +++ b/app/test/features/templates/ui/template_gallery_test_support.dart @@ -82,7 +82,6 @@ Future acceptedCreate(String type, JsonMap fields) async { Future pumpGallery( WidgetTester tester, GalleryGateway gateway, { - bool cupertino = false, bool embedded = false, ValueChanged? onCreated, double textScale = 1, diff --git a/app/test/features/updates/native_update_dialog_test.dart b/app/test/features/updates/native_update_dialog_test.dart index 610fe873..8ef3d898 100644 --- a/app/test/features/updates/native_update_dialog_test.dart +++ b/app/test/features/updates/native_update_dialog_test.dart @@ -20,7 +20,6 @@ void main() { onPressed: () => showLaunchUpdateDialog( context, web: false, - cupertino: false, nativePlatform: platform, sourceName: 'Home Linux', ), @@ -43,8 +42,7 @@ void main() { MaterialApp( home: Builder( builder: (context) => TextButton( - onPressed: () => - showLaunchUpdateFailure(context, 'boom', cupertino: false), + onPressed: () => showLaunchUpdateFailure(context, 'boom'), child: const Text('Fail'), ), ), @@ -84,7 +82,6 @@ void main() { onProgress?.call(0.5); await finished.future; }, - cupertino: false, ); await tester.pumpAndSettle(); expect(find.byType(AlertDialog), findsOneWidget); diff --git a/app/test/native_back.dart b/app/test/native_back.dart index 15f67bd4..baaacdce 100644 --- a/app/test/native_back.dart +++ b/app/test/native_back.dart @@ -1,9 +1,5 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; /// Find the platform's actual Back control, not an app-specific button key. -Finder findNativeBack() => find.byWidgetPredicate( - (widget) => - widget is BackButton || widget is CupertinoNavigationBarBackButton, -); +Finder findNativeBack() => find.byType(BackButton); diff --git a/app/test/shell/floating_tab_bar_test.dart b/app/test/shell/floating_tab_bar_test.dart index 00672cf1..ff55d732 100644 --- a/app/test/shell/floating_tab_bar_test.dart +++ b/app/test/shell/floating_tab_bar_test.dart @@ -232,7 +232,7 @@ void main() { } expect( bounds.height, - greaterThan(FloatingDestinationBar.selectedButtonSize(cupertino: false)), + greaterThan(FloatingDestinationBar.selectedButtonSize()), ); expect(tester.getRect(pill()).right, 320 - 16); }); diff --git a/app/test/shell/pane_bar_row_test.dart b/app/test/shell/pane_bar_row_test.dart index 22f856ff..2907ec60 100644 --- a/app/test/shell/pane_bar_row_test.dart +++ b/app/test/shell/pane_bar_row_test.dart @@ -39,7 +39,6 @@ void main() { bar: KeyedSubtree( key: const Key('item-tabs'), child: FloatingDestinationBar( - cupertino: false, edge: edge, currentIndex: 0, onTap: (_) {}, diff --git a/app/test/shell/shell_destination_menu_test.dart b/app/test/shell/shell_destination_menu_test.dart index b9a3dd49..26158dfa 100644 --- a/app/test/shell/shell_destination_menu_test.dart +++ b/app/test/shell/shell_destination_menu_test.dart @@ -7,7 +7,6 @@ void main() { testWidgets('compact menu exposes all named destinations', (tester) async { AppDestination? selected; final menu = ShellDestinationMenu( - cupertino: false, current: AppDestination.chat, onSelected: (value) => selected = value, ); diff --git a/app/test/shell/split_destination_bar_test.dart b/app/test/shell/split_destination_bar_test.dart index 538da54a..5da220a7 100644 --- a/app/test/shell/split_destination_bar_test.dart +++ b/app/test/shell/split_destination_bar_test.dart @@ -49,7 +49,6 @@ void main() { bar: KeyedSubtree( key: const Key('detail-tabs'), child: FloatingDestinationBar( - cupertino: false, currentIndex: 0, onTap: (_) {}, items: const [ diff --git a/app/test/shell/split_status_bar_test.dart b/app/test/shell/split_status_bar_test.dart index 3d6682e0..382b4fc5 100644 --- a/app/test/shell/split_status_bar_test.dart +++ b/app/test/shell/split_status_bar_test.dart @@ -47,7 +47,6 @@ void main() { bar: KeyedSubtree( key: const Key('item-tabs'), child: FloatingDestinationBar( - cupertino: false, edge: edge, currentIndex: 0, onTap: (_) {}, @@ -75,7 +74,6 @@ void main() { child: SegmentedBarOverlay( bar: SegmentedBar( key: const Key('own-header'), - cupertino: false, automaticallyImplyLeading: false, title: 'Own header', ), diff --git a/app/test/shell/tab_history_back_test.dart b/app/test/shell/tab_history_back_test.dart index 7ed38450..fd5d2736 100644 --- a/app/test/shell/tab_history_back_test.dart +++ b/app/test/shell/tab_history_back_test.dart @@ -220,7 +220,6 @@ void main() { }; router = AppRouterDelegate( initial: AppRoute.runs, - cupertino: false, builder: (_, route) => AdaptiveShell( destination: destinationOf(route), onDestinationSelected: (value) => router.goTo(routeOf(value)), diff --git a/app/test/shell/window_margins_shell_test.dart b/app/test/shell/window_margins_shell_test.dart index 66ff3868..c55963d6 100644 --- a/app/test/shell/window_margins_shell_test.dart +++ b/app/test/shell/window_margins_shell_test.dart @@ -148,7 +148,6 @@ void main() { ) async { await setSize(tester, const Size(1280, 800)); final bar = SegmentedBar( - cupertino: false, title: 'Settings', actions: const [Icon(Icons.more_vert, semanticLabel: 'More')], ); diff --git a/app/test/ui/adaptive/floating_bar_geometry_test.dart b/app/test/ui/adaptive/floating_bar_geometry_test.dart index f5fc7ac5..89900bcd 100644 --- a/app/test/ui/adaptive/floating_bar_geometry_test.dart +++ b/app/test/ui/adaptive/floating_bar_geometry_test.dart @@ -18,12 +18,10 @@ void main() { Key tabKey(int index) => ValueKey('tab-$index'); Widget bar({ - required bool cupertino, required int count, required int selected, ValueChanged? onTap, }) => FloatingDestinationBar( - cupertino: cupertino, currentIndex: selected, onTap: onTap ?? (_) {}, items: [ @@ -38,7 +36,6 @@ void main() { Future pump( WidgetTester tester, { - required bool cupertino, required Size size, required Widget child, double textScale = 1, @@ -76,10 +73,9 @@ void main() { ]; { - const cupertino = false; const host = 'Material'; - final diameter = FloatingDestinationBar.buttonSize(cupertino: cupertino); - final gap = FloatingDestinationBar.buttonGap(cupertino: cupertino); + final diameter = FloatingDestinationBar.buttonSize(); + final gap = FloatingDestinationBar.buttonGap(); final iconSize = FloatingDestinationBar.materialIconSize; test('$host: buttons are larger than the old 44/42 circle, hit targets ' @@ -93,11 +89,10 @@ void main() { 'centred in it', (tester) async { await pump( tester, - cupertino: cupertino, size: const Size(390, 844), child: Align( alignment: Alignment.bottomCenter, - child: bar(cupertino: cupertino, count: 3, selected: 0), + child: bar(count: 3, selected: 0), ), ); expect( @@ -111,7 +106,7 @@ void main() { final circle = button(tester, index); // Tab 0 is selected: its whole button is larger than the others. final across = index == 0 - ? FloatingDestinationBar.selectedButtonSize(cupertino: cupertino) + ? FloatingDestinationBar.selectedButtonSize() : diameter; expect(circle.width, moreOrLessEquals(across)); expect(circle.height, moreOrLessEquals(across)); @@ -129,10 +124,8 @@ void main() { final icon = tester.getRect(find.byIcon(icons[index])); final side = index == 0 ? iconSize * - FloatingDestinationBar.selectedButtonSize( - cupertino: cupertino, - ) / - FloatingDestinationBar.buttonSize(cupertino: cupertino) + FloatingDestinationBar.selectedButtonSize() / + FloatingDestinationBar.buttonSize() : iconSize; expect(icon.width, moreOrLessEquals(side)); expect(icon.height, moreOrLessEquals(side)); @@ -147,11 +140,10 @@ void main() { final size = placement.size; await pump( tester, - cupertino: cupertino, size: size, child: Align( alignment: Alignment.bottomCenter, - child: bar(cupertino: cupertino, count: count, selected: 0), + child: bar(count: count, selected: 0), ), ); final box = row(tester); @@ -160,15 +152,11 @@ void main() { // As tall as the selected (larger) button. expect( box.height, - moreOrLessEquals( - FloatingDestinationBar.selectedButtonSize(cupertino: cupertino), - ), + moreOrLessEquals(FloatingDestinationBar.selectedButtonSize()), ); expect( box.width, - moreOrLessEquals( - FloatingDestinationBar.rowWidth(cupertino: cupertino, tabs: count), - ), + moreOrLessEquals(FloatingDestinationBar.rowWidth(tabs: count)), ); expect(button(tester, 0).left, box.left); expect(button(tester, count - 1).right, box.right); @@ -192,14 +180,12 @@ void main() { // The shell's wide placement: under the list pane, centred in it. await pump( tester, - cupertino: cupertino, size: const Size(1280, 800), child: Align( alignment: AlignmentDirectional.bottomStart, child: SizedBox( width: listWidth, child: FloatingDestinationBar( - cupertino: cupertino, currentIndex: 1, onTap: (_) {}, alignment: Alignment.bottomCenter, @@ -221,12 +207,7 @@ void main() { expect( box.center.dy, moreOrLessEquals( - 800 - - 16 - - FloatingDestinationBar.selectedButtonSize( - cupertino: cupertino, - ) / - 2, + 800 - 16 - FloatingDestinationBar.selectedButtonSize() / 2, ), ); expect(box.left, greaterThanOrEqualTo(16 - 0.01)); @@ -235,8 +216,7 @@ void main() { expect( button(tester, 1).width / button(tester, 0).width, moreOrLessEquals( - FloatingDestinationBar.selectedButtonSize(cupertino: cupertino) / - diameter, + FloatingDestinationBar.selectedButtonSize() / diameter, ), ); expect(tester.takeException(), isNull); @@ -249,7 +229,6 @@ void main() { var content = 0; await pump( tester, - cupertino: cupertino, size: const Size(390, 844), child: Stack( children: [ @@ -261,12 +240,7 @@ void main() { ), Align( alignment: Alignment.bottomCenter, - child: bar( - cupertino: cupertino, - count: 3, - selected: 1, - onTap: tapped.add, - ), + child: bar(count: 3, selected: 1, onTap: tapped.add), ), ], ), @@ -287,12 +261,11 @@ void main() { 'stay within the margins', (tester) async { await pump( tester, - cupertino: cupertino, size: const Size(320, 640), textScale: 2, child: Align( alignment: Alignment.bottomCenter, - child: bar(cupertino: cupertino, count: 5, selected: 4), + child: bar(count: 5, selected: 4), ), ); expect(tester.takeException(), isNull); @@ -300,9 +273,7 @@ void main() { expect(box.right, 320 - 16); expect(box.left, greaterThanOrEqualTo(16)); // Tab 4 is selected and larger; the gaps narrow around it. - final selected = FloatingDestinationBar.selectedButtonSize( - cupertino: cupertino, - ); + final selected = FloatingDestinationBar.selectedButtonSize(); final narrowed = (288 - 4 * diameter - selected) / 4; for (var index = 1; index < 5; index += 1) { expect( @@ -320,13 +291,12 @@ void main() { 'reads from the right', (tester) async { await pump( tester, - cupertino: cupertino, size: const Size(390, 844), child: Directionality( textDirection: TextDirection.rtl, child: Align( alignment: Alignment.bottomCenter, - child: bar(cupertino: cupertino, count: 3, selected: 0), + child: bar(count: 3, selected: 0), ), ), ); diff --git a/app/test/ui/adaptive/floating_bar_layout_test.dart b/app/test/ui/adaptive/floating_bar_layout_test.dart index 7732b0fb..d38024b6 100644 --- a/app/test/ui/adaptive/floating_bar_layout_test.dart +++ b/app/test/ui/adaptive/floating_bar_layout_test.dart @@ -12,7 +12,6 @@ void main() { home: Scaffold( body: FloatingBarOverlay( bar: FloatingDestinationBar( - cupertino: false, currentIndex: 0, onTap: (_) {}, items: const [ diff --git a/app/test/ui/adaptive/floating_destination_labels_test.dart b/app/test/ui/adaptive/floating_destination_labels_test.dart index 619bf449..5075ba25 100644 --- a/app/test/ui/adaptive/floating_destination_labels_test.dart +++ b/app/test/ui/adaptive/floating_destination_labels_test.dart @@ -16,7 +16,6 @@ void main() { children: [ TextField(focusNode: focus), FloatingDestinationBar( - cupertino: false, currentIndex: 0, showLabels: true, items: const [ diff --git a/app/test/ui/adaptive/floating_tab_motion_test.dart b/app/test/ui/adaptive/floating_tab_motion_test.dart index 5f5dba9b..8c09bd66 100644 --- a/app/test/ui/adaptive/floating_tab_motion_test.dart +++ b/app/test/ui/adaptive/floating_tab_motion_test.dart @@ -49,7 +49,6 @@ void main() { builder: (context, setState) => Align( alignment: Alignment.bottomCenter, child: FloatingDestinationBar( - cupertino: false, currentIndex: selected, onTap: (index) => setState(() => selected = index), items: items(count), @@ -95,7 +94,7 @@ void main() { } final host = 'Material'; - final size = FloatingDestinationBar.buttonSize(cupertino: false); + final size = FloatingDestinationBar.buttonSize(); final iconSize = FloatingDestinationBar.materialIconSize; testWidgets('$host: each button pops in on its own, staggered, from ' @@ -106,7 +105,7 @@ void main() { final tab = find.byKey(tabKey(index)); expect(opacityOf(tester, tab), 0); final rest = index == 0 - ? FloatingDestinationBar.selectedButtonSize(cupertino: false) + ? FloatingDestinationBar.selectedButtonSize() : size; expect(widthOf(tester, tab), moreOrLessEquals(rest * 0.6)); } @@ -123,9 +122,7 @@ void main() { // Tab 0 is selected, so it settles at the larger size. expect( widthOf(tester, tab), - index == 0 - ? FloatingDestinationBar.selectedButtonSize(cupertino: false) - : size, + index == 0 ? FloatingDestinationBar.selectedButtonSize() : size, ); } }); @@ -168,7 +165,6 @@ void main() { return Align( alignment: Alignment.bottomCenter, child: FloatingDestinationBar( - cupertino: false, currentIndex: 0, onTap: (_) {}, items: items(count), @@ -219,8 +215,8 @@ void main() { iconWidth(tester, 2), moreOrLessEquals( iconSize * - FloatingDestinationBar.selectedButtonSize(cupertino: false) / - FloatingDestinationBar.buttonSize(cupertino: false), + FloatingDestinationBar.selectedButtonSize() / + FloatingDestinationBar.buttonSize(), ), ); expect(iconWidth(tester, 0), moreOrLessEquals(iconSize)); @@ -251,15 +247,12 @@ void main() { // Tab 0 is selected, so it is the larger button; the press leaves it. expect( widthOf(tester, find.byKey(tabKey(0))), - FloatingDestinationBar.selectedButtonSize(cupertino: false), + FloatingDestinationBar.selectedButtonSize(), ); await gesture.up(); await tester.pumpAndSettle(); // The tap selected it: it springs back to the selected size. - expect( - widthOf(tester, tab), - FloatingDestinationBar.selectedButtonSize(cupertino: false), - ); + expect(widthOf(tester, tab), FloatingDestinationBar.selectedButtonSize()); }); testWidgets('$host: under reduced motion the tint jumps and the buttons ' @@ -280,8 +273,8 @@ void main() { iconWidth(tester, 2), moreOrLessEquals( iconSize * - FloatingDestinationBar.selectedButtonSize(cupertino: false) / - FloatingDestinationBar.buttonSize(cupertino: false), + FloatingDestinationBar.selectedButtonSize() / + FloatingDestinationBar.buttonSize(), ), ); expect(iconWidth(tester, 0), moreOrLessEquals(iconSize)); @@ -289,7 +282,7 @@ void main() { testWidgets('switching the shell tabs never replays the main ' "bar's entrance", (tester) async { - final size = FloatingDestinationBar.buttonSize(cupertino: false); + final size = FloatingDestinationBar.buttonSize(); animate(tester, on: true); var destination = AppDestination.runs; final shell = StatefulBuilder( diff --git a/app/test/ui/adaptive/glass_backdrop_group_test.dart b/app/test/ui/adaptive/glass_backdrop_group_test.dart index 2ab396a8..ffe74251 100644 --- a/app/test/ui/adaptive/glass_backdrop_group_test.dart +++ b/app/test/ui/adaptive/glass_backdrop_group_test.dart @@ -17,7 +17,6 @@ void main() { home: Scaffold( extendBodyBehindAppBar: true, appBar: SegmentedBar( - cupertino: false, title: 'Release train run', subtitle: 'Run 7', expandableTitle: true, @@ -49,7 +48,7 @@ void main() { testWidgets('a lone piece reads the backdrop on its own', (tester) async { await tester.pumpWidget( const MaterialApp( - home: Center(child: GlassPill(cupertino: false, child: Text('Tabs'))), + home: Center(child: GlassPill(child: Text('Tabs'))), ), ); expect(_keys(tester), [isNull]); diff --git a/app/test/ui/adaptive/glass_bar_test.dart b/app/test/ui/adaptive/glass_bar_test.dart index a29af14a..7f4ce40b 100644 --- a/app/test/ui/adaptive/glass_bar_test.dart +++ b/app/test/ui/adaptive/glass_bar_test.dart @@ -139,7 +139,7 @@ void main() { if (count > 1) { _expectEvenNeighbours(controls.sublist(controls.length - 2)); } - expect(pill.height, closeTo(GlassBarMetrics.height(false), 1)); + expect(pill.height, closeTo(GlassBarMetrics.height(), 1)); expect(tester.takeException(), isNull); } }); @@ -240,7 +240,7 @@ void main() { // The controls keep to the field's last line: each end control is as // far from the pill's side as from its bottom, and while the field is // one line (no taller than a control) as far from its top. - final row = GlassBarMetrics.controlExtent(false); + final row = GlassBarMetrics.controlExtent(); final oneLine = pill.height <= row + 2 * GlassBarMetrics.fieldEdgeGap + 0.5; for (final (control, start) in [(attach, true), (send, false)]) { @@ -273,11 +273,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: Scaffold( - appBar: SegmentedBar( - cupertino: false, - title: 'Title', - actions: actions, - ), + appBar: SegmentedBar(title: 'Title', actions: actions), ), ), ); @@ -307,16 +303,13 @@ void _expectPager(WidgetTester tester, Finder inside, Finder position) { _expectEvenNeighbours(controls); final text = tester.getRect(position); final gap = (pill.height - last.height) / 2; - expect( - text.left - pill.left, - closeTo(gap + GlassBarMetrics.iconInset(false), 1), - ); + expect(text.left - pill.left, closeTo(gap + GlassBarMetrics.iconInset(), 1)); // The chevrons keep the same gap from the position as from each other's // icons: one icon inset on each side. expect( controls.first.left - text.right, - greaterThanOrEqualTo(GlassBarMetrics.iconInset(false) - 1), + greaterThanOrEqualTo(GlassBarMetrics.iconInset() - 1), ); - expect(pill.height, closeTo(GlassBarMetrics.height(false), 1)); + expect(pill.height, closeTo(GlassBarMetrics.height(), 1)); expect(tester.takeException(), isNull); } diff --git a/app/test/ui/adaptive/glass_surface_test.dart b/app/test/ui/adaptive/glass_surface_test.dart index 171dd132..25fe8dbe 100644 --- a/app/test/ui/adaptive/glass_surface_test.dart +++ b/app/test/ui/adaptive/glass_surface_test.dart @@ -9,9 +9,7 @@ Widget _pill({Brightness brightness = Brightness.light, bool solid = false}) => theme: ThemeData(brightness: brightness), home: MediaQuery( data: MediaQueryData(highContrast: solid), - child: const Center( - child: GlassPill(cupertino: false, child: Text('Runs')), - ), + child: const Center(child: GlassPill(child: Text('Runs'))), ), ); diff --git a/app/test/ui/adaptive/platform_test.dart b/app/test/ui/adaptive/platform_test.dart index 88e9a8a3..3fcccca8 100644 --- a/app/test/ui/adaptive/platform_test.dart +++ b/app/test/ui/adaptive/platform_test.dart @@ -1,23 +1,16 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/application/app.dart'; -import 'package:pipelines_app/ui/adaptive/platform.dart'; import 'package:pipelines_app/ui/theme/app_theme.dart'; void main() { - test('no platform prefers the Cupertino host', () { - expect(prefersCupertino(), isFalse); - }); - for (final platform in TargetPlatform.values) { testWidgets('the app uses the Material host on $platform', (tester) async { debugDefaultTargetPlatformOverride = platform; addTearDown(() => debugDefaultTargetPlatformOverride = null); await tester.pumpWidget(const MyApp()); expect(find.byType(MaterialApp), findsOneWidget); - expect(find.byType(CupertinoApp), findsNothing); // Native hosts keep the target platform so Flutter's automatic // behaviours (scroll physics, text selection, back-swipe) still apply. final expected = kIsWeb ? TargetPlatform.android : platform; diff --git a/app/test/ui/adaptive/segmented_bar_entrance_test.dart b/app/test/ui/adaptive/segmented_bar_entrance_test.dart index 2b80bf1d..5a4e8de9 100644 --- a/app/test/ui/adaptive/segmented_bar_entrance_test.dart +++ b/app/test/ui/adaptive/segmented_bar_entrance_test.dart @@ -7,21 +7,15 @@ import 'package:pipelines_app/ui/motion/motion.dart'; /// Every piece of the top bar (Back, the title, the actions pill and each /// action in it) pops in with the tab buttons' entrance, once. void main() { - Widget page( - bool cupertino, { + Widget page({ String title = 'Runs', List actions = const [], Object? actionsKey, bool reduced = false, }) { final bar = SegmentedBar( - cupertino: cupertino, title: title, - leading: SegmentedBackButton( - key: const Key('back'), - cupertino: cupertino, - onPressed: () {}, - ), + leading: SegmentedBackButton(key: const Key('back'), onPressed: () {}), actions: actions, actionsKey: actionsKey, ); @@ -56,7 +50,6 @@ void main() { const step = Motion.tabEntranceStagger; { - const cupertino = false; const host = 'Material'; const icon = Icons.refresh; Widget action(String key) => @@ -67,9 +60,7 @@ void main() { testWidgets('$host: each piece pops in turn, left to right, from 0.6', ( tester, ) async { - await tester.pumpWidget( - page(cupertino, actions: [action('a'), action('b')]), - ); + await tester.pumpWidget(page(actions: [action('a'), action('b')])); expect(scaleOf(tester, back), begin); expect(scaleOf(tester, title), begin); expect(scaleOf(tester, a), begin, reason: 'the pill'); @@ -104,7 +95,7 @@ void main() { testWidgets('$host: a lone action pops as its pill, not twice', ( tester, ) async { - await tester.pumpWidget(page(cupertino, actions: [action('a')])); + await tester.pumpWidget(page(actions: [action('a')])); expect(scaleOf(tester, a), begin); expect(scaleOf(tester, a, inner: true), 1); await tester.pump(step * 2 + const Duration(milliseconds: 40)); @@ -117,11 +108,9 @@ void main() { testWidgets('$host: a rebuild or new title does not replay it', ( tester, ) async { - await tester.pumpWidget(page(cupertino, actions: [action('a')])); + await tester.pumpWidget(page(actions: [action('a')])); await tester.pumpAndSettle(); - await tester.pumpWidget( - page(cupertino, title: 'Other', actions: [action('a')]), - ); + await tester.pumpWidget(page(title: 'Other', actions: [action('a')])); await tester.pump(); expect(scaleOf(tester, back), 1); expect(scaleOf(tester, find.text('Other')), 1); @@ -133,11 +122,9 @@ void main() { testWidgets('$host: an action that becomes available pops in alone', ( tester, ) async { - await tester.pumpWidget(page(cupertino, actions: [action('a')])); + await tester.pumpWidget(page(actions: [action('a')])); await tester.pumpAndSettle(); - await tester.pumpWidget( - page(cupertino, actions: [action('b'), action('a')]), - ); + await tester.pumpWidget(page(actions: [action('b'), action('a')])); expect(scaleOf(tester, b, inner: true), begin); // The pill, the action already there and the rest stay put. expect(scaleOf(tester, a), 1); @@ -154,21 +141,16 @@ void main() { tester, ) async { final list = Object(); - await tester.pumpWidget( - page(cupertino, actionsKey: list, actions: [action('a')]), - ); + await tester.pumpWidget(page(actionsKey: list, actions: [action('a')])); await tester.pumpAndSettle(); // The same screen republishing its bar is not a new entrance. - await tester.pumpWidget( - page(cupertino, actionsKey: list, actions: [action('a')]), - ); + await tester.pumpWidget(page(actionsKey: list, actions: [action('a')])); await tester.pump(); expect(tester.hasRunningAnimations, isFalse); // Another screen's actions are new, though keyed alike; Back, the // title and the pill stay. await tester.pumpWidget( page( - cupertino, title: 'Chats', actionsKey: Object(), actions: [action('a'), action('b')], @@ -189,11 +171,9 @@ void main() { testWidgets('$host: a pill arriving later pops, then its actions', ( tester, ) async { - await tester.pumpWidget(page(cupertino)); + await tester.pumpWidget(page()); await tester.pumpAndSettle(); - await tester.pumpWidget( - page(cupertino, actions: [action('a'), action('b')]), - ); + await tester.pumpWidget(page(actions: [action('a'), action('b')])); expect(scaleOf(tester, back), 1); await tester.pump(const Duration(milliseconds: 20)); expect(scaleOf(tester, a), greaterThan(begin), reason: 'at once'); @@ -206,7 +186,7 @@ void main() { testWidgets('$host: reduced motion shows the bar at once', (tester) async { await tester.pumpWidget( - page(cupertino, actions: [action('a'), action('b')], reduced: true), + page(actions: [action('a'), action('b')], reduced: true), ); expect(scaleOf(tester, back), 1); expect(scaleOf(tester, title), 1); diff --git a/app/test/ui/adaptive/segmented_bar_motion_test.dart b/app/test/ui/adaptive/segmented_bar_motion_test.dart index d7aba5bc..791d6b50 100644 --- a/app/test/ui/adaptive/segmented_bar_motion_test.dart +++ b/app/test/ui/adaptive/segmented_bar_motion_test.dart @@ -10,8 +10,7 @@ import 'package:pipelines_app/ui/motion/motion.dart'; /// The top bar's glass fades in with its blur, and its controls sink when /// pressed (its entrance is in segmented_bar_entrance_test.dart). void main() { - Widget page( - bool cupertino, { + Widget page({ String title = 'Runs', List actions = const [], VoidCallback? onTitle, @@ -19,12 +18,10 @@ void main() { VoidCallback? onBack, }) { final bar = SegmentedBar( - cupertino: cupertino, title: title, onTitlePressed: onTitle, leading: SegmentedBackButton( key: const Key('back'), - cupertino: cupertino, onPressed: onBack ?? () {}, ), actions: actions, @@ -70,7 +67,6 @@ void main() { final title = find.text('Runs'); { - const cupertino = false; const host = 'Material'; const icon = Icons.refresh; Widget action(String key) => @@ -79,7 +75,7 @@ void main() { testWidgets('$host: the glass fades in with its blur, not under a layer', ( tester, ) async { - await tester.pumpWidget(page(cupertino)); + await tester.pumpWidget(page()); // Back and the title are both still popping in. await tester.pump(const Duration(milliseconds: 100)); final backdrops = tester.layers.whereType().toList(); @@ -106,7 +102,7 @@ void main() { '$host: Back sinks and tints while pressed, then springs back', (tester) async { var backs = 0; - await tester.pumpWidget(page(cupertino, onBack: () => backs++)); + await tester.pumpWidget(page(onBack: () => backs++)); await tester.pumpAndSettle(); expect(pressScale(tester, back), 1); expect(pressTint(tester, back).a, 0); @@ -126,7 +122,7 @@ void main() { testWidgets('$host: a quick tap still shows the whole press', ( tester, ) async { - await tester.pumpWidget(page(cupertino, actions: [action('a')])); + await tester.pumpWidget(page(actions: [action('a')])); await tester.pumpAndSettle(); final a = find.byKey(const Key('a')); await tester.tap(a); @@ -144,11 +140,7 @@ void main() { ) async { var taps = 0; await tester.pumpWidget( - page( - cupertino, - onTitle: () => taps++, - actions: [action('a'), action('b')], - ), + page(onTitle: () => taps++, actions: [action('a'), action('b')]), ); await tester.pumpAndSettle(); final a = find.byKey(const Key('a')); @@ -168,13 +160,13 @@ void main() { }); testWidgets('$host: hit testing is unchanged at rest', (tester) async { - await tester.pumpWidget(page(cupertino, actions: [action('a')])); + await tester.pumpWidget(page(actions: [action('a')])); await tester.pumpAndSettle(); final pill = tester.getRect( find.ancestor(of: back, matching: find.byType(GlassPill)).first, ); expect(pill.left, 12); - expect(pill.height, segmentedPieceHeight(cupertino)); + expect(pill.height, segmentedPieceHeight()); // A tap between the pieces reaches no piece; on Back it reaches Back. final backBox = tester.renderObject(back); bool hitsBack(Offset at) => diff --git a/app/test/ui/adaptive/segmented_bar_overflow_test.dart b/app/test/ui/adaptive/segmented_bar_overflow_test.dart index a1501236..16e623d8 100644 --- a/app/test/ui/adaptive/segmented_bar_overflow_test.dart +++ b/app/test/ui/adaptive/segmented_bar_overflow_test.dart @@ -14,7 +14,7 @@ const _names = ['Needs you', 'Usage', 'Filter', 'Sort', 'Select']; Key _key(String name) => ValueKey('action.$name'); /// An icon action like the list bars' own, at the host's touch target. -Widget _icon(bool cupertino, String name, VoidCallback onPressed) => IconButton( +Widget _icon(String name, VoidCallback onPressed) => IconButton( key: _key(name), tooltip: name, onPressed: onPressed, @@ -22,10 +22,10 @@ Widget _icon(bool cupertino, String name, VoidCallback onPressed) => IconButton( ); /// The Runs bar's shape: a bell that always stays, then four that may move. -List _actions(bool cupertino, List pressed) => [ +List _actions(List pressed) => [ for (final name in _names) if (name == 'Needs you') - _icon(cupertino, name, () => pressed.add(name)) + _icon(name, () => pressed.add(name)) else SegmentedOverflowAction( overflowEntry: SegmentedOverflowEntry( @@ -33,19 +33,18 @@ List _actions(bool cupertino, List pressed) => [ icon: Icons.circle_outlined, onPressed: () => pressed.add(name), ), - child: _icon(cupertino, name, () => pressed.add(name)), + child: _icon(name, () => pressed.add(name)), ), ]; -Widget _app(bool cupertino, SegmentedBar bar, {Brightness? brightness}) => - MaterialApp( - theme: ThemeData(brightness: brightness ?? Brightness.light), - home: Scaffold( - extendBodyBehindAppBar: true, - appBar: bar, - body: const SizedBox.expand(), - ), - ); +Widget _app(SegmentedBar bar, {Brightness? brightness}) => MaterialApp( + theme: ThemeData(brightness: brightness ?? Brightness.light), + home: Scaffold( + extendBodyBehindAppBar: true, + appBar: bar, + body: const SizedBox.expand(), + ), +); /// Pumps the bar and the frame its More menu settles in. Future _pump(WidgetTester tester, Widget app) async { @@ -66,7 +65,6 @@ bool _whole(WidgetTester tester, String text) { void main() { { - const cupertino = false; const host = 'Material'; for (final width in [240.0, 270.0, 320.0]) { for (final brightness in Brightness.values) { @@ -79,13 +77,8 @@ void main() { await _pump( tester, _app( - cupertino, brightness: brightness, - SegmentedBar( - cupertino: cupertino, - title: 'Runs', - actions: _actions(cupertino, pressed), - ), + SegmentedBar(title: 'Runs', actions: _actions(pressed)), ), ); expect(tester.takeException(), isNull); @@ -139,14 +132,7 @@ void main() { _size(tester, 800); await _pump( tester, - _app( - cupertino, - SegmentedBar( - cupertino: cupertino, - title: 'Runs', - actions: _actions(cupertino, []), - ), - ), + _app(SegmentedBar(title: 'Runs', actions: _actions([]))), ); for (final name in _names) { expect(find.byKey(_key(name)).hitTestable(), findsOneWidget); @@ -162,14 +148,7 @@ void main() { _size(tester, 240); await _pump( tester, - _app( - cupertino, - SegmentedBar( - cupertino: cupertino, - title: 'Pipelines', - actions: _actions(cupertino, []), - ), - ), + _app(SegmentedBar(title: 'Pipelines', actions: _actions([]))), ); expect(tester.takeException(), isNull); // The test font's glyphs are squares, wider than a real font's, so @@ -189,9 +168,7 @@ void main() { await _pump( tester, _app( - cupertino, SegmentedBar( - cupertino: cupertino, title: 'Runs', actions: [ for (final name in ['A', 'B', 'C']) @@ -208,7 +185,7 @@ void main() { ), ], ), - child: _icon(cupertino, name, () {}), + child: _icon(name, () {}), ), ], ), diff --git a/app/test/ui/adaptive/segmented_bar_test.dart b/app/test/ui/adaptive/segmented_bar_test.dart index 8fb0b721..6ac9f3e7 100644 --- a/app/test/ui/adaptive/segmented_bar_test.dart +++ b/app/test/ui/adaptive/segmented_bar_test.dart @@ -47,7 +47,6 @@ void main() { home: Scaffold( extendBodyBehindAppBar: true, appBar: SegmentedBar( - cupertino: false, leading: const BackButton(), title: 'A conversation with a rather long title indeed', subtitle: 'tank', @@ -69,8 +68,7 @@ void main() { testWidgets('320px at 2x text lays out without overflow', (tester) async { _size(tester, 320, scale: 2); final bar = SegmentedBar( - cupertino: false, - leading: SegmentedBackButton(cupertino: false, onPressed: () {}), + leading: SegmentedBackButton(onPressed: () {}), title: 'A long conversation title', subtitle: 'a-working-folder', subtitleIcon: Icons.folder_outlined, @@ -103,7 +101,6 @@ void main() { home: Scaffold( extendBodyBehindAppBar: true, appBar: SegmentedBar( - cupertino: false, leading: BackButton(onPressed: () => back++), title: 'Short', ), @@ -130,7 +127,7 @@ void main() { MaterialApp( home: Scaffold( body: SegmentedBarOverlay( - bar: const SegmentedBar(cupertino: false, title: 'Overlay'), + bar: const SegmentedBar(title: 'Overlay'), child: ListView( children: const [ListTile(title: Text('First row'))], ), @@ -152,7 +149,7 @@ void main() { home: MediaQuery( data: MediaQueryData(highContrast: highContrast), child: Scaffold( - appBar: const SegmentedBar(cupertino: false, title: 'Glass'), + appBar: const SegmentedBar(title: 'Glass'), body: const SizedBox.expand(), ), ), @@ -170,7 +167,7 @@ void main() { await tester.pumpWidget( const MaterialApp( home: Scaffold( - appBar: SegmentedBar(cupertino: false, title: 'Title'), + appBar: SegmentedBar(title: 'Title'), body: SizedBox.expand(), ), ), diff --git a/app/test/ui/adaptive/segmented_bar_title_widget_test.dart b/app/test/ui/adaptive/segmented_bar_title_widget_test.dart index 09f2b499..86df2900 100644 --- a/app/test/ui/adaptive/segmented_bar_title_widget_test.dart +++ b/app/test/ui/adaptive/segmented_bar_title_widget_test.dart @@ -41,7 +41,6 @@ void main() { await tester.pumpWidget( page( SegmentedBar( - cupertino: false, title: 'Search', titleWidget: field, titleWidgetMaxWidth: 840, @@ -71,9 +70,8 @@ void main() { await tester.pumpWidget( page( SegmentedBar( - cupertino: false, title: 'Search', - leading: SegmentedBackButton(cupertino: false, onPressed: () {}), + leading: SegmentedBackButton(onPressed: () {}), titleWidget: field, titleWidgetMaxWidth: 600, actions: const [Icon(Icons.info_outline, key: Key('action'))], diff --git a/app/test/ui/adaptive/top_bar_clearance_test.dart b/app/test/ui/adaptive/top_bar_clearance_test.dart index 60524023..e40562d3 100644 --- a/app/test/ui/adaptive/top_bar_clearance_test.dart +++ b/app/test/ui/adaptive/top_bar_clearance_test.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/ui/adaptive/floating_bar_layout.dart'; @@ -23,13 +22,8 @@ void main() { ), ); - Widget page(Widget body, {bool cupertino = false}) { - final bar = SegmentedBar(cupertino: cupertino, title: 'Page'); - if (cupertino) { - return CupertinoApp( - home: CupertinoPageScaffold(navigationBar: bar, child: body), - ); - } + Widget page(Widget body) { + final bar = SegmentedBar(title: 'Page'); return MaterialApp( home: Scaffold(extendBodyBehindAppBar: true, appBar: bar, body: body), ); @@ -46,13 +40,13 @@ void main() { ), ); - for (final cupertino in [false, true]) { - final host = cupertino ? 'Cupertino' : 'Material'; + { + const host = 'Material'; testWidgets('$host: a list reaches the top edge, starts below the bar at ' 'rest and scrolls behind it', (tester) async { await setSize(tester, const Size(390, 844)); - await tester.pumpWidget(page(rows(), cupertino: cupertino)); + await tester.pumpWidget(page(rows())); expect(tester.getTopLeft(find.byKey(const Key('list'))).dy, 0); final bar = barRect(tester); @@ -162,7 +156,6 @@ void main() { child: FloatingBarOverlay( edge: FloatingBarEdge.top, bar: FloatingDestinationBar( - cupertino: false, edge: FloatingBarEdge.top, currentIndex: 0, onTap: (_) {}, diff --git a/app/test/ui/adaptive/window_controls_test.dart b/app/test/ui/adaptive/window_controls_test.dart index 9ea8abdd..90733f7c 100644 --- a/app/test/ui/adaptive/window_controls_test.dart +++ b/app/test/ui/adaptive/window_controls_test.dart @@ -18,7 +18,7 @@ void _window(WidgetTester tester, {double top = 10, double width = 800}) { } SegmentedBar _bar({String title = 'Chat', List actions = const []}) => - SegmentedBar(cupertino: false, title: title, actions: actions); + SegmentedBar(title: title, actions: actions); Widget _page(SegmentedBar bar, {ValueListenable? controls}) { final page = Scaffold( diff --git a/app/test/ui/layout/app_list_row_test.dart b/app/test/ui/layout/app_list_row_test.dart index 8f2962f9..0faa92f5 100644 --- a/app/test/ui/layout/app_list_row_test.dart +++ b/app/test/ui/layout/app_list_row_test.dart @@ -138,7 +138,7 @@ void main() { final context = tester.element(row); expect( tester.widget(surface).color, - AppListRow.selectedColor(context, cupertino: false), + AppListRow.selectedColor(context), ); final accent = Theme.of(context).colorScheme.primary; expect(_paint(tester, 'Fixture run').fontWeight, FontWeight.w700); diff --git a/app/test/ui/motion/container_transform_route_test.dart b/app/test/ui/motion/container_transform_route_test.dart index f984fc8a..222f3924 100644 --- a/app/test/ui/motion/container_transform_route_test.dart +++ b/app/test/ui/motion/container_transform_route_test.dart @@ -31,7 +31,6 @@ class _List extends StatelessWidget { onTap: () => Navigator.of(context).push( ContainerTransformPageRoute( link: sources.link(() => id), - cupertino: false, builder: (_) => _Page(id: id), ), ), @@ -172,7 +171,6 @@ void main() { navigator.push( ContainerTransformPageRoute( link: sources.link(() => 'missing'), - cupertino: false, builder: (_) => const _Page(id: 'x'), ), ); diff --git a/app/test/ui/navigation/bar_icon_button_test.dart b/app/test/ui/navigation/bar_icon_button_test.dart index 455371eb..3bb09a1c 100644 --- a/app/test/ui/navigation/bar_icon_button_test.dart +++ b/app/test/ui/navigation/bar_icon_button_test.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/ui/input/app_search_field.dart'; @@ -14,7 +13,6 @@ Widget _row(List children) { BarIconButton _action(Key key, {bool busy = false}) => BarIconButton( key: key, icon: Icons.refresh, - cupertinoIcon: CupertinoIcons.refresh, label: 'Refresh', busy: busy, onPressed: () {}, diff --git a/app/test/ui/theme/app_theme_test.dart b/app/test/ui/theme/app_theme_test.dart index ca7ce743..247b0d6b 100644 --- a/app/test/ui/theme/app_theme_test.dart +++ b/app/test/ui/theme/app_theme_test.dart @@ -19,13 +19,12 @@ void main() { } }); - test('page backgrounds are gray in dark mode and unchanged in light', () { - expect(AppColors.background.darkColor, const Color(0xFF141416)); - expect(AppColors.background.color, const Color(0xFFFFFFFF)); - expect( - AppColors.groupedBackground.darkColor, - isNot(const Color(0xFF000000)), - ); + test('page backgrounds use their Material surface roles', () { + final dark = appDarkTheme(); + final light = appLightTheme(); + expect(dark.scaffoldBackgroundColor, dark.colorScheme.surface); + expect(light.scaffoldBackgroundColor, light.colorScheme.surface); + expect(dark.colorScheme.surface, isNot(const Color(0xFF000000))); }); test('Android pages retain native predictive Back in both themes', () { diff --git a/app/tool/app_host_probe_entry.dart b/app/tool/app_host_probe_entry.dart index dd0a47e5..7bfb985a 100644 --- a/app/tool/app_host_probe_entry.dart +++ b/app/tool/app_host_probe_entry.dart @@ -16,9 +16,6 @@ import 'package:pipelines_app/application/server_endpoint.dart'; void main() { useAppUrlStrategy(); runApp( - PipelinesApp( - server: ServerEndpoint.resolve(base: Uri.base, web: true), - cupertino: false, - ), + PipelinesApp(server: ServerEndpoint.resolve(base: Uri.base, web: true)), ); } diff --git a/app/tool/template_create_probe.dart b/app/tool/template_create_probe.dart index a8dfc7b1..7def1d1c 100644 --- a/app/tool/template_create_probe.dart +++ b/app/tool/template_create_probe.dart @@ -120,7 +120,6 @@ class _ProbeHomeState extends State<_ProbeHome> { context: context, template: _template, repository: TemplateRepository(_gateway), - cupertino: false, onCreated: (detail) { _gateway.created.add(detail); _publish(); diff --git a/app/tool/templates_wiring_probe_entry.dart b/app/tool/templates_wiring_probe_entry.dart index ae59729a..14e93ea6 100644 --- a/app/tool/templates_wiring_probe_entry.dart +++ b/app/tool/templates_wiring_probe_entry.dart @@ -11,9 +11,6 @@ import 'package:pipelines_app/application/server_endpoint.dart'; void main() { useAppUrlStrategy(); runApp( - PipelinesApp( - server: ServerEndpoint.resolve(base: Uri.base, web: true), - cupertino: false, - ), + PipelinesApp(server: ServerEndpoint.resolve(base: Uri.base, web: true)), ); }