Files
cutdex/lib/app/shells/workspace_frame.dart
lingjhf abc1868550
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
feat(workspace): 桌面工作区、主题与交互更新,发布 0.1.2
2026-10-08 18:17:12 +00:00

72 lines
2.1 KiB
Dart

import 'package:cutdex_ui/icons.dart';
import 'package:flutter/material.dart';
import '../../integrations/platform/editor_window_chrome.dart';
import 'package:cutdex_native/cutdex_native.dart';
import '../../l10n/l10n.dart';
/// Navigation and mode controls for bounded workspaces. Drawer visibility is
/// local presentation state and never overwrites the desktop sidebar preference.
class WorkspaceFrame extends StatelessWidget {
const WorkspaceFrame({
super.key,
required this.navigation,
required this.headerActions,
required this.title,
required this.integratedTitlebar,
required this.child,
this.bottomNavigationBar,
});
final Widget navigation;
final Widget headerActions;
final String title;
final bool integratedTitlebar;
final Widget child;
final Widget? bottomNavigationBar;
@override
Widget build(BuildContext context) => Scaffold(
drawer: Drawer(width: 320, child: SafeArea(child: navigation)),
body: Column(
children: [
SizedBox(
key: const Key('workspace-window-header'),
height: 48,
child: WindowHeaderPadding(
child: Row(
children: [
if (integratedTitlebar)
SizedBox(width: EditorWindowChrome.leadingWidth),
HeaderControlRegion(
child: Builder(
builder: (context) => IconButton(
key: const Key('workspace-navigation-button'),
tooltip: context.l10n.expandSidebar,
onPressed: () => Scaffold.of(context).openDrawer(),
icon: const Icon(AppIcons.menu),
),
),
),
Expanded(
child: Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
headerActions,
],
),
),
),
const Divider(height: 1),
Expanded(child: child),
],
),
bottomNavigationBar: bottomNavigationBar,
);
}