Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s
60 lines
1.8 KiB
Dart
60 lines
1.8 KiB
Dart
import 'package:cutdex_ui/icons.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../l10n/l10n.dart';
|
|
|
|
import '../../workspace/workspace_mode.dart';
|
|
import 'workspace_frame.dart';
|
|
|
|
/// A focused surface; hidden features keep their state in workspace controllers.
|
|
class PhoneWorkspaceShell extends StatelessWidget {
|
|
const PhoneWorkspaceShell({
|
|
super.key,
|
|
required this.mode,
|
|
required this.onModeChanged,
|
|
required this.navigation,
|
|
required this.headerActions,
|
|
required this.title,
|
|
required this.integratedTitlebar,
|
|
required this.agent,
|
|
required this.editor,
|
|
});
|
|
|
|
final WorkspaceMode mode;
|
|
final ValueChanged<WorkspaceMode> onModeChanged;
|
|
final Widget navigation;
|
|
final Widget headerActions;
|
|
final String title;
|
|
final bool integratedTitlebar;
|
|
final Widget agent;
|
|
final Widget editor;
|
|
|
|
@override
|
|
Widget build(BuildContext context) => WorkspaceFrame(
|
|
key: const Key('phone-workspace-shell'),
|
|
navigation: navigation,
|
|
headerActions: headerActions,
|
|
title: title,
|
|
integratedTitlebar: integratedTitlebar,
|
|
bottomNavigationBar: NavigationBar(
|
|
height: 64,
|
|
selectedIndex: mode == WorkspaceMode.agent ? 0 : 1,
|
|
onDestinationSelected: (index) =>
|
|
onModeChanged(index == 0 ? WorkspaceMode.agent : WorkspaceMode.cut),
|
|
destinations: [
|
|
NavigationDestination(
|
|
key: const Key('workspace-agent-destination'),
|
|
icon: const Icon(AppIcons.chat),
|
|
label: context.l10n.workspaceAgent,
|
|
),
|
|
NavigationDestination(
|
|
key: const Key('workspace-cut-destination'),
|
|
icon: const Icon(AppIcons.video),
|
|
label: context.l10n.workspaceCut,
|
|
),
|
|
],
|
|
),
|
|
child: mode == WorkspaceMode.agent ? agent : editor,
|
|
);
|
|
}
|