feat(workspace): 桌面工作区、主题与交互更新,发布 0.1.2
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
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
This commit was merged in pull request #13.
This commit is contained in:
1 parent
aa5255d1e4
commit
abc1868550
260 files changed
+43964
-5591
No files matched your search
@@ -0,0 +1,76 @@
|
||||
import 'package:cutdex_ui/theme.dart';
|
||||
import 'package:cutdex_ui/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widget_previews.dart';
|
||||
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import 'chat_header.dart';
|
||||
|
||||
@Preview(
|
||||
name: 'Chat header — dark',
|
||||
group: 'Desktop conversations',
|
||||
size: Size(320, 440),
|
||||
)
|
||||
Widget chatHeaderDarkPreview() => _preview(Brightness.dark);
|
||||
|
||||
@Preview(
|
||||
name: 'Chat header — light, narrow',
|
||||
group: 'Desktop conversations',
|
||||
size: Size(240, 440),
|
||||
)
|
||||
Widget chatHeaderLightPreview() => _preview(Brightness.light);
|
||||
|
||||
Widget _preview(Brightness brightness) {
|
||||
const entries = [
|
||||
(id: 'rough', title: '旅行短片粗剪'),
|
||||
(id: 'opening', title: '调整片头节奏与镜头衔接,让画面更自然'),
|
||||
(id: 'captions', title: '字幕与配乐'),
|
||||
];
|
||||
String? selected = 'opening';
|
||||
return MaterialApp(
|
||||
theme: AppTheme.desktopWorkspaceTheme(
|
||||
AppTheme.forPalette(AppPalette.graphite, brightness),
|
||||
),
|
||||
locale: const Locale('zh'),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: Scaffold(
|
||||
body: StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return Column(
|
||||
children: [
|
||||
ChatHeader(
|
||||
title:
|
||||
entries
|
||||
.where((entry) => entry.id == selected)
|
||||
.firstOrNull
|
||||
?.title ??
|
||||
l10n.agentUntitledConversation,
|
||||
onNew: () => setState(() => selected = null),
|
||||
actions: selected == null
|
||||
? const []
|
||||
: [
|
||||
AppMenuItem(label: l10n.rename, onPressed: () {}),
|
||||
AppMenuItem(
|
||||
label: l10n.agentMoveToTrash,
|
||||
onPressed: () => setState(() => selected = null),
|
||||
),
|
||||
],
|
||||
historyBuilder: (_, close) => ChatHistoryMenu(
|
||||
entries: entries,
|
||||
selectedId: selected,
|
||||
onSelect: (id) {
|
||||
close();
|
||||
setState(() => selected = id);
|
||||
},
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user