diff --git a/README.md b/README.md index a0d2e70..ec7dcbf 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,14 @@ Cutdex 是一款视频剪辑应用。你可以在时间线上编辑视频、音 “设置 → 通用”可以切换语言、明暗主题和存储位置。桌面版还提供软件更新入口,是否可用取决于安装包的更新配置。 +配色方案提供石墨灰与蓝色、柔灰与紫色、暖灰与青绿三种选择。每种方案都有浅色和深色版本,也可跟随系统外观;配色方案与明暗选择分别保存。 + +桌面剪辑工作区采用独立的控件与布局尺寸:素材、预览和属性分别成面板,下方时间线横跨编辑区,播放栏固定在预览底部。时间线标签、编辑命令和标尺分层排列,窄面板中的次要命令收进更多菜单。顶部可展开或收起聊天,草稿会保留;聊天区域宽度和时间线高度支持拖动并保存。手机和平板继续使用各自的页面与工具面板。 + +桌面窗口顶部以标签页切换已打开的项目,“+”菜单可新建、打开或选择最近项目。左侧只展示当前项目的聊天,会话历史与新建聊天位于聊天区头部;素材库属于当前项目,放在编辑区内,可独立收起并保留浏览状态。关闭标签不会删除项目,切换项目会保留各自的聊天草稿。 + +桌面素材区提供紧凑卡片和列表视图,可按名称搜索,并按导入顺序或名称升降序排列。视频、图片和音频共用选中状态,时长来自实际素材信息;缺失素材保留名称并标明原因。搜索、排序和视图选择按项目保留。 + 遇到编辑、保存、预览或后台任务错误时,可在“设置 → 通用 → 诊断”中导出诊断包,协助定位问题。分享前请检查内容,移除不希望公开的信息。 需要连接外部 AI 工具时,可查看 [MCP 连接指南](docs/mcp-connection.md)。 diff --git a/integration_test/playback_app_acceptance_test.dart b/integration_test/playback_app_acceptance_test.dart index d137522..edaebe8 100644 --- a/integration_test/playback_app_acceptance_test.dart +++ b/integration_test/playback_app_acceptance_test.dart @@ -12,6 +12,7 @@ import 'package:cutdex_sdk/runtime.dart'; import 'package:cutdex_sdk/timeline/model.dart'; import 'package:cutdex_sdk/timeline_ui.dart'; import 'package:drift/native.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -161,9 +162,7 @@ void main() { final panel = find.byType(EditorPreviewPanel); await tester.tap( - find - .descendant(of: panel, matching: find.byIcon(Icons.play_arrow)) - .first, + find.descendant(of: panel, matching: find.byIcon(AppIcons.play)).first, ); await until(() => preview.playing, label: 'UI play'); await Future.delayed(const Duration(milliseconds: 700)); @@ -173,7 +172,7 @@ void main() { greaterThan(0), ); await tester.tap( - find.descendant(of: panel, matching: find.byIcon(Icons.pause)).first, + find.descendant(of: panel, matching: find.byIcon(AppIcons.pause)).first, ); await until(() => !preview.playing, label: 'UI pause'); mark('real play and pause buttons advanced native media clock'); diff --git a/lib/app/adaptive/desktop_content_controller.dart b/lib/app/adaptive/desktop_content_controller.dart index e2f4ecc..af9f518 100644 --- a/lib/app/adaptive/desktop_content_controller.dart +++ b/lib/app/adaptive/desktop_content_controller.dart @@ -1,6 +1,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; -enum DesktopContent { workspace, library, settings } +enum DesktopContent { workspace, library, resourceLibrary, settings } typedef DesktopContentSelection = ({ DesktopContent surface, @@ -9,6 +9,7 @@ typedef DesktopContentSelection = ({ (String, String)? workspace, bool settingsVisited, bool resourcesSelected, + bool librarySelected, }); final desktopContentProvider = @@ -18,6 +19,8 @@ final desktopContentProvider = /// Navigation changes visibility without disposing any visited content. class DesktopContentController extends Notifier { + DesktopContent _settingsReturnSurface = DesktopContent.workspace; + @override DesktopContentSelection build() => ( surface: DesktopContent.workspace, @@ -26,6 +29,7 @@ class DesktopContentController extends Notifier { workspace: null, settingsVisited: false, resourcesSelected: false, + librarySelected: false, ); void select(DesktopContent surface) { @@ -37,10 +41,14 @@ class DesktopContentController extends Notifier { settingsVisited: state.settingsVisited || surface == DesktopContent.settings, resourcesSelected: surface == DesktopContent.library, + librarySelected: surface == DesktopContent.resourceLibrary, ); } void showSettings({int? tab, (String, String)? workspace}) { + if (state.surface != DesktopContent.settings) { + _settingsReturnSurface = state.surface; + } state = ( surface: DesktopContent.settings, settingsTab: tab ?? state.settingsTab, @@ -48,6 +56,13 @@ class DesktopContentController extends Notifier { workspace: workspace ?? state.workspace, settingsVisited: true, resourcesSelected: state.resourcesSelected, + librarySelected: state.librarySelected, ); } + + void closeSettings() { + if (state.surface == DesktopContent.settings) { + select(_settingsReturnSurface); + } + } } diff --git a/lib/app/adaptive/desktop_workspace_controller.dart b/lib/app/adaptive/desktop_workspace_controller.dart index c351e25..9be4748 100644 --- a/lib/app/adaptive/desktop_workspace_controller.dart +++ b/lib/app/adaptive/desktop_workspace_controller.dart @@ -4,17 +4,49 @@ import 'package:flutter/foundation.dart'; class DesktopWorkspaceController extends ChangeNotifier { double? _agentWidth; bool _agentFullscreen = false; + bool _agentFloating = false; + bool _agentFloatingExpanded = false; + bool _agentVisible = false; double? get agentWidth => _agentWidth; bool get agentFullscreen => _agentFullscreen; + bool get agentFloating => _agentFloating; + bool get agentFloatingExpanded => _agentFloatingExpanded; + bool get agentVisible => _agentVisible; + + void setAgentVisible(bool value) { + if (_agentVisible == value) return; + _agentVisible = value; + if (!value) { + _agentFloating = false; + _agentFullscreen = false; + _agentFloatingExpanded = false; + } + notifyListeners(); + } + + void toggleFloatingConversation() { + _agentFloatingExpanded = !_agentFloatingExpanded; + notifyListeners(); + } void setAgentWidth(double width) { _agentWidth = width; notifyListeners(); } + void setAgentFloating(bool value) { + if (_agentFloating == value) return; + _agentFloating = value; + _agentVisible = true; + if (!value) _agentFloatingExpanded = false; + if (value) _agentFullscreen = false; + notifyListeners(); + } + void setAgentFullscreen(bool value) { - if (_agentFullscreen == value) return; + if (_agentFullscreen == value && !(value && _agentFloating)) return; + if (value) _agentFloating = false; _agentFullscreen = value; notifyListeners(); } diff --git a/lib/app/adaptive/workspace_layout_policy.dart b/lib/app/adaptive/workspace_layout_policy.dart index b4387e7..1ff23a6 100644 --- a/lib/app/adaptive/workspace_layout_policy.dart +++ b/lib/app/adaptive/workspace_layout_policy.dart @@ -9,7 +9,7 @@ abstract final class WorkspaceLayoutPolicy { width >= WorkspaceLayoutMetrics.sidebarMinimumWidth + WorkspaceLayoutMetrics.contentMinimumWidth + - 1; + WorkspaceLayoutMetrics.desktopSpacing; static bool showAgentBesideEditor(double width) => width >= WorkspaceLayoutMetrics.dualPaneMinimumWidth; diff --git a/lib/app/app.dart b/lib/app/app.dart index 32283a8..5b5660b 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -11,17 +11,27 @@ import '../integrations/app_updates.dart'; import '../integrations/editor_tools.dart'; import '../features/settings/appearance_settings.dart'; import '../shared/widgets/error_notification_host.dart'; +import '../integrations/platform/device_experience.dart'; class CutdexApp extends ConsumerWidget { const CutdexApp({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { - ref.watch(applicationMcpConnectionProvider); - ref.watch(appUpdateLifecycleProvider); + ref.watch(applicationMcpConnectionProvider.select((_) => null)); + ref.watch(appUpdateLifecycleProvider.select((_) => null)); final appearance = ref.watch(appearanceSettingsProvider).asData?.value ?? AppAppearance.system; + final palette = + ref.watch(paletteSettingsProvider).asData?.value ?? AppPalette.graphite; + final desktop = + ref.watch(deviceExperienceProvider) == DeviceExperience.desktop; + ThemeData theme(Brightness brightness) { + final base = EditorTheme.forPalette(palette, brightness); + return desktop ? EditorTheme.desktop(base) : base; + } + return MaterialApp.router( builder: (context, child) => ErrorNotificationHost(child: child ?? const SizedBox.shrink()), @@ -31,8 +41,8 @@ class CutdexApp extends ConsumerWidget { supportedLocales: AppLocalizations.supportedLocales, localeListResolutionCallback: resolveAppLocale, debugShowCheckedModeBanner: false, - theme: EditorTheme.penLight, - darkTheme: EditorTheme.penDark, + theme: theme(Brightness.light), + darkTheme: theme(Brightness.dark), themeMode: appearance.themeMode, routerConfig: ref.watch(appRouterProvider), ); diff --git a/lib/app/editor_theme.dart b/lib/app/editor_theme.dart index d5c7f3e..076020e 100644 --- a/lib/app/editor_theme.dart +++ b/lib/app/editor_theme.dart @@ -7,10 +7,39 @@ abstract final class EditorTheme { static ThemeData get penLight => adapt(AppTheme.penLight); static ThemeData get penDark => adapt(AppTheme.penDark); + static ThemeData forPalette(AppPalette palette, Brightness brightness) => + adapt(AppTheme.forPalette(palette, brightness)); + + static ThemeData desktop(ThemeData theme) { + final desktop = AppTheme.desktopWorkspaceTheme(theme); + final timeline = desktop.extension(); + if (timeline == null) return desktop; + return desktop.copyWith( + extensions: [ + ...desktop.extensions.values.where( + (value) => value is! TimelineThemeData, + ), + timeline.copyWith( + rulerHeight: AppDesktopMetrics.timelineRuler, + rulerTextStyle: timeline.rulerTextStyle.copyWith( + fontSize: 12, + height: 16 / 12, + fontFeatures: const [FontFeature.tabularFigures()], + ), + playheadColor: desktop.colorScheme.primary, + clipHeaderHeight: 20, + clipHeaderPadding: 4, + clipNameTextStyle: timeline.clipNameTextStyle.copyWith( + fontSize: 11, + height: 16 / 11, + ), + ), + ], + ); + } + static ThemeData adapt(ThemeData theme) { - final palette = theme.brightness == Brightness.dark - ? AppColors.penDark - : AppColors.penLight; + final palette = AppColors.of(theme); final dark = theme.brightness == Brightness.dark; final text = theme.textTheme; final timelineBorder = palette.divider; @@ -27,8 +56,8 @@ abstract final class EditorTheme { backgroundColor: palette.background, primaryLaneBackgroundColor: palette.sidebar, visualClipColor: palette.visualClip, - audioClipColor: palette.popover, - audioAccentColor: timelineSecondary, + audioClipColor: palette.audioClip, + audioAccentColor: palette.audioWaveform, gapColor: timelineBorder, gapBorderColor: timelineBorder, containerAccentColor: timelineSecondary, @@ -37,7 +66,7 @@ abstract final class EditorTheme { connectionLineWidth: 3, clipBorderColor: timelineBorder, clipBorderWidth: 1, - selectionOutlineColor: palette.foreground, + selectionOutlineColor: palette.selection, selectionOutlineWidth: 2, keyframeColor: timelineSecondary, keyframeBorderColor: palette.background, diff --git a/lib/app/router/app_router.dart b/lib/app/router/app_router.dart index 18b23bc..4efd62a 100644 --- a/lib/app/router/app_router.dart +++ b/lib/app/router/app_router.dart @@ -22,7 +22,7 @@ GoRouter appRouter(Ref ref) { builder: (context, state) => SettingsPage( initialTab: (int.tryParse(state.uri.queryParameters['tab'] ?? '') ?? 0) - .clamp(0, 2), + .clamp(0, 3), workspace: state.extra is (String, String) ? state.extra as (String, String) : null, diff --git a/lib/app/router/app_router.g.dart b/lib/app/router/app_router.g.dart index 02810df..58062bc 100644 --- a/lib/app/router/app_router.g.dart +++ b/lib/app/router/app_router.g.dart @@ -48,4 +48,4 @@ final class AppRouterProvider } } -String _$appRouterHash() => r'00e948f9d82c1f07ecdfc62b3c1ec833cb03edfe'; +String _$appRouterHash() => r'ea1ed83ca5ca1f7079b268b1a94940d575b6ddf9'; diff --git a/lib/app/shells/desktop_window_frame.dart b/lib/app/shells/desktop_window_frame.dart index 19c04cc..2d73cc3 100644 --- a/lib/app/shells/desktop_window_frame.dart +++ b/lib/app/shells/desktop_window_frame.dart @@ -1,10 +1,12 @@ import 'package:cutdex_native/cutdex_native.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; import 'package:flutter/material.dart'; import '../../integrations/platform/editor_window_chrome.dart'; import '../../l10n/l10n.dart'; import '../../shared/layout/workspace_layout_metrics.dart'; -import '../../workspace/workspace_mode.dart'; +import '../editor_theme.dart'; /// Keeps window chrome outside the shared workspace surface. class DesktopWindowFrame extends StatelessWidget { @@ -12,30 +14,40 @@ class DesktopWindowFrame extends StatelessWidget { super.key, required this.integratedTitlebar, required this.headerControls, - required this.librarySelected, + this.projectTabs, + this.headerTrailing = const SizedBox.shrink(), this.settingsSelected = false, - required this.onModeChanged, - required this.onLibraryPressed, + this.resourceLibrarySelected = false, + this.onResourceLibraryPressed, + required this.onHomePressed, required this.onSettingsPressed, required this.child, }); static const railWidth = 44.0; static const railButtonSize = 32.0; - static const railIconSize = 22.0; - static const headerHeight = 40.0; - static const contentInset = WorkspaceLayoutMetrics.desktopSpacing; + static const railIconSize = 20.0; + static const headerHeight = AppDesktopMetrics.windowHeader; + static const headerInset = (railWidth - AppControlSize.headerButton) / 2; + static const contentInset = WorkspaceLayoutMetrics.desktopOuterSpacing; final bool integratedTitlebar; final Widget headerControls; - final bool librarySelected; + final Widget? projectTabs; + final Widget headerTrailing; final bool settingsSelected; - final ValueChanged onModeChanged; - final VoidCallback? onLibraryPressed; + final bool resourceLibrarySelected; + final VoidCallback? onResourceLibraryPressed; + final VoidCallback onHomePressed; final VoidCallback onSettingsPressed; final Widget child; @override - Widget build(BuildContext context) => ColoredBox( + Widget build(BuildContext context) => Theme( + data: EditorTheme.desktop(Theme.of(context)), + child: Builder(builder: _buildFrame), + ); + + Widget _buildFrame(BuildContext context) => ColoredBox( color: Theme.of(context).colorScheme.surfaceContainer, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, @@ -44,99 +56,153 @@ class DesktopWindowFrame extends StatelessWidget { key: const Key('desktop-window-header'), height: headerHeight, child: WindowHeaderPadding( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - children: [ - if (integratedTitlebar) - SizedBox( - key: const Key('native-window-controls-space'), - width: EditorWindowChrome.leadingWidth, - height: headerHeight, - ), - headerControls, - ], - ), + child: Row( + children: [ + Expanded( + child: projectTabs != null + ? LayoutBuilder( + builder: (context, constraints) => + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SizedBox( + width: constraints.maxWidth.clamp( + 240.0, + double.infinity, + ), + child: Row( + children: [ + if (integratedTitlebar) + SizedBox( + key: const Key( + 'native-window-controls-space', + ), + width: + EditorWindowChrome.leadingWidth, + height: headerHeight, + ), + headerControls, + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: headerInset, + ), + child: projectTabs!, + ), + ), + ], + ), + ), + ), + ) + : SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + if (integratedTitlebar) + SizedBox( + key: const Key( + 'native-window-controls-space', + ), + width: EditorWindowChrome.leadingWidth, + height: headerHeight, + ), + headerControls, + ], + ), + ), + ), + headerTrailing, + ], ), ), ), Expanded( child: Row( children: [ - SizedBox( - key: const Key('desktop-navigation-rail'), - width: railWidth, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 10), - child: Column( - children: [ - for (final library in [false, true]) - Padding( - padding: const EdgeInsets.only(bottom: 8), - child: IconButton.filledTonal( - key: ValueKey( - library - ? 'desktop-rail-library' - : 'desktop-rail-cut', - ), - tooltip: library - ? context.l10n.navigationLibrary - : context.l10n.navigationChat, - isSelected: - !settingsSelected && library == librarySelected, - style: IconButton.styleFrom( - fixedSize: const Size.square(railButtonSize), - minimumSize: const Size.square(railButtonSize), - maximumSize: const Size.square(railButtonSize), - padding: EdgeInsets.zero, - iconSize: railIconSize, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - backgroundColor: + if (projectTabs == null) + SizedBox( + key: const Key('desktop-navigation-rail'), + width: railWidth, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Column( + children: [ + for (final section in [0, 2]) + Padding( + padding: const EdgeInsets.only(bottom: 8), + child: IconButton.filledTonal( + key: ValueKey(switch (section) { + 0 => 'desktop-rail-home', + _ => 'desktop-rail-resources', + }), + tooltip: switch (section) { + 0 => context.l10n.navigationHome, + _ => context.l10n.navigationLibrary, + }, + isSelected: !settingsSelected && - library == librarySelected - ? null - : Colors.transparent, - ), - onPressed: library - ? onLibraryPressed - : () => onModeChanged(WorkspaceMode.cut), - icon: Icon( - library - ? Icons.video_library_outlined - : Icons.chat_bubble_outline, + (section == 2 + ? resourceLibrarySelected + : !resourceLibrarySelected), + style: IconButton.styleFrom( + fixedSize: const Size.square(railButtonSize), + minimumSize: const Size.square(railButtonSize), + maximumSize: const Size.square(railButtonSize), + padding: EdgeInsets.zero, + iconSize: railIconSize, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + backgroundColor: + !settingsSelected && + (section == 2 + ? resourceLibrarySelected + : !resourceLibrarySelected) + ? null + : Colors.transparent, + ), + onPressed: switch (section) { + 0 => onHomePressed, + _ => onResourceLibraryPressed, + }, + icon: Icon(switch (section) { + 0 => AppIcons.home, + _ => AppIcons.folder, + }), ), ), + const Spacer(), + IconButton( + key: const Key('project-settings-button'), + tooltip: context.l10n.settings, + isSelected: settingsSelected, + onPressed: onSettingsPressed, + style: IconButton.styleFrom( + fixedSize: const Size.square(railButtonSize), + minimumSize: const Size.square(railButtonSize), + maximumSize: const Size.square(railButtonSize), + padding: EdgeInsets.zero, + iconSize: railIconSize, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + icon: const Icon(AppIcons.settings), ), - const Spacer(), - IconButton( - key: const Key('project-settings-button'), - tooltip: context.l10n.settings, - isSelected: settingsSelected, - onPressed: onSettingsPressed, - style: IconButton.styleFrom( - fixedSize: const Size.square(railButtonSize), - minimumSize: const Size.square(railButtonSize), - maximumSize: const Size.square(railButtonSize), - padding: EdgeInsets.zero, - iconSize: railIconSize, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - ), - icon: const Icon(Icons.settings_outlined), - ), - ], + ], + ), ), ), - ), Expanded( child: Padding( - padding: const EdgeInsets.only( + padding: EdgeInsets.only( + left: projectTabs == null ? 0 : contentInset, right: contentInset, bottom: contentInset, ), child: SizedBox( key: const Key('desktop-content-container'), child: WindowHeaderPane( - offset: const Offset(railWidth, headerHeight), + offset: Offset( + projectTabs == null ? railWidth : contentInset, + headerHeight, + ), child: LayoutBuilder( builder: (context, constraints) => constraints.maxWidth < 200 diff --git a/lib/app/shells/desktop_workspace_shell.dart b/lib/app/shells/desktop_workspace_shell.dart index 1809983..50aa7b5 100644 --- a/lib/app/shells/desktop_workspace_shell.dart +++ b/lib/app/shells/desktop_workspace_shell.dart @@ -1,4 +1,8 @@ +import 'dart:math' as math; + import 'package:flutter/material.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; import '../adaptive/desktop_workspace_controller.dart'; import '../adaptive/workspace_layout_policy.dart'; @@ -27,6 +31,7 @@ class DesktopWorkspaceShell extends StatefulWidget { required this.editor, required this.scaffoldKey, required this.navigationDrawer, + this.projectTabsLayout = false, }); static const gutterWidth = WorkspaceLayoutMetrics.desktopSpacing; @@ -41,6 +46,7 @@ class DesktopWorkspaceShell extends StatefulWidget { final Widget editor; final GlobalKey scaffoldKey; final Widget navigationDrawer; + final bool projectTabsLayout; @override State createState() => _DesktopWorkspaceShellState(); @@ -93,58 +99,238 @@ class _DesktopWorkspaceShellState extends State { ); @override - Widget build(BuildContext context) => LayoutBuilder( + Widget build(BuildContext context) => widget.projectTabsLayout + ? _projectWorkspace(context) + : LayoutBuilder( + builder: (context, constraints) { + const gap = DesktopWorkspaceShell.gutterWidth; + final width = constraints.maxWidth; + final requestedFloating = widget.controller.agentFloating; + final showAgent = + widget.mode == WorkspaceMode.agent || + widget.controller.agentVisible; + final navigationGap = widget.sidebarCollapsed ? 0.0 : gap; + final resolved = DesktopWorkspaceGeometry.resolve( + // The geometry policy accounts for a one-pixel divider; reserve gutters. + width: width - navigationGap - gap + 1, + mode: requestedFloating || !showAgent + ? WorkspaceMode.cut + : WorkspaceMode.agent, + sidebarCollapsed: widget.sidebarCollapsed, + sidebarWidth: widget.sidebarWidth, + agentWidth: widget.controller.agentWidth, + agentFullscreen: widget.controller.agentFullscreen, + ); + final navigationSpace = widget.sidebarCollapsed + ? 0.0 + : resolved.sidebarWidth; + final floating = + requestedFloating || + (showAgent && + widget.mode == WorkspaceMode.cut && + resolved.editorHidden && + !widget.controller.agentFullscreen); + final agentHidden = + floating || + !showAgent || + resolved.editorHidden && + widget.mode == WorkspaceMode.cut && + !widget.controller.agentFullscreen; + final geometry = DesktopWorkspaceGeometry( + sidebarWidth: resolved.sidebarWidth, + agentWidth: agentHidden + ? 0 + : resolved.editorHidden + ? width - navigationSpace - navigationGap + : resolved.agentWidth, + editorHidden: resolved.editorHidden && !agentHidden, + ); + final available = width - navigationSpace - navigationGap; + void expandEditor() { + final collapseNavigation = + available < + 220 + gap + DesktopWorkspaceGeometry.editorMinimumWidth; + if (collapseNavigation) widget.onSidebarCollapsedChanged(true); + widget.controller.setAgentFullscreen(false); + } + + void resizeAgent(double requested) { + final maximum = + available - gap - DesktopWorkspaceGeometry.editorMinimumWidth; + if (maximum < 220) return; + final agentWidth = requested.clamp(220.0, maximum); + widget.controller.setAgentWidth(agentWidth); + } + + return Scaffold( + key: widget.scaffoldKey, + backgroundColor: Colors.transparent, + drawer: Drawer( + width: 320, + child: SafeArea(child: widget.navigationDrawer), + ), + body: Stack( + key: const Key('desktop-workspace-shell'), + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (!widget.sidebarCollapsed) ...[ + SizedBox( + width: navigationSpace, + child: _card( + 'project', + widget.sidebarBuilder(geometry, expandEditor), + ), + ), + const SizedBox( + key: Key('project-sidebar-divider'), + width: gap, + ), + ], + Expanded( + child: Offstage( + key: const Key('editor-auto-collapse'), + offstage: geometry.editorHidden, + child: TickerMode( + enabled: !geometry.editorHidden, + child: OverflowBox( + alignment: Alignment.topLeft, + minWidth: geometry.editorHidden + ? DesktopWorkspaceGeometry.editorRestoreWidth + : null, + maxWidth: geometry.editorHidden + ? DesktopWorkspaceGeometry.editorRestoreWidth + : null, + child: SizedBox( + key: const Key('desktop-editor-card'), + child: widget.editor, + ), + ), + ), + ), + ), + if (!agentHidden && !geometry.editorHidden) + const SizedBox(width: gap), + if (!floating) + Offstage( + offstage: agentHidden, + child: ExcludeFocus( + excluding: agentHidden, + child: TickerMode( + enabled: !agentHidden, + child: SizedBox( + key: const Key('desktop-agent-slot'), + width: agentHidden + ? widget.controller.agentWidth ?? 320 + : geometry.agentWidth, + child: _card( + 'agent', + widget.agentBuilder(geometry, expandEditor), + ), + ), + ), + ), + ), + ], + ), + if (floating) + Positioned( + key: const Key('agent-floating-window'), + right: 12, + bottom: 12, + width: math.min(560, math.max(0, available - 24)), + child: AppFloatingDialog( + key: const Key('floating-agent-dialog'), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(22), + ), + backgroundColor: AppSurfaces.of(context) + .composerBackground, + child: ConstrainedBox( + constraints: BoxConstraints( + maxHeight: math.min( + 640, + math.max(0, constraints.maxHeight - 24), + ), + ), + child: widget.agentBuilder(geometry, expandEditor), + ), + ), + ), + if (!widget.sidebarCollapsed) + Positioned( + left: + navigationSpace - + WorkspaceLayoutMetrics.desktopResizeSlop, + top: 0, + bottom: 0, + child: _gutter( + name: 'project-sidebar', + initialWidth: navigationSpace, + onResize: (value) => widget.onSidebarWidthChanged( + value.clamp( + WorkspaceLayoutMetrics.sidebarMinimumWidth, + DesktopWorkspaceGeometry.sidebarMaximum( + width - 2 * gap + 1, + WorkspaceMode.agent, + ), + ), + ), + ), + ), + if (!agentHidden && !geometry.editorHidden) + Positioned( + left: geometry.editorHidden + ? navigationSpace + + navigationGap + + (widget.sidebarCollapsed + ? 0 + : WorkspaceLayoutMetrics.desktopResizeSlop) + : width - + geometry.agentWidth - + gap - + WorkspaceLayoutMetrics.desktopResizeSlop, + top: 0, + bottom: 0, + child: _gutter( + name: 'agent-panel', + initialWidth: geometry.agentWidth, + direction: -1, + onResize: resizeAgent, + ), + ), + ], + ), + ); + }, + ); + + Widget _projectWorkspace(BuildContext context) => LayoutBuilder( builder: (context, constraints) { const gap = DesktopWorkspaceShell.gutterWidth; final width = constraints.maxWidth; - final navigationGap = widget.sidebarCollapsed ? 0.0 : gap; - final resolved = DesktopWorkspaceGeometry.resolve( - // The geometry policy accounts for a one-pixel divider; reserve gutters. - width: width - navigationGap - gap + 1, - mode: WorkspaceMode.agent, - sidebarCollapsed: widget.sidebarCollapsed, - sidebarWidth: widget.sidebarWidth, - agentWidth: widget.controller.agentWidth, - agentFullscreen: widget.controller.agentFullscreen, - ); - final navigationSpace = widget.sidebarCollapsed - ? 0.0 - : resolved.sidebarWidth; - final agentHidden = - resolved.editorHidden && - widget.mode == WorkspaceMode.cut && - !widget.controller.agentFullscreen; + final maximum = WorkspaceLayoutMetrics.sidebarMaximumWidth(width - gap); + final sidebarWidth = + (widget.sidebarWidth ?? WorkspaceLayoutMetrics.sidebarDefaultWidth) + .clamp(WorkspaceLayoutMetrics.sidebarMinimumWidth, maximum) + .toDouble(); + final floating = widget.controller.agentFloating; + final collapsed = widget.sidebarCollapsed || floating; final geometry = DesktopWorkspaceGeometry( - sidebarWidth: resolved.sidebarWidth, - agentWidth: agentHidden - ? 0 - : resolved.editorHidden - ? width - navigationSpace - navigationGap - : resolved.agentWidth, - editorHidden: resolved.editorHidden && !agentHidden, + sidebarWidth: sidebarWidth, + agentWidth: 0, + editorHidden: false, ); - final available = width - navigationSpace - navigationGap; - void expandEditor() { - final collapseNavigation = - available < 220 + gap + DesktopWorkspaceGeometry.editorMinimumWidth; - if (collapseNavigation) widget.onSidebarCollapsedChanged(true); - widget.controller.setAgentFullscreen(false); - } - - void resizeAgent(double requested) { - final maximum = - available - gap - DesktopWorkspaceGeometry.editorMinimumWidth; - if (maximum < 220) return; - final agentWidth = requested.clamp(220.0, maximum); - widget.controller.setAgentWidth(agentWidth); - } - return Scaffold( key: widget.scaffoldKey, backgroundColor: Colors.transparent, drawer: Drawer( width: 320, - child: SafeArea(child: widget.navigationDrawer), + child: SafeArea( + // The drawer and floating panel share the conversation widget. + child: floating ? const SizedBox.shrink() : widget.navigationDrawer, + ), ), body: Stack( key: const Key('desktop-workspace-shell'), @@ -152,93 +338,61 @@ class _DesktopWorkspaceShellState extends State { Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - if (!widget.sidebarCollapsed) ...[ + if (!collapsed) ...[ SizedBox( - width: navigationSpace, + width: sidebarWidth, child: _card( - 'project', - widget.sidebarBuilder(geometry, expandEditor), + 'chat', + widget.sidebarBuilder(geometry, () {}), ), ), - const SizedBox( - key: Key('project-sidebar-divider'), - width: gap, - ), + const SizedBox(width: gap), ], Expanded( - child: Offstage( - key: const Key('editor-auto-collapse'), - offstage: geometry.editorHidden, - child: TickerMode( - enabled: !geometry.editorHidden, - child: OverflowBox( - alignment: Alignment.topLeft, - minWidth: geometry.editorHidden - ? DesktopWorkspaceGeometry.editorRestoreWidth - : null, - maxWidth: geometry.editorHidden - ? DesktopWorkspaceGeometry.editorRestoreWidth - : null, - child: SizedBox( - key: const Key('desktop-editor-card'), - child: widget.editor, - ), - ), - ), + child: SizedBox( + key: const Key('desktop-editor-card'), + child: widget.editor, ), ), - if (!agentHidden && !geometry.editorHidden) - const SizedBox(width: gap), - if (!agentHidden) - SizedBox( - key: const Key('desktop-agent-slot'), - width: geometry.agentWidth, - child: _card( - 'agent', - widget.agentBuilder(geometry, expandEditor), - ), - ), ], ), - if (!widget.sidebarCollapsed) + if (!collapsed) Positioned( - left: - navigationSpace - WorkspaceLayoutMetrics.desktopResizeSlop, + left: sidebarWidth - WorkspaceLayoutMetrics.desktopResizeSlop, top: 0, bottom: 0, child: _gutter( name: 'project-sidebar', - initialWidth: navigationSpace, + initialWidth: sidebarWidth, onResize: (value) => widget.onSidebarWidthChanged( value.clamp( WorkspaceLayoutMetrics.sidebarMinimumWidth, - DesktopWorkspaceGeometry.sidebarMaximum( - width - 2 * gap + 1, - WorkspaceMode.agent, - ), + maximum, ), ), ), ), - if (!agentHidden && !geometry.editorHidden) + if (floating) Positioned( - left: geometry.editorHidden - ? navigationSpace + - navigationGap + - (widget.sidebarCollapsed - ? 0 - : WorkspaceLayoutMetrics.desktopResizeSlop) - : width - - geometry.agentWidth - - gap - - WorkspaceLayoutMetrics.desktopResizeSlop, - top: 0, - bottom: 0, - child: _gutter( - name: 'agent-panel', - initialWidth: geometry.agentWidth, - direction: -1, - onResize: resizeAgent, + key: const Key('agent-floating-window'), + right: 12, + bottom: 12, + width: math.min(560, math.max(0, width - 24)), + child: AppFloatingDialog( + key: const Key('floating-agent-dialog'), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(22), + ), + backgroundColor: AppSurfaces.of(context).composerBackground, + child: ConstrainedBox( + constraints: BoxConstraints( + maxHeight: math.min( + 640, + math.max(0, constraints.maxHeight - 24), + ), + ), + child: widget.agentBuilder(geometry, () {}), + ), ), ), ], diff --git a/lib/app/shells/phone_workspace_shell.dart b/lib/app/shells/phone_workspace_shell.dart index bc0b5e9..8b254fe 100644 --- a/lib/app/shells/phone_workspace_shell.dart +++ b/lib/app/shells/phone_workspace_shell.dart @@ -1,3 +1,4 @@ +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import '../../l10n/l10n.dart'; @@ -43,12 +44,12 @@ class PhoneWorkspaceShell extends StatelessWidget { destinations: [ NavigationDestination( key: const Key('workspace-agent-destination'), - icon: const Icon(Icons.chat_bubble_outline), + icon: const Icon(AppIcons.chat), label: context.l10n.workspaceAgent, ), NavigationDestination( key: const Key('workspace-cut-destination'), - icon: const Icon(Icons.movie_outlined), + icon: const Icon(AppIcons.video), label: context.l10n.workspaceCut, ), ], diff --git a/lib/app/shells/tablet_workspace_shell.dart b/lib/app/shells/tablet_workspace_shell.dart index 9623dfd..5adcdc9 100644 --- a/lib/app/shells/tablet_workspace_shell.dart +++ b/lib/app/shells/tablet_workspace_shell.dart @@ -1,5 +1,6 @@ import 'dart:math' as math; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import '../../l10n/l10n.dart'; @@ -55,14 +56,14 @@ class TabletWorkspaceShell extends StatelessWidget { destinations: [ NavigationRailDestination( icon: const Icon( - Icons.chat_bubble_outline, + AppIcons.chat, key: Key('workspace-agent-destination'), ), label: Text(context.l10n.workspaceAgent), ), NavigationRailDestination( icon: const Icon( - Icons.movie_outlined, + AppIcons.video, key: Key('workspace-cut-destination'), ), label: Text(context.l10n.workspaceCut), diff --git a/lib/app/shells/workspace_frame.dart b/lib/app/shells/workspace_frame.dart index 4be4b01..7511bcc 100644 --- a/lib/app/shells/workspace_frame.dart +++ b/lib/app/shells/workspace_frame.dart @@ -1,3 +1,4 @@ +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import '../../integrations/platform/editor_window_chrome.dart'; @@ -45,7 +46,7 @@ class WorkspaceFrame extends StatelessWidget { key: const Key('workspace-navigation-button'), tooltip: context.l10n.expandSidebar, onPressed: () => Scaffold.of(context).openDrawer(), - icon: const Icon(Icons.menu), + icon: const Icon(AppIcons.menu), ), ), ), diff --git a/lib/errors/app_failure.dart b/lib/errors/app_failure.dart index 5ca7c0a..de0d566 100644 --- a/lib/errors/app_failure.dart +++ b/lib/errors/app_failure.dart @@ -18,6 +18,7 @@ enum AppErrorCode { openMatchingProject, openTimelineFailed, projectMismatch, + projectAlreadyExists, openProjectFirst, localFilesOnly, foldersUnsupported, diff --git a/lib/features/assistant/agent_attachment_card.dart b/lib/features/assistant/agent_attachment_card.dart index dcdb802..96e6649 100644 --- a/lib/features/assistant/agent_attachment_card.dart +++ b/lib/features/assistant/agent_attachment_card.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import '../media/media_asset_cover.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import '../media/audio_asset_tile.dart'; @@ -25,13 +26,13 @@ class AgentAttachmentCard extends StatelessWidget { fit: BoxFit.cover, fallback: Center( child: Icon( - kind == 'image' ? Icons.image_outlined : Icons.movie_outlined, + kind == 'image' ? AppIcons.image : AppIcons.video, color: colors.onSurfaceVariant, ), ), errorFallback: Center( child: Icon( - Icons.broken_image_outlined, + AppIcons.imageUnavailable, color: colors.onSurfaceVariant, ), ), @@ -42,12 +43,7 @@ class AgentAttachmentCard extends StatelessWidget { showName: false, aspectRatio: 132 / 96, ), - _ => Center( - child: Icon( - Icons.insert_drive_file_outlined, - color: colors.onSurfaceVariant, - ), - ), + _ => Center(child: Icon(AppIcons.file, color: colors.onSurfaceVariant)), }; return SizedBox( width: 132, @@ -93,7 +89,7 @@ class AgentAttachmentCard extends StatelessWidget { backgroundColor: colors.surface, foregroundColor: colors.onSurface, ), - icon: const Icon(Icons.close, size: 13), + icon: const Icon(AppIcons.close, size: 13), ), ), ], diff --git a/lib/features/assistant/agent_attachment_drop_region.dart b/lib/features/assistant/agent_attachment_drop_region.dart new file mode 100644 index 0000000..68346b9 --- /dev/null +++ b/lib/features/assistant/agent_attachment_drop_region.dart @@ -0,0 +1,127 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../integrations/platform/platform_capabilities.dart'; +import '../../integrations/platform/native_project_drop_region.dart'; +import '../../integrations/platform/native_file_drop_policy.dart'; +import '../../workspace/projects.dart'; +import '../../workspace/media_import.dart'; +import '../../workspace/external_media_import.dart'; +import '../../shared/widgets/drop_to_add_overlay.dart'; +import '../media/media_asset_drag.dart'; +import 'agent_composer_controller.dart'; + +/// Shared attachment drop handling for docked and floating chat presentations. +class AgentAttachmentDropRegion extends ConsumerStatefulWidget { + const AgentAttachmentDropRegion({ + super.key, + required this.projectId, + required this.composer, + required this.child, + this.shrinkWrap = false, + }); + final String? projectId; + final AgentComposerController composer; + final Widget child; + final bool shrinkWrap; + @override + ConsumerState createState() => + _AgentAttachmentDropRegionState(); +} + +class _AgentAttachmentDropRegionState + extends ConsumerState { + bool _hovering = false; + bool _canAttach(MediaAssetDrag drag) { + final workspace = ref.read(projectsProvider).value; + return widget.projectId == drag.projectId && + workspace?.activeProject?.id == drag.projectId && + !widget.composer.attachments.any((item) => item.id == drag.assetId) && + workspace!.assets.any((asset) => asset.id == drag.assetId); + } + + bool _canAttachFiles(List files) { + if (files.isEmpty) return true; + final assets = ref.read(projectsProvider).value?.assets; + if (assets == null) return false; + final ids = {for (final item in widget.composer.attachments) item.id}; + final locations = { + for (final asset in assets) + if (ids.contains(asset.id)) ?mediaSourceLocation(asset), + }; + return files.any((file) => !locations.contains(file.sourceUri.toString())); + } + + @override + Widget build(BuildContext context) { + final workspace = ref.watch( + projectsProvider.select( + (value) => value.value?.copyWith( + recent: const [], + timelines: const [], + error: null, + creatingTimeline: false, + ), + ), + ); + final native = ref.watch(platformCapabilitiesProvider).nativeFileDrop; + final importing = + widget.composer.busy || + widget.projectId != null && + ref.watch( + externalMediaImportProvider(widget.projectId!) + .select((value) => value.isLoading), + ); + final internal = DragTarget( + key: const Key('agent-panel-drop-target'), + onWillAcceptWithDetails: (details) => _canAttach(details.data), + onAcceptWithDetails: (details) { + if (_canAttach(details.data)) { + widget.composer.attach( + ref + .read(projectsProvider) + .value! + .assets + .firstWhere((asset) => asset.id == details.data.assetId), + ); + } + }, + builder: (context, candidates, _) => Stack( + fit: widget.shrinkWrap ? StackFit.loose : StackFit.expand, + children: [ + widget.child, + if (candidates.isNotEmpty || _hovering) + const Positioned.fill( + child: DropToAddOverlay(key: Key('agent-drop-overlay')), + ), + ], + ), + ); + if (!native) return internal; + return NativeProjectDropRegion( + regionId: 'attachments', + policy: NativeFileDropPolicy.attachments, + enabled: + widget.projectId != null && + workspace?.activeProject?.id == widget.projectId && + (workspace?.projectBusy == false || importing), + onEnter: (files) { + if (!importing && _canAttachFiles(files)) { + setState(() => _hovering = true); + } + }, + onExit: () { + if (mounted && _hovering) setState(() => _hovering = false); + }, + onDrop: (files) async { + setState(() => _hovering = false); + try { + await widget.composer.importAttachments(files); + } catch (_) { + /* Shared composer publishes import feedback. */ + } + }, + child: internal, + ); + } +} diff --git a/lib/features/assistant/agent_chat_actions.dart b/lib/features/assistant/agent_chat_actions.dart new file mode 100644 index 0000000..beb3058 --- /dev/null +++ b/lib/features/assistant/agent_chat_actions.dart @@ -0,0 +1,41 @@ +import 'package:flutter/widgets.dart'; + +import '../../l10n/l10n.dart'; +import 'chat_state.dart'; +import 'agent_composer_controller.dart'; +import 'composer_document.dart'; +import 'agent_message_codec.dart'; + +/// Consume one draft after the shared chat controller's send preconditions pass. +String takeAgentDraft( + ComposerDocumentController input, + AgentComposerController composer, +) { + final text = AgentComposerMessage.encodeDocument( + input.segments, + composer.attachments, + ); + input.clearDocument(); + composer.clear(); + return text; +} + +String agentChatErrorMessage(BuildContext context, AgentChatError error) => + switch (error) { + AgentChatError.configurationReadFailed => + context.l10n.agentConfigurationReadFailed, + AgentChatError.configurationRequired => + context.l10n.agentConfigurationRequired, + AgentChatError.sessionRestoreFailed => + context.l10n.agentSessionRestoreFailed, + AgentChatError.contextBudget => context.l10n.agentContextBudgetExceeded, + AgentChatError.authentication => context.l10n.agentAuthenticationFailed, + AgentChatError.exportReplyFailed => context.l10n.agentExportReplyFailed, + AgentChatError.connection => context.l10n.agentConnectionFailed, + AgentChatError.protocol => context.l10n.agentProtocolFailed, + AgentChatError.turnLimit => context.l10n.agentTurnLimitReached, + AgentChatError.interrupted => context.l10n.agentTaskInterrupted, + AgentChatError.recoveryRequired => context.l10n.agentRecoveryRequired, + AgentChatError.replyFailed => context.l10n.replyFailed, + AgentChatError.requestFailed => context.l10n.chatFailed, + }; diff --git a/lib/features/assistant/agent_chat_panel.dart b/lib/features/assistant/agent_chat_panel.dart index 9f6d834..ce1bf8f 100644 --- a/lib/features/assistant/agent_chat_panel.dart +++ b/lib/features/assistant/agent_chat_panel.dart @@ -1,3 +1,5 @@ +import 'agent_reply_region.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import '../../shared/layout/composer_layout.dart'; @@ -9,6 +11,8 @@ import 'package:cutdex_sdk/project.dart'; import '../../integrations/platform/platform_capabilities.dart'; import 'agent_composer_controller.dart'; +import 'agent_attachment_drop_region.dart'; +import 'agent_chat_actions.dart'; import 'agent_composer_store.dart'; import 'package:flutter/material.dart'; @@ -16,21 +20,17 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../integrations/agent/agent_provider.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; -import '../../shared/widgets/drop_to_add_overlay.dart'; import '../settings/settings_page.dart'; import 'chat_controller.dart'; import 'chat_state.dart'; import '../../integrations/agent/conversation_repository.dart'; -import '../../integrations/platform/native_project_drop_region.dart'; -import '../../integrations/platform/native_file_drop_policy.dart'; -import '../../workspace/media_import.dart'; import '../../workspace/external_media_import.dart'; import '../../settings/settings_operation.dart'; import '../../workspace/projects.dart'; -import '../media/media_asset_drag.dart'; import '../media/media_browser_feedback.dart'; import 'agent_attachment_card.dart'; import 'agent_media_attachments.dart'; @@ -97,8 +97,7 @@ class _AgentChatPanelState extends ConsumerState { 'agent-model-${widget.projectId}-${widget.conversationId ?? widget.draftKey ?? 'new'}'; bool get _choosingModel => ref.read(settingsOperationProvider(_modelOperation)).isLoading; - bool _usingDraftModel = false; - bool _dropHovering = false; + bool get _usingDraftModel => _composer.usingDraftModel; bool get _importingAttachments => _composer.busy || widget.projectId != null && @@ -143,33 +142,12 @@ class _AgentChatPanelState extends ConsumerState { if (oldWidget.conversationId != widget.conversationId || oldWidget.projectId != widget.projectId || oldWidget.draftKey != widget.draftKey) { - _usingDraftModel = false; _composer.removeListener(_composerChanged); _composer = _resolveComposer(); _composer.addListener(_composerChanged); } } - String _errorMessage(BuildContext context, AgentChatError error) => - switch (error) { - AgentChatError.configurationReadFailed => - context.l10n.agentConfigurationReadFailed, - AgentChatError.configurationRequired => - context.l10n.agentConfigurationRequired, - AgentChatError.sessionRestoreFailed => - context.l10n.agentSessionRestoreFailed, - AgentChatError.contextBudget => context.l10n.agentContextBudgetExceeded, - AgentChatError.authentication => context.l10n.agentAuthenticationFailed, - AgentChatError.exportReplyFailed => context.l10n.agentExportReplyFailed, - AgentChatError.connection => context.l10n.agentConnectionFailed, - AgentChatError.protocol => context.l10n.agentProtocolFailed, - AgentChatError.turnLimit => context.l10n.agentTurnLimitReached, - AgentChatError.interrupted => context.l10n.agentTaskInterrupted, - AgentChatError.recoveryRequired => context.l10n.agentRecoveryRequired, - AgentChatError.replyFailed => context.l10n.replyFailed, - AgentChatError.requestFailed => context.l10n.chatFailed, - }; - @override void initState() { super.initState(); @@ -189,41 +167,6 @@ class _AgentChatPanelState extends ConsumerState { super.dispose(); } - bool _canAttach(MediaAssetDrag drag) { - final workspace = ref.read(projectsProvider).asData?.value; - return widget.projectId == drag.projectId && - workspace?.activeProject?.id == drag.projectId && - !_attachments.any((item) => item.id == drag.assetId) && - workspace!.assets.any((asset) => asset.id == drag.assetId); - } - - bool _canAttachExternalFiles(List files) { - if (files.isEmpty) return true; - final assets = ref.read(projectsProvider).asData?.value.assets; - if (assets == null) return false; - final attachedIds = {for (final item in _attachments) item.id}; - final attachedLocations = { - for (final asset in assets) - if (attachedIds.contains(asset.id)) ?mediaSourceLocation(asset), - }; - return files.any( - (file) => !attachedLocations.contains(file.sourceUri.toString()), - ); - } - - void _attachAsset(AssetDocument asset) => _composer.attach(asset); - - bool get _desktop => ref.read(platformCapabilitiesProvider).nativeFileDrop; - - Future _dropExternalFiles(List files) async { - setState(() => _dropHovering = false); - try { - await _composer.importAttachments(files); - } catch (_) { - // Feedback belongs to the composer even if this panel is hidden. - } - } - Future _pickAttachments() async { try { await _composer.pickAttachments(); @@ -232,64 +175,27 @@ class _AgentChatPanelState extends ConsumerState { } } - Widget _agentDropRegion(Widget child) { - final workspace = ref.watch(projectsProvider).asData?.value; - final enabled = - _desktop && - widget.projectId != null && - workspace?.activeProject?.id == widget.projectId && - (workspace?.projectBusy == false || _importingAttachments); - final internal = DragTarget( - key: const Key('agent-panel-drop-target'), - hitTestBehavior: HitTestBehavior.opaque, - onWillAcceptWithDetails: (details) => _canAttach(details.data), - onAcceptWithDetails: (details) { - final drag = details.data; - if (!_canAttach(drag)) return; - final asset = ref - .read(projectsProvider) - .asData! - .value - .assets - .firstWhere((item) => item.id == drag.assetId); - _attachAsset(asset); - }, - builder: (context, candidates, rejected) => Stack( - fit: StackFit.expand, - children: [ - child, - if (candidates.isNotEmpty || _dropHovering) - const Positioned.fill( - child: DropToAddOverlay(key: Key('agent-drop-overlay')), - ), - ], - ), - ); - if (!_desktop) return internal; - return NativeProjectDropRegion( - regionId: 'attachments', - policy: NativeFileDropPolicy.attachments, - enabled: enabled, - onEnter: (files) { - if (!_importingAttachments && _canAttachExternalFiles(files)) { - setState(() => _dropHovering = true); - } - }, - onExit: () { - if (mounted && _dropHovering) setState(() => _dropHovering = false); - }, - onDrop: _dropExternalFiles, - child: internal, - ); - } - @override Widget build(BuildContext context) { - ref.watch(settingsOperationProvider(_modelOperation)); + ref.watch( + settingsOperationProvider(_modelOperation) + .select((value) => value.isLoading), + ); if (widget.projectId != null) { - ref.watch(externalMediaImportProvider(widget.projectId!)); + ref.watch( + externalMediaImportProvider(widget.projectId!) + .select((value) => value.isLoading), + ); } - final workspace = ref.watch(projectsProvider).asData?.value; + final workspace = ref.watch( + projectsProvider.select( + (value) => value.asData?.value.copyWith( + recent: const [], + error: null, + creatingTimeline: false, + ), + ), + ); final referenceValidator = ComposerReferenceValidator( workspace: workspace, projectId: widget.projectId, @@ -305,7 +211,9 @@ class _AgentChatPanelState extends ConsumerState { draftKey: widget.draftKey, ) : null; - final state = provider == null ? const ChatState() : ref.watch(provider); + final state = provider == null + ? const ChatState() + : ref.watch(provider.select(chatChrome)); final settings = ref.watch(agentSettingsProvider).asData?.value; final available = settings?.providers @@ -360,7 +268,7 @@ class _AgentChatPanelState extends ConsumerState { }); if (!mounted || !context.mounted) return; if (saved) { - setState(() => _usingDraftModel = true); + _composer.useDraftModel(); } else { ErrorNotificationHost.of(context).show( ErrorNotification( @@ -379,7 +287,7 @@ class _AgentChatPanelState extends ConsumerState { key: const Key('agent-configure-model'), style: compactButtonStyle, onPressed: () => showSettingsPage(context, initialTab: 1), - icon: const Icon(Icons.tune, size: 16), + icon: const Icon(AppIcons.tune, size: 16), label: Text(context.l10n.agentConfigureModel), ); } @@ -423,14 +331,14 @@ class _AgentChatPanelState extends ConsumerState { ), ), const SizedBox(width: 4), - const Icon(Icons.expand_more, size: 14), + const Icon(AppIcons.expandMore, size: 14), ], ), ), ); } - if (provider != null) { + if (provider != null && TickerMode.valuesOf(context).enabled) { ref.listen(provider, (previous, next) { if (_follow) { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -453,12 +361,7 @@ class _AgentChatPanelState extends ConsumerState { (_input.text.trim().isEmpty && _attachments.isEmpty)) { return; } - final text = AgentComposerMessage.encodeDocument( - _input.segments, - _attachments, - ); - _input.clearDocument(); - _composer.clear(); + final text = takeAgentDraft(_input, _composer); _follow = true; ref .read(provider.notifier) @@ -471,8 +374,10 @@ class _AgentChatPanelState extends ConsumerState { } final theme = Theme.of(context); - final content = _agentDropRegion( - LayoutBuilder( + final content = AgentAttachmentDropRegion( + projectId: widget.projectId, + composer: _composer, + child: LayoutBuilder( builder: (context, constraints) { final panelWidth = (constraints.maxWidth - ComposerLayout.horizontalInset * 2) @@ -562,8 +467,8 @@ class _AgentChatPanelState extends ConsumerState { ), ), Icon( - Icons - .chevron_right, + AppIcons + .chevronRight, size: 14, color: AppTheme.chatMetaTextStyle( @@ -575,7 +480,6 @@ class _AgentChatPanelState extends ConsumerState { ), Divider( height: 1, - thickness: 1, color: theme.dividerColor, ), @@ -640,32 +544,39 @@ class _AgentChatPanelState extends ConsumerState { in AgentComposerMessage.decode( message.text, ).attachments) - if (ref - .watch( - projectsProvider, - ) - .asData - ?.value - .assets - .where( - ( - asset, - ) => - asset.id == - attachment.id, - ) - .firstOrNull - case final asset?) - AgentAttachmentCard( - asset: asset, - ) - else - Chip( - label: Text( - attachment - .name, - ), - ), + Consumer( + builder: (context, ref, _) { + final asset = ref.watch( + projectsProvider.select( + ( + value, + ) => value + .asData + ?.value + .assets + .where( + ( + asset, + ) => + asset.id == + attachment.id, + ) + .firstOrNull, + ), + ); + return asset == + null + ? Chip( + label: Text( + attachment.name, + ), + ) + : AgentAttachmentCard( + asset: + asset, + ); + }, + ), ], ), ), @@ -681,44 +592,12 @@ class _AgentChatPanelState extends ConsumerState { ], ), ), - if (state.busy) ...[ - if (state - .partialResponse - .isNotEmpty) - SelectableText( - state.partialResponse, - style: - AppTheme.chatMessageTextStyle( - context, - ), - ), - Text( - state.stopping - ? context.l10n.stopping - : switch (state.activity) { - AgentChatActivity - .compacting => - context - .l10n - .agentCompacting, - AgentChatActivity - .editing => - context - .l10n - .agentEditing, - AgentChatActivity - .verifying => - context - .l10n - .agentVerifying, - AgentChatActivity - .replying => - context.l10n.replying, - }, - style: - theme.textTheme.bodySmall, - ), - ], + AgentReplyRegion( + projectId: widget.projectId, + conversationId: + widget.conversationId, + draftKey: widget.draftKey, + ), ], ), ), @@ -751,7 +630,7 @@ class _AgentChatPanelState extends ConsumerState { horizontal: AppSpacing.compact, ), child: Text( - _errorMessage(context, error), + agentChatErrorMessage(context, error), style: theme.textTheme.bodySmall, ), ), @@ -1045,7 +924,7 @@ class _AgentChatPanelState extends ConsumerState { ? _pickAttachments : null, icon: const Icon( - Icons.add, + AppIcons.add, ), ), const SizedBox( @@ -1085,7 +964,7 @@ class _AgentChatPanelState extends ConsumerState { ) .stop, icon: const Icon( - Icons.stop, + AppIcons.stop, ), ) else @@ -1120,7 +999,7 @@ class _AgentChatPanelState extends ConsumerState { ? send : null, icon: const Icon( - Icons.arrow_upward, + AppIcons.arrowUp, ), ), ), diff --git a/lib/features/assistant/agent_composer_controller.dart b/lib/features/assistant/agent_composer_controller.dart index 76d3f4f..ba37394 100644 --- a/lib/features/assistant/agent_composer_controller.dart +++ b/lib/features/assistant/agent_composer_controller.dart @@ -22,6 +22,14 @@ class AgentComposerController extends ChangeNotifier { final List attachments; final feedback = MediaImportFeedbackController(); bool _busy = false; + bool _usingDraftModel = false; + bool get usingDraftModel => _usingDraftModel; + void useDraftModel() { + if (_disposed) return; + _usingDraftModel = true; + notifyListeners(); + } + bool _disposed = false; bool get busy => _busy; diff --git a/lib/features/assistant/agent_composer_store.dart b/lib/features/assistant/agent_composer_store.dart index 1b9d423..6c1135e 100644 --- a/lib/features/assistant/agent_composer_store.dart +++ b/lib/features/assistant/agent_composer_store.dart @@ -37,12 +37,24 @@ final class AgentComposerStore { final AgentComposerController Function(String?) createComposer; ComposerDocumentController _draft = ComposerDocumentController(); ComposerDocumentController get draft => _draft; + final _projectDrafts = {}; final _inputs = <(String?, String), ComposerDocumentController>{}; final _composers = <(String?, String), AgentComposerController>{}; - ComposerDocumentController input(String? projectId, String? conversationId) => - conversationId == null - ? draft + ComposerDocumentController input( + String? projectId, + String? conversationId, { + bool projectScoped = false, + }) => conversationId == null + ? projectScoped + ? _projectDrafts.putIfAbsent( + projectId, + () => projectId == null + ? ComposerDocumentController() + : _projectDrafts.remove(null) ?? + ComposerDocumentController(), + ) + : draft : _inputs.putIfAbsent(( projectId, conversationId, @@ -57,8 +69,9 @@ final class AgentComposerStore { void promoteDraft(String projectId, String draftKey, String conversationId) { final destination = (projectId, conversationId); _inputs.remove(destination)?.dispose(); - _inputs[destination] = _draft; - _draft = ComposerDocumentController(); + final scoped = _projectDrafts.remove(projectId); + _inputs[destination] = scoped ?? _draft; + if (scoped == null) _draft = ComposerDocumentController(); final composer = _composers.remove((projectId, draftKey)); if (composer != null) { _composers.remove(destination)?.dispose(); @@ -77,6 +90,10 @@ final class AgentComposerStore { void dispose() { draft.dispose(); + for (final input in _projectDrafts.values) { + input.dispose(); + } + _projectDrafts.clear(); for (final input in _inputs.values) { input.dispose(); } diff --git a/lib/features/assistant/agent_panel_presentation.dart b/lib/features/assistant/agent_panel_presentation.dart new file mode 100644 index 0000000..92828ef --- /dev/null +++ b/lib/features/assistant/agent_panel_presentation.dart @@ -0,0 +1,26 @@ +import 'package:flutter/widgets.dart'; + +class AgentPanelPresentation extends InheritedWidget { + const AgentPanelPresentation({ + super.key, + required this.compact, + this.expanded = false, + this.onToggleExpanded, + this.onDock, + required super.child, + }); + final bool compact; + final bool expanded; + final VoidCallback? onToggleExpanded; + final VoidCallback? onDock; + static AgentPanelPresentation? of(BuildContext context) => + context.dependOnInheritedWidgetOfExactType(); + static bool compactOf(BuildContext context) => + context + .dependOnInheritedWidgetOfExactType() + ?.compact ?? + false; + @override + bool updateShouldNotify(AgentPanelPresentation oldWidget) => + compact != oldWidget.compact || expanded != oldWidget.expanded; +} diff --git a/lib/features/assistant/agent_reply_region.dart b/lib/features/assistant/agent_reply_region.dart new file mode 100644 index 0000000..9ef91d1 --- /dev/null +++ b/lib/features/assistant/agent_reply_region.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:cutdex_ui/theme.dart'; + +import '../../l10n/l10n.dart'; +import 'chat_controller.dart'; +import 'chat_state.dart'; + +/// Streaming output observes its conversation independently of history/composer. +class AgentReplyRegion extends ConsumerWidget { + const AgentReplyRegion({ + super.key, + required this.projectId, + this.conversationId, + this.draftKey, + }); + + final String? projectId; + final String? conversationId; + final String? draftKey; + + @override + Widget build(BuildContext context, WidgetRef ref) { + if (projectId == null) return const SizedBox.shrink(); + final provider = + chatControllerProvider( + projectId!, + conversationId: conversationId, + draftKey: draftKey, + ).select( + (state) => ( + state.busy, + state.partialResponse, + state.stopping, + state.activity, + ), + ); + final state = TickerMode.valuesOf(context).enabled + ? ref.watch(provider) + : ref.read(provider); + if (!state.$1) return const SizedBox.shrink(); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (state.$2.isNotEmpty) + SelectionArea( + child: Text( + state.$2, + style: AppTheme.chatMessageTextStyle(context), + ), + ), + Text( + state.$3 + ? context.l10n.stopping + : switch (state.$4) { + AgentChatActivity.compacting => context.l10n.agentCompacting, + AgentChatActivity.editing => context.l10n.agentEditing, + AgentChatActivity.verifying => context.l10n.agentVerifying, + AgentChatActivity.replying => context.l10n.replying, + }, + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ); + } +} + +/// Stable chrome/history snapshot; each streamed token belongs to reply region. +ChatState chatChrome(ChatState state) => + state.copyWith(partialResponse: '', activity: AgentChatActivity.replying); diff --git a/lib/features/assistant/composer_document.dart b/lib/features/assistant/composer_document.dart index 33d312c..460fe7a 100644 --- a/lib/features/assistant/composer_document.dart +++ b/lib/features/assistant/composer_document.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; part 'composer_document.freezed.dart'; @@ -322,8 +323,8 @@ class ComposerDocumentController extends TextEditingController { padding: const EdgeInsets.only(right: 4), child: Icon( mark.reference.kind == ComposerReferenceKind.timeline - ? Icons.view_timeline_outlined - : Icons.attach_file, + ? AppIcons.timeline + : AppIcons.attachment, size: 14, color: color, ), diff --git a/lib/features/assistant/composer_project_selector.dart b/lib/features/assistant/composer_project_selector.dart index afd5b2d..54e0d3e 100644 --- a/lib/features/assistant/composer_project_selector.dart +++ b/lib/features/assistant/composer_project_selector.dart @@ -4,6 +4,7 @@ import '../../l10n/l10n.dart'; import '../../shared/layout/composer_layout.dart'; import '../../shared/theme/composer_style.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import '../../workspace/project_state.dart'; @@ -72,7 +73,7 @@ class _ComposerProjectSelectorState extends State { if (selected == true) ...[ const SizedBox(width: ComposerLayout.menuIconGap), Icon( - Icons.check, + AppIcons.check, size: ComposerLayout.menuIconSize, color: colors.onSurfaceVariant, ), @@ -85,10 +86,7 @@ class _ComposerProjectSelectorState extends State { Widget _separator() => const Padding( padding: AppComposerStyle.menuSeparatorPadding, - child: Divider( - height: 1, - thickness: AppComposerStyle.menuSeparatorThickness, - ), + child: Divider(height: 1), ); @override @@ -141,6 +139,8 @@ class _ComposerProjectSelectorState extends State { controller: _search, autofocus: true, style: AppTheme.composerTextStyle(context), + cursorHeight: AppTheme.composerCursorHeight(context), + textAlignVertical: TextAlignVertical.center, onChanged: (_) => setState(() {}), decoration: AppComposerStyle.projectSearchDecoration( context, @@ -169,7 +169,7 @@ class _ComposerProjectSelectorState extends State { _item( key: ValueKey('composer-project-${project.id}'), label: project.name, - icon: Icons.folder_outlined, + icon: AppIcons.folder, selected: project.id == widget.selected?.id, onPressed: widget.busy || !project.availability.canOpen @@ -188,7 +188,7 @@ class _ComposerProjectSelectorState extends State { key: const Key('composer-new-project'), secondary: true, label: context.l10n.newProject, - icon: Icons.add, + icon: AppIcons.add, onPressed: widget.busy || widget.onCreate == null ? null : () { @@ -209,7 +209,7 @@ class _ComposerProjectSelectorState extends State { : controller.open(), style: AppComposerStyle.projectTrigger(context), icon: const Icon( - Icons.folder_outlined, + AppIcons.folder, size: ComposerLayout.menuIconSize, ), label: Text( diff --git a/lib/features/assistant/composer_suggestions.dart b/lib/features/assistant/composer_suggestions.dart index f00a7e2..a385d15 100644 --- a/lib/features/assistant/composer_suggestions.dart +++ b/lib/features/assistant/composer_suggestions.dart @@ -1,5 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:cutdex_sdk/project.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import '../../l10n/app_localizations.dart'; @@ -62,10 +63,10 @@ abstract final class ComposerOptionCatalog { title: asset.name, subtitle: l10n.materials, icon: switch (asset.metadata['kind']) { - 'video' => Icons.movie_outlined, - 'audio' => Icons.audiotrack_outlined, - 'image' => Icons.image_outlined, - _ => Icons.insert_drive_file_outlined, + 'video' => AppIcons.video, + 'audio' => AppIcons.audio, + 'image' => AppIcons.image, + _ => AppIcons.file, }, group: ComposerOptionGroup.media, reference: ComposerReference( @@ -80,7 +81,7 @@ abstract final class ComposerOptionCatalog { trigger: '@', title: timeline.name, subtitle: l10n.timelines, - icon: Icons.view_timeline_outlined, + icon: AppIcons.timeline, group: ComposerOptionGroup.timeline, reference: ComposerReference( kind: ComposerReferenceKind.timeline, diff --git a/lib/features/assistant/floating_agent_panel.dart b/lib/features/assistant/floating_agent_panel.dart new file mode 100644 index 0000000..a3e9e24 --- /dev/null +++ b/lib/features/assistant/floating_agent_panel.dart @@ -0,0 +1,792 @@ +import 'agent_reply_region.dart'; +import '../../workspace/projects.dart'; + +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; + +import '../../shared/layout/composer_layout.dart'; +import '../../shared/theme/composer_style.dart'; +import '../../shared/widgets/workspace_resize_handle.dart'; + +import '../../l10n/l10n.dart'; +import '../../workspace/project_state.dart'; +import '../../workspace/external_media_import.dart'; +import '../../integrations/agent/agent_provider.dart'; +import '../../integrations/agent/conversation_repository.dart'; +import '../projects/conversation_sidebar.dart'; +import '../media/media_browser_feedback.dart'; +import '../settings/settings_page.dart'; +import '../../settings/settings_operation.dart'; +import '../../shared/widgets/error_notification_host.dart'; +import 'agent_chat_actions.dart'; +import 'agent_attachment_card.dart'; +import 'agent_attachment_drop_region.dart'; +import 'agent_composer_controller.dart'; +import 'agent_message_codec.dart'; +import 'breakable_selectable_text.dart'; +import 'chat_controller.dart'; +import 'chat_state.dart'; +import 'composer_document.dart'; +import 'composer_reference_validator.dart'; +import 'composer_suggestion_surface.dart'; + +/// Independent floating presentation of the same conversation and draft stores. +class FloatingAgentPanel extends ConsumerStatefulWidget { + const FloatingAgentPanel({ + super.key, + required this.state, + required this.selection, + required this.input, + required this.composer, + required this.expanded, + required this.onToggleExpanded, + required this.onDock, + required this.onConversationCreated, + required this.onConversationUpdated, + }); + final ProjectState state; + final ConversationSelectionState selection; + final ComposerDocumentController input; + final AgentComposerController composer; + final bool expanded; + final VoidCallback onToggleExpanded; + final VoidCallback onDock; + final ValueChanged onConversationCreated; + final ValueChanged onConversationUpdated; + @override + ConsumerState createState() => _FloatingAgentPanelState(); +} + +class _FloatingAgentPanelState extends ConsumerState + with SingleTickerProviderStateMixin { + final _scroll = ScrollController(); + late final AnimationController _reveal; + bool _resizing = false; + + void _animateReveal(bool expanded) { + _reveal.animateTo(expanded ? 1 : 0, curve: Curves.easeOutCubic); + } + + void _startResize() { + _reveal.stop(); + setState(() => _resizing = true); + } + + void _finishResize() { + if (!_resizing) return; + final expanded = _reveal.value >= .35; + setState(() => _resizing = false); + if (expanded != widget.expanded) { + widget.onToggleExpanded(); + } else { + _animateReveal(expanded); + } + } + + void _changed() { + if (mounted) setState(() {}); + } + + @override + void initState() { + super.initState(); + _reveal = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 220), + value: widget.expanded ? 1 : 0, + ); + widget.composer.addListener(_changed); + } + + @override + void didUpdateWidget(FloatingAgentPanel oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.expanded != oldWidget.expanded) { + _animateReveal(widget.expanded); + } + if (oldWidget.input != widget.input) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted && _scroll.hasClients) { + _scroll.jumpTo(_scroll.position.maxScrollExtent); + } + }); + } + if (oldWidget.composer != widget.composer) { + oldWidget.composer.removeListener(_changed); + widget.composer.addListener(_changed); + } + } + + @override + void dispose() { + widget.composer.removeListener(_changed); + _reveal.dispose(); + _scroll.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final assets = + ref.watch( + projectsProvider.select( + (value) => + value.asData?.value.activeProject?.id == + widget.state.activeProject?.id + ? value.asData?.value.assets + : null, + ), + ) ?? + widget.state.assets; + final workspace = widget.state.copyWith(assets: assets); + final projectId = workspace.activeProject?.id; + final timelineId = widget.state.timeline?.id; + final selection = widget.selection; + final provider = projectId == null + ? null + : chatControllerProvider( + projectId, + conversationId: selection.selectedId, + draftKey: selection.selectedId == null ? selection.draftKey : null, + ); + final chat = provider == null + ? const ChatState() + : ref.watch(provider.select(chatChrome)); + final settings = ref.watch(agentSettingsProvider).value; + final available = + settings?.providers + .where( + (p) => + p.enabled && + AgentApiType.values.any((type) => type.name == p.apiType) && + p.models.isNotEmpty, + ) + .toList() ?? + []; + final conversation = chat.conversation; + final providerId = conversation?.providerId ?? settings?.selectedProviderId; + final modelId = conversation?.modelId ?? settings?.selectedModelId; + final selectedProvider = available + .where((p) => p.id == providerId) + .firstOrNull; + final selectedModel = selectedProvider?.models + .where((m) => m.id == modelId) + .firstOrNull; + final configured = + conversation != null || + (selection.selectedId != null && !widget.composer.usingDraftModel) + ? conversation != null && + settings?.enabled == true && + selectedModel != null + : ref.watch(agentRuntimeProvider).value != null; + final importing = + widget.composer.busy || + (projectId != null && + ref.watch( + externalMediaImportProvider(projectId) + .select((value) => value.isLoading), + )); + final operation = + 'agent-model-$projectId-${selection.selectedId ?? selection.draftKey}'; + final choosingModel = ref.watch( + settingsOperationProvider(operation).select((value) => value.isLoading), + ); + final validator = ComposerReferenceValidator( + workspace: workspace, + projectId: projectId, + ); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) validator.validate(widget.input); + }); + if (provider != null && TickerMode.valuesOf(context).enabled) { + ref.listen(provider, (old, next) { + if (_scroll.hasClients && _scroll.position.extentAfter < 80) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted && _scroll.hasClients) { + _scroll.jumpTo(_scroll.position.maxScrollExtent); + } + }); + } + }); + } + void send() { + validator.validate(widget.input); + if (provider == null || + timelineId == null || + !configured || + choosingModel || + chat.busy || + importing || + widget.input.hasInvalidReferences || + (widget.input.text.trim().isEmpty && + widget.composer.attachments.isEmpty)) { + return; + } + final text = takeAgentDraft(widget.input, widget.composer); + if (!widget.expanded) widget.onToggleExpanded(); + unawaited( + ref + .read(provider.notifier) + .send( + text, + timelineId: timelineId, + onCreated: widget.onConversationCreated, + onUpdated: widget.onConversationUpdated, + ), + ); + } + + Future chooseModel(String p, String m) async { + if (chat.busy || choosingModel) return; + final composer = widget.composer; + final saved = await ref + .read(settingsOperationProvider(operation).notifier) + .run(() async { + if (provider == null) { + await ref.read(agentSettingsProvider.notifier).selectModel(p, m); + } else { + await ref.read(provider.notifier).selectModel(p, m); + } + }); + if (!mounted || !context.mounted) return; + if (saved) composer.useDraftModel(); + if (!saved && context.mounted) { + ErrorNotificationHost.of(context).show( + ErrorNotification( + content: Text(context.l10n.agentSaveSettingsFailed), + ), + ); + } + } + + final groups = ref.watch(conversationSidebarProvider).value?.groups; + final items = groups?[projectId] ?? const []; + final title = + conversation?.title ?? + items.where((c) => c.id == selection.selectedId).firstOrNull?.title ?? + context.l10n.agentNewConversation; + final inputDecoration = AppComposerStyle.inputDecoration( + context, + hintText: context.l10n.assistantHint, + ); + Widget modelButton() => AppDropdownMenu( + enabled: !chat.busy && !choosingModel, + minWidth: ComposerLayout.menuWidth, + maxHeight: ComposerLayout.menuListMaxHeight, + items: [ + for (final p in available) ...[ + AppMenuLabel(p.name), + for (final m in p.models) + AppMenuItem( + label: m.id, + selectOption: true, + selected: p.id == providerId && m.id == modelId, + onPressed: () => unawaited(chooseModel(p.id, m.id)), + ), + ], + const Divider(height: 1), + AppMenuItem( + label: context.l10n.agentConfigureModel, + onPressed: () => showSettingsPage(context, initialTab: 1), + ), + ], + builder: (context, toggle, focus) => Tooltip( + message: selectedModel?.id ?? context.l10n.agentConfigureModel, + child: AppToolbarDropdownButton( + buttonKey: const Key('floating-agent-model-picker'), + focusNode: focus, + onPressed: toggle, + style: AppComposerStyle.controlButton(context), + child: const Icon(AppIcons.model, size: ComposerLayout.iconSize), + ), + ), + ); + final conversationView = ExcludeFocus( + excluding: !widget.expanded && !_resizing, + child: IgnorePointer( + ignoring: !widget.expanded && !_resizing, + child: LayoutBuilder( + builder: (context, constraints) { + final height = constraints.maxHeight.clamp( + AppControlSize.panelToolbar + 1, + double.infinity, + ); + return ClipRect( + child: OverflowBox( + alignment: Alignment.topCenter, + minHeight: height, + maxHeight: height, + child: Column( + children: [ + SizedBox( + height: AppControlSize.panelToolbar, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: AppSpacing.small, + ), + child: Row( + children: [ + IconButton( + key: const Key('floating-agent-collapse'), + style: AppComposerStyle.controlIcon(context), + tooltip: context.l10n.agentCollapseConversation, + onPressed: widget.onToggleExpanded, + icon: const Icon( + AppIcons.remove, + size: AppIconSize.header, + ), + ), + Expanded( + child: AppDropdownMenu( + minWidth: ComposerLayout.menuWidth, + maxHeight: ComposerLayout.menuListMaxHeight, + items: [ + AppMenuItem( + label: context.l10n.agentNewConversation, + onPressed: () => ref + .read( + conversationSidebarProvider.notifier, + ) + .newConversation(), + ), + for (final item in items) + AppMenuItem( + label: item.title, + selectOption: true, + selected: item.id == selection.selectedId, + onPressed: () { + final controller = ref.read( + conversationSidebarProvider.notifier, + ); + controller.activate(item); + unawaited( + controller.rememberSelection(item), + ); + }, + ), + ], + builder: (context, toggle, focus) => + AppToolbarDropdownButton( + focusNode: focus, + onPressed: toggle, + child: Row( + children: [ + Flexible( + child: Text( + title, + key: const Key( + 'agent-floating-title', + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox( + width: AppSpacing.tiny, + ), + const Icon( + AppIcons.expandMore, + size: AppIconSize.header, + ), + ], + ), + ), + ), + ), + IconButton( + key: const Key('floating-agent-dock'), + style: AppComposerStyle.controlIcon(context), + tooltip: context.l10n.agentDock, + onPressed: widget.onDock, + icon: const Icon( + AppIcons.exitFullscreen, + size: AppIconSize.header, + ), + ), + ], + ), + ), + ), + Expanded( + child: ListView( + controller: _scroll, + key: const Key('floating-agent-messages'), + padding: const EdgeInsets.all(AppSpacing.medium), + children: [ + for (final message in chat.messages) + Padding( + padding: const EdgeInsets.only( + bottom: AppSpacing.large, + ), + child: Align( + alignment: message.isUser + ? Alignment.centerRight + : Alignment.centerLeft, + child: Container( + constraints: const BoxConstraints( + maxWidth: ComposerLayout.maxWidth, + ), + padding: message.isUser + ? const EdgeInsets.symmetric( + horizontal: AppSpacing.medium, + vertical: AppSpacing.itemVertical, + ) + : EdgeInsets.zero, + decoration: message.isUser + ? AppTheme.userMessageDecoration(context) + : null, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (message.elapsedMs case final elapsed?) + Text( + context.l10n.agentElapsedTime( + context.l10n.durationSeconds( + (elapsed / 1000).ceil(), + ), + ), + style: AppTheme.chatMetaTextStyle( + context, + ), + ), + if (message.isUser) + BreakableSelectableText( + text: AgentComposerMessage.decode( + message.text, + ).text, + style: AppTheme.chatMessageTextStyle( + context, + ), + ) + else + SelectableText( + AgentComposerMessage.decode( + message.text, + ).text, + style: AppTheme.chatMessageTextStyle( + context, + ), + ), + for (final attachment + in AgentComposerMessage.decode( + message.text, + ).attachments) + Chip(label: Text(attachment.name)), + if (message.interrupted) + Text(context.l10n.replyInterrupted), + ], + ), + ), + ), + ), + AgentReplyRegion( + projectId: projectId, + conversationId: selection.selectedId, + draftKey: selection.selectedId == null + ? selection.draftKey + : null, + ), + ], + ), + ), + ], + ), + ), + ); + }, + ), + ), + ); + final composerView = Padding( + key: const Key('floating-agent-input-area'), + padding: const EdgeInsets.all(AppSpacing.small), + child: LayoutBuilder( + builder: (context, constraints) => ComposerSuggestionSurface( + controller: widget.input, + width: constraints.maxWidth, + projectId: projectId, + assets: assets, + timelines: widget.state.timelines, + onSend: send, + builder: (context, focus) { + final attachment = IconButton( + style: AppComposerStyle.controlIcon(context), + tooltip: context.l10n.addAttachment, + onPressed: + projectId == null || importing || widget.state.projectBusy + ? null + : () async { + try { + await widget.composer.pickAttachments(); + } catch (_) { + /* Shared composer publishes import feedback. */ + } + }, + icon: const Icon(AppIcons.add), + ); + final input = TextField( + key: const Key('floating-agent-input'), + controller: widget.input, + focusNode: focus, + minLines: 1, + maxLines: 5, + style: AppTheme.composerTextStyle(context), + cursorHeight: AppTheme.composerCursorHeight(context), + decoration: inputDecoration.copyWith( + constraints: const BoxConstraints( + minHeight: ComposerLayout.controlSize, + ), + contentPadding: const EdgeInsets.symmetric( + horizontal: AppSpacing.small, + vertical: AppSpacing.tiny, + ), + ), + onTap: () { + if (!widget.expanded) { + widget.onToggleExpanded(); + } + }, + ); + final submit = ValueListenableBuilder( + valueListenable: widget.input, + builder: (context, value, _) => IconButton.filled( + style: AppTheme.accentIconButtonStyle(context) + .merge(AppComposerStyle.controlIcon(context)), + tooltip: chat.busy + ? context.l10n.stopReply + : context.l10n.sendMessage, + onPressed: chat.busy + ? (chat.stopping ? null : ref.read(provider!.notifier).stop) + : provider != null && + timelineId != null && + configured && + !importing && + !choosingModel && + !widget.input.hasInvalidReferences && + (value.text.trim().isNotEmpty || + widget.composer.attachments.isNotEmpty) + ? send + : null, + icon: Icon( + chat.busy ? AppIcons.squareFilled : AppIcons.arrowUp, + size: chat.busy ? 12 : ComposerLayout.iconSize, + ), + ), + ); + // Keep the editor at the same tree position and bottom + // anchor while the conversation opens above it. + return Row( + key: const Key('floating-agent-composer'), + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + attachment, + Expanded(child: input), + modelButton(), + submit, + ], + ); + }, + ), + ), + ); + final content = LayoutBuilder( + builder: (context, constraints) { + final conversationHeight = + (constraints.maxHeight - + ComposerLayout.controlSize - + AppSpacing.small * 2) + .clamp(0.0, double.infinity); + return AnimatedBuilder( + animation: _reveal, + builder: (context, _) => MediaImportFeedbackListener( + feedback: widget.composer.feedback, + child: Material( + color: Theme.of(context).colorScheme.surface, + child: Stack( + children: [ + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Flexible( + child: SizedBox( + key: const Key('floating-agent-conversation-region'), + height: conversationHeight * _reveal.value, + child: ClipRect( + child: Stack( + children: [ + Offstage( + offstage: _reveal.value == 0, + child: conversationView, + ), + Positioned( + left: 0, + right: 0, + bottom: 0, + child: Divider( + key: const Key( + 'floating-agent-input-divider', + ), + height: 1, + thickness: 1, + color: AppTheme.floatingDialogDividerColor( + context, + ), + ), + ), + ], + ), + ), + ), + ), + if (chat.error case final error?) + Padding( + padding: const EdgeInsets.all(AppSpacing.small), + child: Text( + agentChatErrorMessage(context, error), + style: Theme.of(context).textTheme.bodySmall, + ), + ), + if ({ + AgentChatError.recoveryRequired, + AgentChatError.interrupted, + AgentChatError.turnLimit, + AgentChatError.exportReplyFailed, + }.contains(chat.error)) + TextButton( + onPressed: + provider == null || + timelineId == null || + chat.busy + ? null + : () => ref + .read(provider.notifier) + .send( + chat.error == + AgentChatError.exportReplyFailed + ? context.l10n.agentRetrySummary + : context.l10n.agentResumeTask, + timelineId: timelineId, + summaryOnly: + chat.error == + AgentChatError.exportReplyFailed, + resumeOnly: + chat.error != + AgentChatError.exportReplyFailed, + onUpdated: widget.onConversationUpdated, + ), + child: Text( + chat.error == AgentChatError.exportReplyFailed + ? context.l10n.agentRetrySummary + : context.l10n.agentResumeTask, + ), + ), + ValueListenableBuilder( + valueListenable: widget.input, + builder: (context, _, _) => + widget.input.hasInvalidReferences + ? Padding( + padding: const EdgeInsets.all(AppSpacing.small), + child: Text( + context.l10n.composerReferenceInvalid, + style: AppSurfaces.of(context).errorText, + ), + ) + : const SizedBox.shrink(), + ), + if (widget.composer.attachments.isNotEmpty) + Padding( + padding: const EdgeInsets.all(AppSpacing.small), + child: Wrap( + spacing: AppSpacing.gap, + children: [ + for (final asset in widget.composer.attachments) + if (assets + .where((item) => item.id == asset.id) + .firstOrNull + case final document?) + AgentAttachmentCard( + asset: document, + onRemove: () => + widget.composer.remove(asset.id), + ) + else + InputChip( + label: Text(asset.name), + onDeleted: () => + widget.composer.remove(asset.id), + ), + ], + ), + ), + composerView, + ], + ), + Positioned( + top: 0, + left: ComposerLayout.radius, + right: ComposerLayout.radius, + height: AppSpacing.small, + child: Semantics( + button: true, + label: widget.expanded + ? context.l10n.agentCollapseConversation + : context.l10n.agentExpandConversation, + onTap: widget.onToggleExpanded, + child: Stack( + fit: StackFit.expand, + children: [ + Center( + child: Container( + width: ComposerLayout.controlSize, + height: 2, + decoration: BoxDecoration( + color: Theme.of(context) + .colorScheme + .onSurfaceVariant + .withValues(alpha: .35), + borderRadius: BorderRadius.circular( + AppRadius.pill, + ), + ), + ), + ), + WorkspaceResizeHandle( + key: const Key('floating-agent-resize-handle'), + axis: Axis.vertical, + direction: -1, + initialValue: _reveal.value * conversationHeight, + onStart: _startResize, + onResize: (height) { + if (conversationHeight > 0) { + _reveal.value = (height / conversationHeight) + .clamp(0.0, 1.0); + } + }, + onEnd: _finishResize, + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + }, + ); + return AgentAttachmentDropRegion( + projectId: projectId, + composer: widget.composer, + shrinkWrap: true, + child: content, + ); + } +} diff --git a/lib/features/assistant/workspace_agent_surface.dart b/lib/features/assistant/workspace_agent_surface.dart index b23a4e8..13aed5d 100644 --- a/lib/features/assistant/workspace_agent_surface.dart +++ b/lib/features/assistant/workspace_agent_surface.dart @@ -9,6 +9,8 @@ import '../../workspace/project_state.dart'; import '../projects/conversation_sidebar.dart'; import 'agent_chat_panel.dart'; +import 'agent_panel_presentation.dart'; +import 'floating_agent_panel.dart'; import 'agent_composer_store.dart'; import 'composer_project_selector.dart'; @@ -19,11 +21,13 @@ class WorkspaceAgentSurface extends ConsumerWidget { required this.state, required this.onSelectProject, required this.onCreateProject, + this.showProjectSelector = true, }); final ProjectState state; final ValueChanged? onSelectProject; final VoidCallback? onCreateProject; + final bool showProjectSelector; @override Widget build(BuildContext context, WidgetRef ref) { @@ -34,21 +38,54 @@ class WorkspaceAgentSurface extends ConsumerWidget { final composers = ref.watch(agentComposerStoreProvider); final projectId = state.activeProject?.id; final conversationId = selection.selectedId; + final presentation = AgentPanelPresentation.of(context); + if (presentation?.compact == true) { + return FloatingAgentPanel( + state: state, + selection: selection, + input: composers.input( + projectId, + conversationId, + projectScoped: !showProjectSelector, + ), + composer: composers.composer( + projectId, + conversationId ?? selection.draftKey, + ), + expanded: presentation!.expanded, + onToggleExpanded: presentation.onToggleExpanded!, + onDock: presentation.onDock!, + onConversationCreated: (item) => unawaited( + conversations.updateListing( + item, + selectIfDraftKey: selection.draftKey, + ), + ), + onConversationUpdated: (item) => + unawaited(conversations.updateListing(item)), + ); + } return AgentChatPanel( key: ValueKey((projectId, conversationId ?? selection.draftKey)), - inputController: composers.input(projectId, conversationId), + inputController: composers.input( + projectId, + conversationId, + projectScoped: !showProjectSelector, + ), composer: composers.composer( projectId, conversationId ?? selection.draftKey, ), - projectSelector: ComposerProjectSelector( - backgroundColor: AppTheme.composerUtilityBackground(context), - projects: state.recent, - selected: state.activeProject, - busy: state.projectBusy, - onSelect: (project) => onSelectProject?.call(project), - onCreate: onCreateProject, - ), + projectSelector: showProjectSelector + ? ComposerProjectSelector( + backgroundColor: AppTheme.composerUtilityBackground(context), + projects: state.recent, + selected: state.activeProject, + busy: state.projectBusy, + onSelect: (project) => onSelectProject?.call(project), + onCreate: onCreateProject, + ) + : null, composerColor: AppSurfaces.of(context).composerBackground, projectId: projectId, timelineId: state.timeline?.id, diff --git a/lib/features/editor/background_tasks_button.dart b/lib/features/editor/background_tasks_button.dart index 347e3e4..772ca67 100644 --- a/lib/features/editor/background_tasks_button.dart +++ b/lib/features/editor/background_tasks_button.dart @@ -2,11 +2,12 @@ import 'package:cutdex/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import '../../integrations/runtime/processing_resource_repository.dart'; import '../../workspace/background_task_registry.dart'; -import '../../workspace/background_task_state.dart'; +import '../../shared/widgets/listenable_selector.dart'; import '../../integrations/runtime/processing_resource_state.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -14,9 +15,14 @@ import 'package:cutdex_ui/widgets.dart'; import '../media/background_tasks_dialog.dart'; class BackgroundTasksButton extends ConsumerWidget { - const BackgroundTasksButton({super.key, this.iconSize = AppIconSize.header}); + const BackgroundTasksButton({ + super.key, + this.iconSize = AppIconSize.header, + this.alignment = AlignmentDirectional.bottomStart, + }); final double iconSize; + final AlignmentGeometry alignment; @override Widget build(BuildContext context, WidgetRef ref) { @@ -25,30 +31,39 @@ class BackgroundTasksButton extends ConsumerWidget { .watch(processingResourceRepositoryProvider) .asData ?.value; - final tasks = ref.watch(backgroundTasksProvider(registry: registry)); final downloads = resources == null ? null - : ref.watch(processingResourcesProvider(resources)); - bool hasRunningTasks() => - tasks.runningCount > 0 || - downloads?.subtitleDownloading == true || - (downloads?.installs.any( - (install) => install.state == ProcessingResourceState.downloading, - ) ?? - false); - Widget button(VoidCallback toggle) => IconButton( + : ref.watch( + processingResourcesProvider(resources).select( + (downloads) => + downloads.subtitleDownloading || + downloads.installs.any( + (install) => + install.state == ProcessingResourceState.downloading, + ), + ), + ); + Widget button(VoidCallback toggle, bool running) => IconButton( key: const ValueKey('background-tasks-button'), tooltip: context.l10n.backgroundTasks, onPressed: toggle, icon: Badge( - isLabelVisible: hasRunningTasks(), - child: Icon(Icons.task_alt_outlined, size: iconSize), + isLabelVisible: running || downloads == true, + child: Icon(AppIcons.success, size: iconSize), ), ); - return AppPopover( - width: 384, - builder: (_, toggle) => button(toggle), - child: BackgroundTasksContent(registry: registry, repository: resources), + return ListenableSelector( + listenable: registry, + select: () => registry.runningCount > 0, + builder: (context, running) => AppPopover( + width: 384, + alignment: alignment, + builder: (_, toggle) => button(toggle, running), + child: BackgroundTasksContent( + registry: registry, + repository: resources, + ), + ), ); } } diff --git a/lib/features/editor/editor_page.dart b/lib/features/editor/editor_page.dart index 7ef3ab6..77480eb 100644 --- a/lib/features/editor/editor_page.dart +++ b/lib/features/editor/editor_page.dart @@ -1,3 +1,5 @@ +import '../../shared/widgets/listenable_selector.dart'; + import 'dart:async'; import 'package:cutdex/l10n/l10n.dart'; @@ -11,9 +13,12 @@ import 'package:cutdex_native/cutdex_native.dart'; import '../../persistence/app_settings_repositories.dart'; import '../../shared/layout/workspace_layout_metrics.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import '../../workspace/timeline_provider.dart'; +import '../../workspace/preview_target.dart'; +import '../../workspace/projects.dart'; import '../../workspace/view_settings.dart'; import '../media/media_browser_page.dart'; import '../media/media_panel.dart'; @@ -23,6 +28,7 @@ import '../properties/properties_panel.dart'; import '../timeline/timeline_panel.dart'; import 'editor_presentation_controller.dart'; import 'editor_panel_defaults.dart'; +import 'timeline_operation_region.dart'; import 'layouts/bounded_editor_layout.dart'; import 'layouts/expanded_editor_layout.dart'; @@ -42,6 +48,8 @@ class EditorWorkspace extends ConsumerStatefulWidget { }); final bool projectLoading; + + /// Navigation is preparing another timeline; the current content stays visible. final bool timelineLoading; final String projectId; final String timelineId; @@ -57,7 +65,13 @@ class EditorWorkspace extends ConsumerStatefulWidget { class _EditorWorkspaceState extends ConsumerState { final _previewKey = GlobalKey(); - bool get _timelinePending => widget.projectLoading || widget.timelineLoading; + bool get _timelinePending => widget.projectLoading; + + Widget _timelineInteraction(Widget child) => TimelineOperationRegion( + projectId: widget.projectId, + loading: widget.timelineLoading, + child: child, + ); EditorPresentationController get _presentation => ref.read(editorPresentationProvider(widget.projectId)); ProjectViewSettingsData get _viewSettings => @@ -69,7 +83,8 @@ class _EditorWorkspaceState extends ConsumerState { double? get _timelineHeight => _viewSettings.timelineHeight; void _saveViewSettings() { - if (!ref.read(projectViewSettingsProvider(widget.projectId)).hasValue) { + if (widget.projectId.isEmpty || + !ref.read(projectViewSettingsProvider(widget.projectId)).hasValue) { return; } unawaited(_viewController.save()); @@ -82,10 +97,12 @@ class _EditorWorkspaceState extends ConsumerState { ); final preview = KeyedSubtree( key: _previewKey, - child: EditorPreviewPanel( - projectId: widget.projectId, - timelineId: widget.timelineId, - pending: _timelinePending, + child: _timelineInteraction( + EditorPreviewPanel( + projectId: widget.projectId, + timelineId: widget.timelineId, + pending: _timelinePending, + ), ), ); final timeline = EditorTimelinePanel( @@ -94,35 +111,81 @@ class _EditorWorkspaceState extends ConsumerState { pending: widget.projectLoading, timelineLoading: widget.timelineLoading, ); - final properties = _timelinePending - ? const EditorEmptyPanel() - : EditorPropertiesPanel( - projectId: widget.projectId, - timelineId: widget.timelineId, - ); + final properties = _timelineInteraction( + _timelinePending + ? const EditorEmptyPanel() + : EditorPropertiesPanel( + projectId: widget.projectId, + timelineId: widget.timelineId, + ), + ); final media = widget.projectLoading ? const EditorEmptyPanel() - : MediaPanel(projectId: widget.projectId); + : MediaPanel(projectId: widget.projectId, projectScoped: true); return ListenableBuilder( listenable: ref.watch(editorPresentationProvider(widget.projectId)), builder: (context, _) => LayoutBuilder( builder: (context, constraints) { final desktop = widget.experience == DeviceExperience.desktop; + final mediaOpen = desktop + ? _presentation.mediaOpen + : _presentation.activeTool == EditorTool.media; + final mediaWidth = mediaOpen + ? WorkspaceLayoutMetrics.mediaPanelWidth + + WorkspaceLayoutMetrics.desktopSpacing + : 0.0; final sideWidth = (_propertiesOpen - ? WorkspaceLayoutMetrics.propertiesPanelWidth + 1 + ? WorkspaceLayoutMetrics.propertiesPanelWidth + + WorkspaceLayoutMetrics.desktopSpacing : 0); - final dockPanels = + final dockMedia = desktop && + mediaOpen && constraints.maxWidth >= - WorkspaceLayoutMetrics.previewMinimumWidth + sideWidth; - final desktopTool = _propertiesOpen ? EditorTool.properties : null; - final headerHeight = desktop ? AppControlSize.panelToolbar : 48.0; - final mediaOpen = _presentation.activeTool == EditorTool.media; + WorkspaceLayoutMetrics.previewMinimumWidth + mediaWidth; + final dockProperties = + desktop && + _propertiesOpen && + constraints.maxWidth >= + WorkspaceLayoutMetrics.previewMinimumWidth + + sideWidth + + (dockMedia ? mediaWidth : 0); + final desktopTool = + mediaOpen && !dockMedia && _presentation.desktopToolRequested + ? _presentation.desktopTool(propertiesOpen: _propertiesOpen) + : _propertiesOpen && !dockProperties + ? EditorTool.properties + : null; + final headerHeight = desktop ? AppDesktopMetrics.panelHeader : 48.0; final propertiesOpen = desktop - ? dockPanels + ? dockProperties ? _propertiesOpen : desktopTool == EditorTool.properties : _presentation.activeTool == EditorTool.properties; + final mediaButton = HeaderControlRegion( + child: SizedBox.square( + dimension: desktop ? AppControlSize.headerButton : 48, + child: IconButton( + key: const Key('editor-media-button'), + tooltip: context.l10n.materials, + isSelected: mediaOpen, + onPressed: () { + if (desktop) { + if (!dockMedia && + desktopTool != EditorTool.media && + _presentation.mediaOpen) { + _presentation.preferDesktopTool(EditorTool.media); + } else { + _presentation.toggleMedia(); + } + } else { + _presentation.toggleTool(EditorTool.media); + } + }, + icon: const Icon(AppIcons.mediaLibrary), + ), + ), + ); final header = Material( color: Theme.of(context).colorScheme.surface, child: SizedBox( @@ -132,15 +195,22 @@ class _EditorWorkspaceState extends ConsumerState { padding: desktop ? const EdgeInsets.symmetric( horizontal: AppSidebarMetrics.outerPadding, - vertical: AppSpacing.gap, + vertical: AppSpacing.tiny, ) : EdgeInsets.zero, child: WindowHeaderPadding( child: Row( children: [ widget.headerLeading, + if (desktop) mediaButton, Expanded( - child: widget.showProjectName + child: desktop + ? _PreviewHeaderTitle( + projectId: widget.projectId, + timelineId: widget.timelineId, + pending: _timelinePending, + ) + : widget.showProjectName ? Row( children: [ Flexible( @@ -168,35 +238,7 @@ class _EditorWorkspaceState extends ConsumerState { ) : const SizedBox.shrink(), ), - if (!desktop) - HeaderControlRegion( - child: SizedBox.square( - dimension: desktop - ? AppControlSize.headerButton - : 48, - child: IconButton( - key: const Key('editor-media-button'), - tooltip: context.l10n.materials, - isSelected: mediaOpen, - onPressed: () { - if (desktop) { - if (!dockPanels && - desktopTool != EditorTool.media && - _presentation.mediaOpen) { - _presentation.preferDesktopTool( - EditorTool.media, - ); - } else { - _presentation.toggleMedia(); - } - } else { - _presentation.toggleTool(EditorTool.media); - } - }, - icon: const Icon(Icons.perm_media_outlined), - ), - ), - ), + if (!desktop) mediaButton, if (!desktop) const SizedBox(width: AppSpacing.tiny), HeaderControlRegion( child: SizedBox.square( @@ -211,7 +253,7 @@ class _EditorWorkspaceState extends ConsumerState { ? null : () { if (desktop) { - if (dockPanels || + if (dockProperties || desktopTool == EditorTool.properties || !_propertiesOpen) { @@ -230,7 +272,7 @@ class _EditorWorkspaceState extends ConsumerState { } }, icon: const Icon( - Icons.tune, + AppIcons.tune, size: AppIconSize.header, ), ), @@ -249,8 +291,8 @@ class _EditorWorkspaceState extends ConsumerState { header: header, properties: properties, media: media, - showMedia: false, - showProperties: showTools && _propertiesOpen, + showMedia: dockMedia, + showProperties: showTools && dockProperties, timelineHeight: _timelineHeight, onTimelineHeightChanged: (height) { if (viewSettings.hasValue) { @@ -267,7 +309,7 @@ class _EditorWorkspaceState extends ConsumerState { children: [ if (!desktop) header, Expanded( - child: dockPanels + child: desktop && desktopTool == null ? dockedEditing(showTools: true) : BoundedEditorLayout( experience: widget.experience, @@ -297,14 +339,18 @@ class _EditorWorkspaceState extends ConsumerState { : switch (widget.experience) { DeviceExperience.desktop => properties, DeviceExperience.tablet => - PropertiesToolPanel( - projectId: widget.projectId, - timelineId: widget.timelineId, + _timelineInteraction( + PropertiesToolPanel( + projectId: widget.projectId, + timelineId: widget.timelineId, + ), ), DeviceExperience.phone => - PropertiesEditorPage( - projectId: widget.projectId, - timelineId: widget.timelineId, + _timelineInteraction( + PropertiesEditorPage( + projectId: widget.projectId, + timelineId: widget.timelineId, + ), ), }, onCloseTool: () { @@ -338,6 +384,73 @@ class _EditorWorkspaceState extends ConsumerState { } } +class _PreviewHeaderTitle extends ConsumerWidget { + const _PreviewHeaderTitle({ + required this.projectId, + required this.timelineId, + required this.pending, + }); + + final String projectId; + final String timelineId; + final bool pending; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final navigation = pending + ? const PreviewTargetState.timeline() + : ref.watch(previewNavigationProvider(projectId, timelineId)); + final name = pending + ? context.l10n.preview + : ref.watch( + projectsProvider.select((value) { + final workspace = value.value; + return switch (navigation) { + SourcePreviewTarget(:final asset) => + workspace?.assets + .where((item) => item.id == asset.id) + .firstOrNull + ?.name ?? + asset.name, + _ => + workspace?.timeline?.id == timelineId + ? workspace!.timeline!.name + : context.l10n.preview, + }; + }), + ); + final session = pending + ? null + : ref.watch(editorTimelineProvider(projectId, timelineId)).value; + Widget title(String? saveStatus) => Tooltip( + message: saveStatus == null ? name : '$name\n$saveStatus', + child: Text( + name, + key: const Key('editor-preview-title'), + textAlign: TextAlign.center, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.titleSmall, + ), + ); + if (session == null) return title(null); + return ListenableSelector<(bool, bool, bool)>( + listenable: session, + select: () => (session.error != null, session.saving, session.dirty), + builder: (context, value) => title(_timelineSaveLabel(context, value)), + ); + } +} + +String _timelineSaveLabel(BuildContext context, (bool, bool, bool) value) => + value.$1 + ? context.l10n.unsaved + : value.$2 + ? context.l10n.saving + : value.$3 + ? context.l10n.pendingSave + : context.l10n.saved; + class _TimelineSaveStatus extends ConsumerWidget { const _TimelineSaveStatus({ required this.projectId, @@ -354,22 +467,19 @@ class _TimelineSaveStatus extends ConsumerWidget { .asData ?.value; if (session == null) return const SizedBox.shrink(); - return ListenableBuilder( + return ListenableSelector<(bool, bool, bool)>( listenable: session, - builder: (context, _) => Padding( + select: () => (session.error != null, session.saving, session.dirty), + builder: (context, value) => Padding( padding: const EdgeInsets.only(left: AppSpacing.small), child: Text( - session.error != null - ? context.l10n.unsaved - : session.saving - ? context.l10n.saving - : session.dirty - ? context.l10n.pendingSave - : context.l10n.saved, + _timelineSaveLabel(context, value), key: const Key('timeline-save-status'), maxLines: 1, overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.bodySmall?.copyWith(fontSize: 10), + style: AppTheme.isDesktop(context) + ? Theme.of(context).textTheme.bodySmall + : Theme.of(context).textTheme.bodySmall?.copyWith(fontSize: 10), ), ), ); diff --git a/lib/features/editor/editor_panel_defaults.dart b/lib/features/editor/editor_panel_defaults.dart index cc16926..25ff3d0 100644 --- a/lib/features/editor/editor_panel_defaults.dart +++ b/lib/features/editor/editor_panel_defaults.dart @@ -1,4 +1,7 @@ +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex/l10n/l10n.dart'; import 'package:cutdex_ui/widgets.dart'; +import 'package:cutdex_ui/theme.dart'; import 'package:flutter/material.dart'; /// Empty values while a project's content is being bound to its cards. @@ -19,40 +22,114 @@ class EditorTimelineDefaults extends StatelessWidget { Widget build(BuildContext context) => Column( children: [ if (showTabs) ...[ - const SizedBox( - key: Key('timeline-tabs-bar'), - height: 26, - child: Row( - children: [ - IconButton(onPressed: null, icon: Icon(Icons.add, size: 16)), - ], + ColoredBox( + key: const Key('timeline-tabs-background'), + color: AppTheme.timelineTabsBackground(context), + child: SizedBox( + key: const Key('timeline-tabs-bar'), + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.timelineTabs + : 26, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: AppTheme.isDesktop(context) ? AppSpacing.tiny : 0, + ), + child: Row( + children: [ + if (AppTheme.isDesktop(context)) + SizedBox.square( + dimension: AppDesktopMetrics.timelineTabControl, + child: IconButton( + key: const Key('timeline-add-button'), + onPressed: null, + style: AppTheme.timelineTabActionStyle, + icon: const Icon(AppIcons.add, size: 16), + ), + ) + else + const IconButton( + onPressed: null, + icon: Icon(AppIcons.add, size: 16), + ), + ], + ), + ), ), ), const Divider(height: 1), ], Expanded( child: WorkspacePanel( - headerHeight: 32, + headerHeight: AppTheme.isDesktop(context) + ? AppDesktopMetrics.timelineToolbar + : 32, headerPadding: EdgeInsets.zero, controls: SizedBox( key: const Key('timeline-toolbar'), - height: 32, - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - children: [ - for (final icon in [ - Icons.undo, - Icons.redo, - Icons.content_cut, - Icons.align_horizontal_left, - Icons.align_horizontal_right, - Icons.delete_outline, - ]) - IconButton(onPressed: null, icon: Icon(icon, size: 16)), - ], - ), - ), + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.timelineToolbar + : 32, + child: !AppTheme.isDesktop(context) + ? SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + for (final icon in [ + AppIcons.undo, + AppIcons.redo, + AppIcons.cut, + AppIcons.alignLeft, + AppIcons.alignRight, + AppIcons.delete, + ]) + IconButton( + onPressed: null, + icon: Icon(icon, size: 16), + ), + ], + ), + ) + : Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: AppCommandToolbar( + groups: [ + [ + AppToolbarCommand( + label: context.l10n.undo, + icon: AppIcons.undo, + onPressed: null, + ), + AppToolbarCommand( + label: context.l10n.redo, + icon: AppIcons.redo, + onPressed: null, + ), + ], + [ + AppToolbarCommand( + label: context.l10n.splitAtPlayhead, + icon: AppIcons.cut, + onPressed: null, + ), + AppToolbarCommand( + label: context.l10n.trimLeftTooltip, + icon: AppIcons.alignLeft, + onPressed: null, + ), + AppToolbarCommand( + label: context.l10n.trimRightTooltip, + icon: AppIcons.alignRight, + onPressed: null, + ), + AppToolbarCommand( + label: context.l10n.deleteSelectedClips, + icon: AppIcons.delete, + onPressed: null, + ), + ], + ], + ), + ), ), child: const SizedBox.expand(key: Key('timeline-default-tracks')), ), diff --git a/lib/features/editor/editor_presentation_controller.dart b/lib/features/editor/editor_presentation_controller.dart index 3cd205a..5134c38 100644 --- a/lib/features/editor/editor_presentation_controller.dart +++ b/lib/features/editor/editor_presentation_controller.dart @@ -12,12 +12,14 @@ final editorPresentationProvider = /// Presentation choices survive shell changes without changing project data. class EditorPresentationController extends ChangeNotifier { - bool _mediaOpen = false; + bool _mediaOpen = true; EditorTool? _activeTool; EditorTool _preferredDesktopTool = EditorTool.properties; + bool _desktopToolRequested = false; bool get mediaOpen => _mediaOpen; EditorTool? get activeTool => _activeTool; + bool get desktopToolRequested => _desktopToolRequested; EditorTool desktopTool({required bool propertiesOpen}) => _preferredDesktopTool == EditorTool.media && _mediaOpen ? EditorTool.media @@ -26,12 +28,14 @@ class EditorPresentationController extends ChangeNotifier { : EditorTool.media; void preferDesktopTool(EditorTool tool) { + _desktopToolRequested = true; _preferredDesktopTool = tool; notifyListeners(); } void toggleMedia() { _mediaOpen = !_mediaOpen; + _desktopToolRequested = _mediaOpen; if (_mediaOpen) _preferredDesktopTool = EditorTool.media; notifyListeners(); } diff --git a/lib/features/editor/layouts/bounded_editor_layout.dart b/lib/features/editor/layouts/bounded_editor_layout.dart index 7a93bad..6379653 100644 --- a/lib/features/editor/layouts/bounded_editor_layout.dart +++ b/lib/features/editor/layouts/bounded_editor_layout.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import '../../../integrations/platform/device_experience.dart'; import '../../../l10n/l10n.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import '../editor_presentation_controller.dart'; @@ -36,29 +37,34 @@ class BoundedEditorLayout extends StatelessWidget { Widget toolSurface() => Column( children: [ SizedBox( - height: desktop ? AppControlSize.panelToolbar : 48, - child: Row( - children: [ - SizedBox.square( - dimension: desktop ? AppControlSize.headerButton : 48, - child: IconButton( - key: const Key('editor-tool-close'), - tooltip: MaterialLocalizations.of(context) - .closeButtonTooltip, - onPressed: onCloseTool, - icon: Icon(page ? Icons.arrow_back : Icons.close), + height: desktop ? AppDesktopMetrics.panelHeader : 48, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: desktop ? AppSpacing.small : 0, + ), + child: Row( + children: [ + SizedBox.square( + dimension: desktop ? AppControlSize.headerButton : 48, + child: IconButton( + key: const Key('editor-tool-close'), + tooltip: MaterialLocalizations.of(context) + .closeButtonTooltip, + onPressed: onCloseTool, + icon: Icon(page ? AppIcons.arrowBack : AppIcons.close), + ), ), - ), - Expanded( - child: Text( - tool == EditorTool.media - ? context.l10n.materials - : context.l10n.expandProperties, - maxLines: 1, - overflow: TextOverflow.ellipsis, + Expanded( + child: Text( + tool == EditorTool.media + ? context.l10n.materials + : context.l10n.expandProperties, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), ), - ), - ], + ], + ), ), ), const Divider(height: 1), @@ -92,7 +98,7 @@ class BoundedEditorLayout extends StatelessWidget { ), if (tool != null) Positioned( - top: desktop ? AppControlSize.panelToolbar + 1 : 0, + top: desktop ? AppDesktopMetrics.panelHeader + 1 : 0, bottom: 0, right: 0, width: page diff --git a/lib/features/editor/layouts/expanded_editor_layout.dart b/lib/features/editor/layouts/expanded_editor_layout.dart index adb990f..be1295f 100644 --- a/lib/features/editor/layouts/expanded_editor_layout.dart +++ b/lib/features/editor/layouts/expanded_editor_layout.dart @@ -1,7 +1,6 @@ import 'dart:math' as math; import 'package:flutter/material.dart'; -import 'package:cutdex_ui/theme.dart'; import '../../../shared/layout/workspace_layout_metrics.dart'; import '../../../shared/widgets/workspace_card.dart'; @@ -39,6 +38,13 @@ class ExpandedEditorLayout extends StatefulWidget { class _ExpandedEditorLayoutState extends State { static const gap = WorkspaceLayoutMetrics.desktopSpacing; + late bool _mediaVisited = widget.showMedia; + + @override + void didUpdateWidget(covariant ExpandedEditorLayout oldWidget) { + super.didUpdateWidget(oldWidget); + _mediaVisited |= widget.showMedia; + } Widget _card(String name, Widget child) => WorkspaceCard(key: Key('editor-$name-card'), child: child); @@ -50,8 +56,7 @@ class _ExpandedEditorLayoutState extends State { 0.0, constraints.maxHeight - gap - - AppControlSize.panelToolbar - - WorkspaceLayoutMetrics.timelineMinimumHeight, + WorkspaceLayoutMetrics.previewMinimumHeight, ); final minimum = math.min( WorkspaceLayoutMetrics.timelineMinimumHeight, @@ -63,9 +68,7 @@ class _ExpandedEditorLayoutState extends State { WorkspaceLayoutMetrics.timelineDefaultHeightFraction) .clamp(minimum, maximum) .toDouble(); - final mediaWidth = widget.showMedia - ? WorkspaceLayoutMetrics.mediaPanelWidth - : 0.0; + const mediaWidth = WorkspaceLayoutMetrics.mediaPanelWidth; final propertiesWidth = widget.showProperties ? WorkspaceLayoutMetrics.propertiesPanelWidth : 0.0; @@ -75,48 +78,49 @@ class _ExpandedEditorLayoutState extends State { Column( children: [ Expanded( - child: _card( - 'preview', - Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - child: Column( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (_mediaVisited) + Offstage( + offstage: !widget.showMedia, + child: ExcludeFocus( + excluding: !widget.showMedia, + child: TickerMode( + enabled: widget.showMedia, + child: SizedBox( + key: const Key('editor-media-region'), + width: mediaWidth, + child: _card('media', widget.media), + ), + ), + ), + ), + if (widget.showMedia) const SizedBox(width: gap), + Expanded( + child: _card( + 'preview', + Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ widget.header, - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - if (widget.showMedia) ...[ - SizedBox( - key: const Key('editor-media-region'), - width: mediaWidth, - child: widget.media, - ), - const VerticalDivider(width: 1), - ], - Expanded(child: widget.preview), - ], - ), - ), + Expanded(child: widget.preview), ], ), ), - if (widget.showProperties) ...[ - const VerticalDivider( - key: Key('editor-properties-divider'), - width: 1, - ), - SizedBox( - key: const Key('editor-properties-region'), - width: propertiesWidth, - child: widget.properties, - ), - ], + ), + if (widget.showProperties) ...[ + const SizedBox( + key: Key('editor-properties-divider'), + width: gap, + ), + SizedBox( + key: const Key('editor-properties-region'), + width: propertiesWidth, + child: _card('properties', widget.properties), + ), ], - ), + ], ), ), const SizedBox(height: gap), diff --git a/lib/features/editor/timeline_operation_region.dart b/lib/features/editor/timeline_operation_region.dart new file mode 100644 index 0000000..af9fd9b --- /dev/null +++ b/lib/features/editor/timeline_operation_region.dart @@ -0,0 +1,34 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../workspace/projects.dart'; + +/// Keeps the surface mounted while a timeline operation temporarily blocks edits. +class TimelineOperationRegion extends ConsumerWidget { + const TimelineOperationRegion({ + super.key, + required this.projectId, + required this.child, + this.loading = false, + }); + + final String projectId; + final bool loading; + final Widget child; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final creating = ref.watch( + projectsProvider.select( + (value) => + value.value?.activeProject?.id == projectId && + value.value?.creatingTimeline == true, + ), + ); + final blocked = loading || creating; + return IgnorePointer( + ignoring: blocked, + child: ExcludeFocus(excluding: blocked, child: child), + ); + } +} diff --git a/lib/features/media/audio_asset_tile.dart b/lib/features/media/audio_asset_tile.dart index 2b9ae7a..71d1a32 100644 --- a/lib/features/media/audio_asset_tile.dart +++ b/lib/features/media/audio_asset_tile.dart @@ -8,6 +8,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../integrations/runtime/media_presentations.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; class AudioAssetTile extends StatelessWidget { @@ -63,7 +64,7 @@ class _AudioWaveformCover extends ConsumerWidget { if (waveform == null) { return Center( child: Icon( - Icons.audio_file_outlined, + AppIcons.audioFile, size: AppIconSize.emptyState, color: theme.colorScheme.onSurfaceVariant, ), diff --git a/lib/features/media/background_removal_dialog.dart b/lib/features/media/background_removal_dialog.dart index 008edea..7371a4e 100644 --- a/lib/features/media/background_removal_dialog.dart +++ b/lib/features/media/background_removal_dialog.dart @@ -10,6 +10,7 @@ import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import '../../shared/widgets/confirm_resource_download_cancel.dart'; +import '../../shared/widgets/error_notification_host.dart'; import '../../shared/widgets/processing_resource_download_dialog.dart'; import '../../workspace/timeline_session.dart'; @@ -76,10 +77,10 @@ class _BackgroundRemovalDialogState _closing = true; WidgetsBinding.instance.addPostFrameCallback((_) { if (!mounted) return; - final messenger = ScaffoldMessenger.maybeOf(context); + final notifications = ErrorNotificationHost.maybeOf(context); final message = context.l10n.backgroundRemovalTaskStarted; Navigator.of(context).pop(); - messenger?.showSnackBar(SnackBar(content: Text(message))); + notifications?.showMessage(content: Text(message)); }); }); return ref diff --git a/lib/features/media/background_tasks_dialog.dart b/lib/features/media/background_tasks_dialog.dart index de19f1f..8fc2f87 100644 --- a/lib/features/media/background_tasks_dialog.dart +++ b/lib/features/media/background_tasks_dialog.dart @@ -1,3 +1,5 @@ +import '../../shared/widgets/presentation_list.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -44,12 +46,50 @@ class BackgroundTasksContent extends ConsumerWidget { final ProcessingResourceRepository? repository; @override Widget build(BuildContext context, WidgetRef ref) { - final snapshot = ref.watch( - backgroundTasksProvider(registry: registry, session: session), + final tasksProvider = backgroundTasksProvider( + registry: registry, + session: session, ); + ref.watch( + tasksProvider.select( + (snapshot) => ( + PresentationList( + snapshot.subtitles.map( + (entry) => (entry.owner.session, entry.job.id), + ), + ), + PresentationList( + snapshot.removals.map( + (entry) => (entry.owner.session, entry.task.id), + ), + ), + ), + ), + ); + final snapshot = ref.read(tasksProvider); + if (repository != null) { + ref.watch( + processingResourcesProvider(repository!).select( + (snapshot) => ( + snapshot.subtitleDownloading, + PresentationList( + snapshot.installs + .where( + (install) => + install.state == ProcessingResourceState.downloading || + install.state == ProcessingResourceState.failed, + ) + .map( + (install) => (install.package.capability, install.state), + ), + ), + ), + ), + ); + } final resources = repository == null ? null - : ref.watch(processingResourcesProvider(repository!)); + : ref.read(processingResourcesProvider(repository!)); final subtitleEntries = snapshot.subtitles; final removalEntries = snapshot.removals; final subtitleDownloading = resources?.subtitleDownloading == true; @@ -118,9 +158,11 @@ class BackgroundTasksContent extends ConsumerWidget { resourceDownloads.isNotEmpty || subtitleDownloading) const SizedBox(height: 2), - _BackgroundRemovalTaskCard( - key: ValueKey(entry.task.id), + _ObservedRemovalTask( + key: ValueKey((entry.owner.session, entry.task.id)), entry: entry, + registry: registry, + session: session, ), ], for (final (index, entry) @@ -130,9 +172,14 @@ class BackgroundTasksContent extends ConsumerWidget { removalEntries.isNotEmpty || subtitleDownloading) const SizedBox(height: 2), - _SubtitleTaskCard( - key: ValueKey(entry.job.recognition.id), + _ObservedSubtitleTask( + key: ValueKey(( + entry.owner.session, + entry.job.recognition.id, + )), entry: entry, + registry: registry, + session: session, ), ], ], @@ -144,6 +191,70 @@ class BackgroundTasksContent extends ConsumerWidget { } } +class _ObservedSubtitleTask extends ConsumerWidget { + const _ObservedSubtitleTask({ + super.key, + required this.entry, + this.registry, + this.session, + }); + final SubtitleTaskEntry entry; + final BackgroundTaskRegistry? registry; + final EditorTimelineSession? session; + @override + Widget build(BuildContext context, WidgetRef ref) { + final current = ref.watch( + backgroundTasksProvider(registry: registry, session: session).select( + (snapshot) => snapshot.subtitles + .where( + (item) => + identical(item.owner.session, entry.owner.session) && + item.job.id == entry.job.id, + ) + .firstOrNull, + ), + ); + return current == null + ? const SizedBox.shrink() + : _SubtitleTaskCard( + key: ValueKey((current.owner.session, current.job.id)), + entry: current, + ); + } +} + +class _ObservedRemovalTask extends ConsumerWidget { + const _ObservedRemovalTask({ + super.key, + required this.entry, + this.registry, + this.session, + }); + final RemovalTaskEntry entry; + final BackgroundTaskRegistry? registry; + final EditorTimelineSession? session; + @override + Widget build(BuildContext context, WidgetRef ref) { + final current = ref.watch( + backgroundTasksProvider(registry: registry, session: session).select( + (snapshot) => snapshot.removals + .where( + (item) => + identical(item.owner.session, entry.owner.session) && + item.task.id == entry.task.id, + ) + .firstOrNull, + ), + ); + return current == null + ? const SizedBox.shrink() + : _BackgroundRemovalTaskCard( + key: ValueKey((current.owner.session, current.task.id)), + entry: current, + ); + } +} + String _ownerName(BackgroundTaskSession owner) => owner.projectName.isEmpty ? owner.timelineName : '${owner.projectName} · ${owner.timelineName}'; @@ -387,7 +498,31 @@ class _ResourceDownloadCard extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final snapshot = ref.watch(processingResourcesProvider(repository)); + final snapshot = ref.watch( + processingResourcesProvider(repository).select((snapshot) { + final capability = this.install?.package.capability; + return snapshot.copyWith( + installs: snapshot.installs + .where((install) => install.package.capability == capability) + .toList(), + paused: capability == null + ? const {} + : snapshot.paused.where((item) => item == capability).toSet(), + rates: capability == null + ? const {} + : {capability: snapshot.rates[capability] ?? 0}, + subtitleDownloading: subtitleBundle && snapshot.subtitleDownloading, + subtitlePaused: subtitleBundle && snapshot.subtitlePaused, + subtitleDownloadedBytes: subtitleBundle + ? snapshot.subtitleDownloadedBytes + : 0, + subtitleTotalBytes: subtitleBundle ? snapshot.subtitleTotalBytes : 0, + subtitleBytesPerSecond: subtitleBundle + ? snapshot.subtitleBytesPerSecond + : 0, + ); + }), + ); final install = this.install == null ? null : snapshot.installs diff --git a/lib/features/media/desktop_media_asset_tile.dart b/lib/features/media/desktop_media_asset_tile.dart new file mode 100644 index 0000000..9236a2a --- /dev/null +++ b/lib/features/media/desktop_media_asset_tile.dart @@ -0,0 +1,280 @@ +import 'package:cutdex_sdk/project.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; + +import '../../l10n/l10n.dart'; +import '../../workspace/media_availability.dart'; +import 'audio_asset_tile.dart'; +import 'media_asset_strip.dart'; +import 'media_browser_layout.dart'; +import 'unavailable_media_placeholder.dart'; +import 'visual_asset_tile.dart'; + +/// Desktop cards and rows use the same cover, name and availability labels. +class DesktopMediaAssetTile extends StatelessWidget { + const DesktopMediaAssetTile({ + super.key, + required this.asset, + required this.grid, + required this.availability, + }); + final AssetDocument asset; + final bool grid; + final MediaAvailability? availability; + + static TextStyle? _nameStyle(BuildContext context) => + Theme.of(context).textTheme.bodyMedium + ?.copyWith(fontSize: 13, height: 20 / 13); + + static TextStyle? _metadataStyle(BuildContext context) => + Theme.of(context).textTheme.bodySmall + ?.copyWith(fontSize: 12, height: 16 / 12); + + /// Font fallback and fractional scaling can round a line above size × height. + static double gridLabelHeight(BuildContext context) { + double lineHeight(TextStyle? style) { + final painter = TextPainter( + text: TextSpan(text: '国Ag', style: style), + maxLines: 1, + textDirection: Directionality.of(context), + textScaler: MediaQuery.textScalerOf(context), + locale: Localizations.maybeLocaleOf(context), + textHeightBehavior: DefaultTextStyle.of(context).textHeightBehavior, + )..layout(); + final height = painter.height.ceilToDouble(); + painter.dispose(); + return height; + } + + return lineHeight(_nameStyle(context)) + + lineHeight(_metadataStyle(context)); + } + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final unavailable = + availability != null && availability != MediaAvailability.available; + final kind = switch (asset.metadata['kind']) { + 'video' => context.l10n.video, + 'image' => context.l10n.picture, + 'audio' => context.l10n.audio, + _ => context.l10n.materials, + }; + final width = asset.metadata['width']; + final height = asset.metadata['height']; + final dimensions = width is num && height is num && width > 0 && height > 0 + ? '${width.toInt()} × ${height.toInt()}' + : null; + final info = unavailable + ? availability == MediaAvailability.missing + ? context.l10n.mediaMissing + : context.l10n.mediaUnavailable + : dimensions == null + ? kind + : '$kind · $dimensions'; + final name = Tooltip( + message: asset.name, + child: Text( + asset.name, + key: ValueKey('media-name-${asset.id}'), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: _nameStyle(context), + ), + ); + Widget metadata({bool showDuration = false}) => Row( + children: [ + Flexible( + child: Text( + info, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: _metadataStyle(context)?.copyWith( + color: unavailable + ? theme.colorScheme.error + : theme.colorScheme.onSurfaceVariant, + ), + ), + ), + if (showDuration && !unavailable) ...[ + const SizedBox(width: 8), + Flexible(child: MediaAssetDuration(asset: asset, badge: false)), + ], + ], + ); + final cover = ClipRRect( + key: ValueKey('desktop-media-cover-${asset.id}'), + borderRadius: BorderRadius.circular(4), + child: Stack( + children: [ + if (unavailable) + AspectRatio( + aspectRatio: 16 / 9, + child: UnavailableMediaPlaceholder( + availability: availability!, + showLabel: false, + ), + ) + else + switch (asset.metadata['kind']) { + 'video' || + 'image' => VisualAssetTile(asset: asset, showName: false), + 'audio' => AudioAssetTile(asset: asset, showName: false), + _ => AspectRatio( + aspectRatio: 16 / 9, + child: ColoredBox( + color: AppSurfaces.of(context).previewBackground, + child: const Center(child: Icon(AppIcons.file, size: 20)), + ), + ), + }, + if (grid && !unavailable) + Positioned( + bottom: 4, + left: 4, + right: 4, + child: Align( + alignment: AlignmentDirectional.centerEnd, + child: MediaAssetDuration(asset: asset), + ), + ), + ], + ), + ); + if (!grid) { + return LayoutBuilder( + builder: (context, constraints) { + final columns = DesktopMediaListColumns(constraints.maxWidth); + return Row( + children: [ + SizedBox( + width: DesktopMediaMetrics.listCover, + height: DesktopMediaMetrics.listCover * 9 / 16, + child: cover, + ), + const SizedBox(width: DesktopMediaMetrics.gap), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + name, + if (!columns.specification) + metadata(showDuration: !columns.duration), + ], + ), + ), + if (columns.duration) + SizedBox( + width: DesktopMediaListColumns.durationWidth, + child: Align( + alignment: AlignmentDirectional.centerEnd, + child: unavailable + ? const SizedBox.shrink() + : MediaAssetDuration(asset: asset, badge: false), + ), + ), + if (columns.specification) ...[ + const SizedBox(width: DesktopMediaMetrics.gap), + SizedBox( + width: DesktopMediaListColumns.specificationWidth, + child: Text( + unavailable ? info : dimensions ?? '—', + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: _metadataStyle(context)?.copyWith( + color: unavailable + ? theme.colorScheme.error + : theme.colorScheme.onSurfaceVariant, + ), + ), + ), + ], + if (columns.kind) ...[ + const SizedBox(width: DesktopMediaMetrics.gap), + SizedBox( + width: DesktopMediaListColumns.kindWidth, + child: Text( + kind, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: _metadataStyle(context), + ), + ), + ], + ], + ); + }, + ); + } + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [cover, const SizedBox(height: 4), name, metadata()], + ); + } +} + +/// List labels follow the same column widths and breakpoints as asset rows. +class DesktopMediaListHeader extends StatelessWidget { + const DesktopMediaListHeader({super.key}); + + @override + Widget build(BuildContext context) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: DesktopMediaMetrics.padding + DesktopMediaMetrics.tilePadding, + ), + child: LayoutBuilder( + builder: (context, constraints) { + final columns = DesktopMediaListColumns(constraints.maxWidth); + Widget label(String text, {bool end = false}) => Text( + text, + maxLines: 1, + overflow: TextOverflow.ellipsis, + textAlign: end ? TextAlign.end : TextAlign.start, + style: DesktopMediaAssetTile._metadataStyle(context) + ?.copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant), + ); + return SizedBox( + height: (MediaQuery.textScalerOf(context).scale(16) + 8).clamp( + DesktopMediaMetrics.listHeader, + double.infinity, + ), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.only( + start: + DesktopMediaMetrics.listCover + DesktopMediaMetrics.gap, + ), + child: label(context.l10n.name), + ), + ), + if (columns.duration) + SizedBox( + width: DesktopMediaListColumns.durationWidth, + child: label(context.l10n.duration, end: true), + ), + if (columns.specification) ...[ + const SizedBox(width: DesktopMediaMetrics.gap), + SizedBox( + width: DesktopMediaListColumns.specificationWidth, + child: label(context.l10n.mediaSpecification), + ), + ], + if (columns.kind) ...[ + const SizedBox(width: DesktopMediaMetrics.gap), + SizedBox( + width: DesktopMediaListColumns.kindWidth, + child: label(context.l10n.mediaCategory), + ), + ], + ], + ), + ); + }, + ), + ); +} diff --git a/lib/features/media/media_asset_strip.dart b/lib/features/media/media_asset_strip.dart index d349568..88da1e9 100644 --- a/lib/features/media/media_asset_strip.dart +++ b/lib/features/media/media_asset_strip.dart @@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../integrations/runtime/media_presentations.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'audio_asset_tile.dart'; @@ -64,9 +65,9 @@ class _VisualAssetStrip extends ConsumerWidget { timeMilliseconds: video && duration != null ? (duration * 1000 * index / count).floor() : 0, - fallback: const Center(child: Icon(Icons.movie_outlined)), + fallback: const Center(child: Icon(AppIcons.video)), errorFallback: const Center( - child: Icon(Icons.broken_image_outlined), + child: Icon(AppIcons.imageUnavailable), ), ), ), @@ -77,8 +78,9 @@ class _VisualAssetStrip extends ConsumerWidget { } class MediaAssetDuration extends ConsumerWidget { - const MediaAssetDuration({super.key, required this.asset}); + const MediaAssetDuration({super.key, required this.asset, this.badge = true}); final AssetDocument asset; + final bool badge; @override Widget build(BuildContext context, WidgetRef ref) { @@ -94,6 +96,20 @@ class MediaAssetDuration extends ConsumerWidget { '${hours > 0 ? '$hours:' : ''}' '${minutes.toString().padLeft(2, '0')}:' '${(seconds % 60).toString().padLeft(2, '0')}'; + if (!badge) { + return Text( + text, + key: ValueKey('media-duration-${asset.id}'), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodySmall?.copyWith( + fontSize: 12, + height: 16 / 12, + color: Theme.of(context).colorScheme.onSurfaceVariant, + fontFeatures: const [FontFeature.tabularFigures()], + ), + ); + } return DecoratedBox( decoration: BoxDecoration( color: Colors.black.withValues(alpha: .55), @@ -104,6 +120,8 @@ class MediaAssetDuration extends ConsumerWidget { child: Text( text, key: ValueKey('media-duration-${asset.id}'), + maxLines: 1, + overflow: TextOverflow.ellipsis, style: Theme.of(context).textTheme.bodySmall?.copyWith( color: Colors.white, fontFeatures: const [FontFeature.tabularFigures()], diff --git a/lib/features/media/media_browser_body.dart b/lib/features/media/media_browser_body.dart index 6373ccd..8c1713c 100644 --- a/lib/features/media/media_browser_body.dart +++ b/lib/features/media/media_browser_body.dart @@ -1,3 +1,5 @@ +import '../../shared/widgets/listenable_selector.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import 'package:cutdex/errors/app_failure.dart'; @@ -11,19 +13,24 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../integrations/platform/platform_capabilities.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import '../../workspace/external_media_import.dart'; import '../../workspace/media_availability.dart'; +import '../../workspace/project_state.dart'; import '../../workspace/projects.dart'; import '../../workspace/timeline_provider.dart'; +import '../../workspace/timeline_session.dart'; import 'audio_asset_tile.dart'; import 'media_asset_drag.dart'; import 'media_asset_strip.dart'; import 'media_browser_controller.dart'; import 'unavailable_media_placeholder.dart'; import 'visual_asset_tile.dart'; +import 'desktop_media_asset_tile.dart'; +import 'media_browser_layout.dart'; extension MediaFilterLabel on MediaFilter { String label(BuildContext context) => switch (this) { @@ -44,26 +51,37 @@ class MediaBrowserBody extends ConsumerStatefulWidget { required this.grid, this.draggable = false, this.compact = false, + this.desktop = false, }); final String projectId; final bool grid; final bool draggable; final bool compact; + final bool desktop; @override ConsumerState createState() => _MediaBrowserBodyState(); } class _MediaBrowserBodyState extends ConsumerState with WidgetsBindingObserver { + final _desktopScroll = _MediaScrollController(); + MediaBrowserController? _anchorOwner; + List _anchorAssets = const []; + int _anchorColumns = 1; + double _anchorStride = 1; + Object? _viewportConfiguration; + @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); + _desktopScroll.addListener(_storeBrowseAnchor); } @override void dispose() { WidgetsBinding.instance.removeObserver(this); + _desktopScroll.dispose(); super.dispose(); } @@ -83,6 +101,67 @@ class _MediaBrowserBodyState extends ConsumerState bool get _isGrid => widget.grid; bool get _desktop => ref.read(platformCapabilitiesProvider).nativeFileDrop; + void _storeBrowseAnchor() { + if (_anchorOwner == null || + _anchorAssets.isEmpty || + !_desktopScroll.hasClients) { + return; + } + final rowPosition = math.max( + 0.0, + (_desktopScroll.position.pixels - DesktopMediaMetrics.padding) / + _anchorStride, + ); + final row = rowPosition.floor(); + final index = math.min(_anchorAssets.length - 1, row * _anchorColumns); + _anchorOwner!.viewportAnchor = ( + assetId: _anchorAssets[index].id, + fraction: rowPosition - row, + ); + } + + void _prepareDesktopScroll({ + required List assets, + required Object configuration, + required int columns, + required double extent, + required double height, + }) { + if (_viewportConfiguration == configuration) return; + _viewportConfiguration = configuration; + final owner = _browser; + final anchor = owner.viewportAnchor; + final index = anchor == null + ? -1 + : assets.indexWhere((asset) => asset.id == anchor.assetId); + final stride = extent + DesktopMediaMetrics.gap; + final row = index < 0 ? 0 : index ~/ columns; + final fraction = index < 0 ? 0.0 : anchor!.fraction; + final rows = (assets.length / columns).ceil(); + final maximum = math.max( + 0.0, + DesktopMediaMetrics.padding * 2 + + rows * stride - + (_isGrid && rows > 0 ? DesktopMediaMetrics.gap : 0) - + height, + ); + final offset = + (row == 0 && fraction == 0 + ? 0.0 + : DesktopMediaMetrics.padding + (row + fraction) * stride) + .clamp(0.0, maximum); + _anchorOwner = owner; + _anchorAssets = assets; + _anchorColumns = columns; + _anchorStride = stride; + _desktopScroll.initialOffset = offset; + // Layout consumes the corrected pixels before painting. No change + // notification or post-frame jump is needed to preserve the browse anchor. + for (final position in _desktopScroll.positions) { + if (position.pixels != offset) position.correctPixels(offset); + } + } + Future _action(Future Function() action) async { final ok = await action(); if (!mounted || ok) return; @@ -116,12 +195,19 @@ class _MediaBrowserBodyState extends ConsumerState ], child: AppField( label: context.l10n.name, - child: TextField( - controller: controller, - autofocus: true, - onSubmitted: (value) { - if (value.trim().isNotEmpty) Navigator.pop(context, value.trim()); - }, + child: Builder( + builder: (fieldContext) => TextField( + controller: controller, + autofocus: true, + style: AppTheme.inputTextStyle(fieldContext), + cursorHeight: AppTheme.inputCursorHeight(fieldContext), + textAlignVertical: TextAlignVertical.center, + onSubmitted: (value) { + if (value.trim().isNotEmpty) { + Navigator.pop(context, value.trim()); + } + }, + ), ), ), ), @@ -159,12 +245,14 @@ class _MediaBrowserBodyState extends ConsumerState } @override - Widget build(BuildContext context) => ListenableBuilder( - listenable: ref.watch(mediaBrowserProvider(widget.projectId)), - builder: (context, _) => _buildBrowser(context), - ); - Widget _buildBrowser(BuildContext context) { - ref.watch(externalMediaImportProvider(widget.projectId)); + Widget build(BuildContext context) { + final browser = ref.watch(mediaBrowserProvider(widget.projectId)); + // Provider subscriptions belong to this Consumer's build lifecycle. Local + // selector rebuilds must not register watches on this outer ref. + ref.watch( + externalMediaImportProvider(widget.projectId) + .select((value) => value.isLoading), + ); ref.watch( projectsProvider.select( (value) => ( @@ -177,12 +265,6 @@ class _MediaBrowserBodyState extends ConsumerState ); final workspace = ref.read(projectsProvider).value; final active = workspace?.activeProject?.id == widget.projectId; - final allAssets = active ? workspace!.assets : []; - final assets = _filter == MediaFilter.all - ? allAssets - : allAssets - .where((asset) => asset.metadata['kind'] == _filter.kind) - .toList(); final timelineId = active ? workspace?.timeline?.id : null; final timeline = timelineId == null ? null @@ -190,12 +272,40 @@ class _MediaBrowserBodyState extends ConsumerState .watch(editorTimelineProvider(widget.projectId, timelineId)) .asData ?.value; - return assets.isEmpty + return ListenableSelector( + listenable: browser, + select: () => ( + browser.filter, + widget.desktop ? browser.query : '', + widget.desktop ? browser.sort : MediaSort.importOrder, + widget.desktop ? browser.gridSize : MediaGridSize.medium, + ), + builder: (context, _) => _buildBrowser(context, workspace, timeline), + ); + } + + Widget _buildBrowser( + BuildContext context, + ProjectState? workspace, + EditorTimelineSession? timeline, + ) { + final active = workspace?.activeProject?.id == widget.projectId; + final timelineId = active ? workspace?.timeline?.id : null; + final allAssets = active ? workspace!.assets : []; + final assets = _browser.visibleAssets(allAssets, desktop: widget.desktop); + if (widget.desktop && assets.isEmpty) { + _viewportConfiguration = null; + _anchorOwner = null; + _anchorAssets = const []; + } + final content = assets.isEmpty ? Center( child: Padding( padding: const EdgeInsets.all(AppSpacing.medium), child: Text( - _filter != MediaFilter.all + widget.desktop && _browser.query.trim().isNotEmpty + ? context.l10n.noMatchingMedia + : _filter != MediaFilter.all ? context.l10n.noMediaOfType(_filter.label(context)) : _desktop ? context.l10n.dragMediaHint @@ -206,16 +316,25 @@ class _MediaBrowserBodyState extends ConsumerState ) : LayoutBuilder( builder: (context, constraints) { - final spacing = widget.compact + final spacing = widget.desktop + ? DesktopMediaMetrics.gap + : widget.compact ? AppSpacing.gap : AppSpacing.small; - final padding = widget.compact + final padding = widget.desktop + ? DesktopMediaMetrics.padding + : widget.compact ? AppSidebarMetrics.outerPadding : AppSpacing.compact; final width = math.max(1.0, constraints.maxWidth - padding * 2); final columns = math.max( 1, - widget.compact + widget.desktop + ? DesktopMediaMetrics.columns( + width, + _browser.gridSize.targetWidth, + ) + : widget.compact ? ((width + spacing) / (maximumCompactMediaGridTileWidth + spacing)) .ceil() @@ -228,6 +347,41 @@ class _MediaBrowserBodyState extends ConsumerState final labelHeight = MediaQuery.textScalerOf(context).scale(textStyle.fontSize!) * (textStyle.height ?? 1.2); + final desktopLabelHeight = widget.desktop && _isGrid + ? DesktopMediaAssetTile.gridLabelHeight(context) + : 0.0; + final desktopExtent = !widget.desktop + ? 0.0 + : _isGrid + ? DesktopMediaMetrics.gridExtent( + tileWidth, + desktopLabelHeight, + ) + : math.max( + DesktopMediaMetrics.listRow, + DesktopMediaAssetTile.gridLabelHeight(context) + + DesktopMediaMetrics.tilePadding * 2, + ); + if (widget.desktop) { + _prepareDesktopScroll( + assets: assets, + configuration: ( + widget.projectId, + _browser, + _isGrid, + columns, + desktopExtent, + constraints.maxHeight, + _filter, + _browser.query, + _browser.sort, + allAssets, + ), + columns: _isGrid ? columns : 1, + extent: desktopExtent, + height: constraints.maxHeight, + ); + } Widget item(BuildContext context, int index) { final asset = assets[index]; return Consumer( @@ -241,76 +395,85 @@ class _MediaBrowserBodyState extends ConsumerState final unavailable = availability != null && availability != MediaAvailability.available; - return AppContextMenu( - key: ValueKey(('media-menu', asset.id)), - itemsBuilder: (_) { - final available = ref - .read(projectsProvider) - .asData - ?.value; - final canEdit = - available?.activeProject?.id == widget.projectId && - available?.projectBusy == false && - !_checkingDrop; - final sequence = timeline?.activeSequenceId; - return [ - AppMenuItem( - label: context.l10n.addToTimeline, - icon: Icons.add, - onPressed: - canEdit && - !unavailable && - sequence != null && - available?.timeline?.id == timelineId - ? () => - _action(() => _browser.insertAsset(asset)) - : null, - ), - AppMenuItem( - label: context.l10n.rename, - icon: Icons.drive_file_rename_outline, - onPressed: canEdit ? () => _rename(asset) : null, - ), - AppMenuItem( - label: defaultTargetPlatform == TargetPlatform.macOS - ? context.l10n.revealFinder - : context.l10n.revealFileManager, - icon: Icons.folder_open, - onPressed: canEdit && _desktop - ? () => _action(() => _browser.reveal(asset)) - : null, - ), - const AppMenuSeparator(), - AppMenuItem( - label: context.l10n.removeMedia, - icon: Icons.delete_outline, - destructive: true, - onPressed: canEdit ? () => _remove(asset) : null, - ), - ]; - }, - child: Listener( - onPointerDown: (event) { - if (event.buttons == 2) { - setState(() => _selectedAssetId = asset.id); - } + return ListenableSelector<(bool, bool)>( + listenable: _browser, + select: () => + (_selectedAssetId == asset.id, _checkingDrop), + builder: (context, presentation) => AppContextMenu( + key: ValueKey(('media-menu', asset.id)), + itemsBuilder: (_) { + final available = ref + .read(projectsProvider) + .asData + ?.value; + final canEdit = + available?.activeProject?.id == + widget.projectId && + available?.projectBusy == false && + !_checkingDrop; + final sequence = timeline?.activeSequenceId; + return [ + AppMenuItem( + label: context.l10n.addToTimeline, + icon: AppIcons.add, + onPressed: + canEdit && + !unavailable && + sequence != null && + available?.timeline?.id == timelineId + ? () => _action( + () => _browser.insertAsset(asset), + ) + : null, + ), + AppMenuItem( + label: context.l10n.rename, + icon: AppIcons.rename, + onPressed: canEdit ? () => _rename(asset) : null, + ), + AppMenuItem( + label: + defaultTargetPlatform == TargetPlatform.macOS + ? context.l10n.revealFinder + : context.l10n.revealFileManager, + icon: AppIcons.folderOpen, + onPressed: canEdit && _desktop + ? () => _action(() => _browser.reveal(asset)) + : null, + ), + const AppMenuSeparator(), + AppMenuItem( + label: context.l10n.removeMedia, + icon: AppIcons.delete, + destructive: true, + onPressed: canEdit ? () => _remove(asset) : null, + ), + ]; }, - child: _SelectableAsset( - key: ValueKey(asset.id), - grid: _isGrid, - drag: MediaAssetDrag( - projectId: widget.projectId, - assetId: asset.id, + child: Listener( + onPointerDown: (event) { + if (event.buttons == 2) { + _selectedAssetId = asset.id; + } + }, + child: _SelectableAsset( + key: ValueKey(asset.id), + grid: _isGrid, + desktop: widget.desktop, + drag: MediaAssetDrag( + projectId: widget.projectId, + assetId: asset.id, + ), + name: asset.name, + draggable: + widget.draggable && + !workspace!.projectBusy && + !presentation.$2 && + !unavailable, + selected: presentation.$1, + onTap: () => _browser.selectAsset(asset), + child: _assetTile(asset, availability), ), - name: asset.name, - draggable: - widget.draggable && - !workspace!.projectBusy && - !_checkingDrop && - !unavailable, - selected: _selectedAssetId == asset.id, - onTap: () => _browser.selectAsset(asset), - child: _assetTile(asset, availability), ), ), ); @@ -318,44 +481,122 @@ class _MediaBrowserBodyState extends ConsumerState ); } + Widget scrollView(ScrollController controller) => !_isGrid + ? widget.desktop + ? ListView.builder( + key: PageStorageKey(( + 'media-list', + widget.projectId, + )), + controller: controller, + padding: EdgeInsets.all(padding), + itemCount: assets.length, + itemExtent: desktopExtent + spacing, + itemBuilder: (context, index) => Padding( + padding: EdgeInsets.only(bottom: spacing), + child: item(context, index), + ), + ) + : ListView.separated( + key: PageStorageKey(( + 'media-list', + widget.projectId, + )), + controller: controller, + padding: EdgeInsets.all(padding), + itemCount: assets.length, + itemBuilder: item, + separatorBuilder: (_, _) => + SizedBox(height: spacing), + ) + : GridView.builder( + key: PageStorageKey(('media-grid', widget.projectId)), + controller: controller, + padding: EdgeInsets.all(padding), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: columns, + crossAxisSpacing: spacing, + mainAxisSpacing: widget.desktop || widget.compact + ? spacing + : AppSpacing.compact, + mainAxisExtent: widget.desktop + ? desktopExtent + : tileWidth * 9 / 16 + + (widget.compact + ? AppSpacing.gap + : AppSpacing.small) + + labelHeight + + 2, + ), + itemCount: assets.length, + itemBuilder: item, + ); + if (widget.desktop) { + return ScrollEdgeFade( + controller: _desktopScroll, + child: scrollView(_desktopScroll), + ); + } return ScrollEdgeFadeBuilder( key: ValueKey(('media-scroll-fade', widget.projectId, _isGrid)), - builder: (controller) => !_isGrid - ? ListView.separated( - key: PageStorageKey(('media-list', widget.projectId)), - controller: controller, - padding: EdgeInsets.all(padding), - itemCount: assets.length, - itemBuilder: item, - separatorBuilder: (_, _) => SizedBox(height: spacing), - ) - : GridView.builder( - key: PageStorageKey(('media-grid', widget.projectId)), - controller: controller, - padding: EdgeInsets.all(padding), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: columns, - crossAxisSpacing: spacing, - mainAxisSpacing: widget.compact - ? spacing - : AppSpacing.compact, - mainAxisExtent: - tileWidth * 9 / 16 + - (widget.compact - ? AppSpacing.gap - : AppSpacing.small) + - labelHeight + - 2, - ), - itemCount: assets.length, - itemBuilder: item, - ), + builder: scrollView, ); }, ); + if (!widget.desktop) return content; + return Column( + children: [ + if (!_isGrid) + const DesktopMediaListHeader(key: Key('media-list-header')), + Expanded(child: content), + const Divider(height: 1), + SizedBox( + key: const Key('media-browser-footer'), + height: 28, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12), + child: ListenableSelector( + listenable: _browser, + select: () => assets.any((asset) => asset.id == _selectedAssetId), + builder: (context, selected) => Row( + children: [ + Expanded( + child: Text( + context.l10n.mediaCount(assets.length), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodySmall, + ), + ), + if (selected) + Flexible( + child: Align( + alignment: AlignmentDirectional.centerEnd, + child: Text( + context.l10n.mediaSelectedCount(1), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodySmall, + ), + ), + ), + ], + ), + ), + ), + ), + ], + ); } Widget _assetTile(AssetDocument asset, MediaAvailability? availability) { + if (widget.desktop) { + return DesktopMediaAssetTile( + asset: asset, + grid: _isGrid, + availability: availability, + ); + } final unavailable = availability != null && availability != MediaAvailability.available; final cover = unavailable @@ -388,7 +629,7 @@ class _MediaBrowserBodyState extends ConsumerState aspectRatio: 16 / 9, child: ColoredBox( color: AppSurfaces.of(context).previewBackground, - child: const Icon(Icons.insert_drive_file_outlined), + child: const Icon(AppIcons.file), ), ), }; @@ -429,10 +670,28 @@ class _MediaBrowserBodyState extends ConsumerState } } +class _MediaScrollController extends ScrollController { + _MediaScrollController() : super(keepScrollOffset: false); + double initialOffset = 0; + + @override + ScrollPosition createScrollPosition( + ScrollPhysics physics, + ScrollContext context, + ScrollPosition? oldPosition, + ) => ScrollPositionWithSingleContext( + physics: physics, + context: context, + initialPixels: initialOffset, + keepScrollOffset: false, + ); +} + class _SelectableAsset extends StatelessWidget { const _SelectableAsset({ super.key, required this.grid, + this.desktop = false, required this.selected, required this.drag, required this.name, @@ -443,6 +702,7 @@ class _SelectableAsset extends StatelessWidget { final bool selected; final bool grid; + final bool desktop; final MediaAssetDrag drag; final String name; final bool draggable; @@ -457,39 +717,68 @@ class _SelectableAsset extends StatelessWidget { ); final tile = Semantics( selected: selected, - child: InkWell( - onTap: onTap, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - splashFactory: NoSplash.splashFactory, - child: Stack( - children: [ - child, - if (selected && !grid) - Positioned( - top: 0, - left: 0, - right: 0, - height: MediaAssetStrip.height, - child: IgnorePointer( - child: DecoratedBox(decoration: selectionDecoration), + child: desktop + ? Material( + color: selected + ? Theme.of(context).colorScheme.primary.withValues(alpha: .08) + : Colors.transparent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + side: BorderSide( + color: selected + ? Theme.of(context).colorScheme.primary + : Colors.transparent, ), ), - if (selected && grid) - Positioned( - top: 0, - left: 0, - right: 0, - child: IgnorePointer( - child: AspectRatio( - aspectRatio: 16 / 9, - child: DecoratedBox(decoration: selectionDecoration), - ), + clipBehavior: Clip.antiAlias, + child: InkWell( + onTap: onTap, + hoverColor: Theme.of(context).colorScheme.onSurface + .withValues(alpha: .05), + child: Padding( + padding: const EdgeInsets.all(5), + child: grid + ? child + : ConstrainedBox( + constraints: const BoxConstraints(minHeight: 38), + child: child, + ), ), ), - ], - ), - ), + ) + : InkWell( + onTap: onTap, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + splashFactory: NoSplash.splashFactory, + child: Stack( + children: [ + child, + if (selected && !grid) + Positioned( + top: 0, + left: 0, + right: 0, + height: MediaAssetStrip.height, + child: IgnorePointer( + child: DecoratedBox(decoration: selectionDecoration), + ), + ), + if (selected && grid) + Positioned( + top: 0, + left: 0, + right: 0, + child: IgnorePointer( + child: AspectRatio( + aspectRatio: 16 / 9, + child: DecoratedBox(decoration: selectionDecoration), + ), + ), + ), + ], + ), + ), ); return Draggable( data: drag, diff --git a/lib/features/media/media_browser_controller.dart b/lib/features/media/media_browser_controller.dart index 3086561..09031fe 100644 --- a/lib/features/media/media_browser_controller.dart +++ b/lib/features/media/media_browser_controller.dart @@ -14,6 +14,8 @@ import '../../workspace/timeline_provider.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'resource_section.dart'; + enum MediaFilter { all(null), image('image'), @@ -24,6 +26,18 @@ enum MediaFilter { final String? kind; } +enum MediaSort { importOrder, nameAscending, nameDescending } + +/// Desktop thumbnail density, independent of touch-page presentation. +enum MediaGridSize { + small(120), + medium(160), + large(200); + + const MediaGridSize(this.targetWidth); + final double targetWidth; +} + final mediaBrowserProvider = Provider.family(( ref, projectId, @@ -41,8 +55,9 @@ class MediaBrowserController extends ChangeNotifier { final feedback = MediaImportFeedbackController(); bool _working = false; bool _disposed = false; - bool get busy => - _working || _ref.read(externalMediaImportProvider(projectId)).isLoading; + bool get importing => + _ref.read(externalMediaImportProvider(projectId)).isLoading; + bool get busy => _working || importing; bool get active => !_disposed && _ref.mounted && @@ -81,7 +96,11 @@ class MediaBrowserController extends ChangeNotifier { .importFiles(files); final asset = result?.selected.firstOrNull; if (!_disposed && asset != null) { + _resourceSection = ResourceSection.imported; _selectedAssetId = asset.id; + if (!asset.name.toLowerCase().contains(_query.trim().toLowerCase())) { + _query = ''; + } if (_filter != MediaFilter.all && asset.metadata['kind'] != _filter.kind) { _filter = MediaFilter.all; @@ -172,23 +191,87 @@ class MediaBrowserController extends ChangeNotifier { String? _selectedAssetId; MediaFilter _filter = MediaFilter.all; bool _grid = true; + String _query = ''; + MediaSort _sort = MediaSort.importOrder; + MediaGridSize _gridSize = MediaGridSize.medium; + ResourceSection _resourceSection = ResourceSection.imported; + + /// The first visible desktop asset and its fraction through the current row. + /// Scroll updates are silent; browsing does not rebuild controls or metadata. + ({String assetId, double fraction})? viewportAnchor; String? get selectedAssetId => _selectedAssetId; MediaFilter get filter => _filter; bool get grid => _grid; + String get query => _query; + MediaSort get sort => _sort; + MediaGridSize get gridSize => _gridSize; + ResourceSection get resourceSection => _resourceSection; + + /// Resource libraries are desktop navigation, separate from media filters. + set resourceSection(ResourceSection value) { + if (_resourceSection == value) return; + _resourceSection = value; + notifyListeners(); + } + + /// Touch pages keep their own presentation while sharing category selection. + List visibleAssets( + Iterable assets, { + bool desktop = false, + }) { + final query = desktop ? _query.trim().toLowerCase() : ''; + final result = assets + .where( + (asset) => + (_filter == MediaFilter.all || + asset.metadata['kind'] == _filter.kind) && + asset.name.toLowerCase().contains(query), + ) + .toList(); + if (desktop && _sort != MediaSort.importOrder) { + result.sort((a, b) { + var order = a.name.toLowerCase().compareTo(b.name.toLowerCase()); + if (order == 0) order = a.id.compareTo(b.id); + return _sort == MediaSort.nameDescending ? -order : order; + }); + } + return result; + } + + set query(String value) { + if (_query == value) return; + _query = value; + notifyListeners(); + } + + set sort(MediaSort value) { + if (_sort == value) return; + _sort = value; + notifyListeners(); + } set selectedAssetId(String? value) { + if (_selectedAssetId == value) return; _selectedAssetId = value; notifyListeners(); } set filter(MediaFilter value) { + if (_filter == value) return; _filter = value; notifyListeners(); } set grid(bool value) { + if (_grid == value) return; _grid = value; notifyListeners(); } + + set gridSize(MediaGridSize value) { + if (_gridSize == value) return; + _gridSize = value; + notifyListeners(); + } } diff --git a/lib/features/media/media_browser_layout.dart b/lib/features/media/media_browser_layout.dart new file mode 100644 index 0000000..9fde431 --- /dev/null +++ b/lib/features/media/media_browser_layout.dart @@ -0,0 +1,33 @@ +import 'dart:math' as math; + +/// Shared desktop geometry for cards, rows, headers and browse anchoring. +abstract final class DesktopMediaMetrics { + static const padding = 12.0; + static const gap = 8.0; + static const tilePadding = 5.0; + static const listCover = 56.0; + static const listRow = 48.0; + static const listHeader = 28.0; + + static int columns(double width, double targetWidth) => + math.max(1, ((width + gap) / (targetWidth + gap)).floor()); + + static double gridExtent(double tileWidth, double labelHeight) => + (tileWidth - tilePadding * 2) * 9 / 16 + + 4 + + labelHeight + + tilePadding * 2; +} + +/// Matching list-column visibility for a header and its asset rows. +final class DesktopMediaListColumns { + const DesktopMediaListColumns(double width) + : duration = width >= 240, + specification = width >= 480, + kind = width >= 620; + + final bool duration, specification, kind; + static const durationWidth = 64.0; + static const specificationWidth = 136.0; + static const kindWidth = 56.0; +} diff --git a/lib/features/media/media_browser_page.dart b/lib/features/media/media_browser_page.dart index 3563098..9a5f15e 100644 --- a/lib/features/media/media_browser_page.dart +++ b/lib/features/media/media_browser_page.dart @@ -1,4 +1,5 @@ import 'package:cutdex/shared/widgets/error_notification_host.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -39,8 +40,19 @@ class TouchMediaBrowser extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final browser = ref.watch(mediaBrowserProvider(projectId)); - ref.watch(externalMediaImportProvider(projectId)); - final workspace = ref.watch(projectsProvider).value; + ref.watch( + externalMediaImportProvider(projectId).select((value) => value.isLoading), + ); + final workspace = ref.watch( + projectsProvider.select( + (value) => value.value?.copyWith( + recent: const [], + timelines: const [], + error: null, + creatingTimeline: false, + ), + ), + ); final timelineId = workspace?.activeProject?.id == projectId ? workspace?.timeline?.id : null; @@ -72,20 +84,20 @@ class TouchMediaBrowser extends ConsumerWidget { height: 56, child: Row( children: [ - SizedBox.square( - dimension: 48, - child: IconButton( + SizedBox( + height: 48, + child: TextButton( key: const Key('media-import-button'), - tooltip: context.l10n.importMedia, onPressed: browser.canImport ? () => pickMediaFiles(browser) : null, - icon: const Icon(Icons.add), + child: Text(context.l10n.importMedia), ), ), Expanded( child: DropdownButton( key: const Key('media-category-picker'), + icon: const Icon(AppIcons.expandMore), isExpanded: true, underline: const SizedBox.shrink(), value: browser.filter, @@ -110,8 +122,8 @@ class TouchMediaBrowser extends ConsumerWidget { : context.l10n.gridLayout, icon: Icon( browser.grid - ? Icons.view_list_outlined - : Icons.grid_view_outlined, + ? AppIcons.listView + : AppIcons.gridView, ), onPressed: () => browser.grid = !browser.grid, ), @@ -119,7 +131,7 @@ class TouchMediaBrowser extends ConsumerWidget { ], ), ), - if (browser.busy) const LinearProgressIndicator(), + if (browser.importing) const LinearProgressIndicator(), Expanded( key: const Key('media-panel-body'), child: MediaBrowserBody( @@ -150,7 +162,7 @@ class TouchMediaBrowser extends ConsumerWidget { ); } }, - icon: const Icon(Icons.add), + icon: const Icon(AppIcons.add), label: Text( context.l10n.addToTimeline, maxLines: 1, diff --git a/lib/features/media/media_browser_toolbar.dart b/lib/features/media/media_browser_toolbar.dart index 91ae915..ea55d61 100644 --- a/lib/features/media/media_browser_toolbar.dart +++ b/lib/features/media/media_browser_toolbar.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -6,6 +7,7 @@ import '../../l10n/l10n.dart'; import '../../workspace/project_state.dart'; import 'media_browser_body.dart'; import 'media_browser_controller.dart'; +import 'resource_navigation.dart'; class MediaBrowserToolbar extends StatefulWidget { const MediaBrowserToolbar({ @@ -19,6 +21,16 @@ class MediaBrowserToolbar extends StatefulWidget { this.projects = const [], this.selectedProjectId, this.onProjectSelected, + this.desktop = false, + this.query = '', + this.onQueryChanged, + this.sort = MediaSort.importOrder, + this.onSortChanged, + this.projectScoped = false, + this.resourceSection = ResourceSection.imported, + this.onResourceSectionChanged, + this.gridSize = MediaGridSize.medium, + this.onGridSizeChanged, }); final bool canImport; @@ -30,6 +42,16 @@ class MediaBrowserToolbar extends StatefulWidget { final List projects; final String? selectedProjectId; final ValueChanged? onProjectSelected; + final bool desktop; + final bool projectScoped; + final ResourceSection resourceSection; + final ValueChanged? onResourceSectionChanged; + final String query; + final ValueChanged? onQueryChanged; + final MediaSort sort; + final ValueChanged? onSortChanged; + final MediaGridSize gridSize; + final ValueChanged? onGridSizeChanged; @override State createState() => _MediaBrowserToolbarState(); @@ -38,6 +60,25 @@ class MediaBrowserToolbar extends StatefulWidget { class _MediaBrowserToolbarState extends State { Object? _filterConfiguration; Widget? _filterControls; + final _search = TextEditingController(); + + @override + void initState() { + super.initState(); + _search.text = widget.query; + } + + @override + void didUpdateWidget(covariant MediaBrowserToolbar oldWidget) { + super.didUpdateWidget(oldWidget); + if (_search.text != widget.query) _search.text = widget.query; + } + + @override + void dispose() { + _search.dispose(); + super.dispose(); + } bool get canImport => widget.canImport; VoidCallback get onImport => widget.onImport; @@ -57,6 +98,11 @@ class _MediaBrowserToolbarState extends State { final configuration = ( filter, grid, + widget.sort, + widget.gridSize, + widget.desktop, + widget.projectScoped, + canImport, Theme.of(context), Localizations.localeOf(context), MediaQuery.textScalerOf(context), @@ -69,13 +115,20 @@ class _MediaBrowserToolbarState extends State { final selected = projects .where((project) => project.id == selectedProjectId) .firstOrNull; + if (widget.desktop || AppTheme.isDesktop(context)) { + return _desktopToolbar(context, selected); + } Widget row(Key key, Widget child) => SizedBox( key: key, - height: AppControlSize.panelToolbar, + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.panelHeader + : AppControlSize.panelToolbar, child: Padding( - padding: const EdgeInsets.symmetric( + padding: EdgeInsets.symmetric( horizontal: AppSidebarMetrics.outerPadding, - vertical: AppSpacing.gap, + vertical: AppTheme.isDesktop(context) + ? AppSpacing.tiny + : AppSpacing.gap, ), child: child, ), @@ -87,85 +140,84 @@ class _MediaBrowserToolbarState extends State { row( const Key('media-project-row'), LayoutBuilder( - builder: (context, constraints) { - final painter = TextPainter( - text: TextSpan( - text: context.l10n.importMedia, - style: AppTheme.toolbarTextStyle(context), + builder: (context, constraints) => Row( + children: [ + Expanded( + child: widget.projectScoped + ? Text( + context.l10n.materials, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.titleSmall, + ) + : AppDropdownMenu( + enabled: + onProjectSelected != null && projects.isNotEmpty, + maxHeight: 320, + items: [ + for (final project in projects) + AppMenuItem( + key: ValueKey('media-project-${project.id}'), + label: project.name, + selected: project.id == selectedProjectId, + selectOption: true, + onPressed: onProjectSelected == null + ? null + : () => onProjectSelected!(project), + ), + ], + builder: (context, toggle, focusNode) => + AppToolbarDropdownButton( + buttonKey: const Key('media-project-button'), + focusNode: focusNode, + onPressed: toggle, + child: Row( + children: [ + Expanded( + child: Text( + selected?.name ?? + context.l10n.selectProject, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox(width: AppSpacing.tiny), + const Icon( + AppIcons.expandMore, + size: AppIconSize.header, + ), + ], + ), + ), + ), ), - textDirection: Directionality.of(context), - textScaler: MediaQuery.textScalerOf(context), - )..layout(); - final compact = constraints.maxWidth < painter.width + 140; - painter.dispose(); - return Row( - children: [ - Expanded( - child: AppDropdownMenu( - enabled: onProjectSelected != null && projects.isNotEmpty, - maxHeight: 320, - items: [ - for (final project in projects) - AppMenuItem( - key: ValueKey('media-project-${project.id}'), - label: project.name, - selected: project.id == selectedProjectId, - selectOption: true, - onPressed: onProjectSelected == null - ? null - : () => onProjectSelected!(project), - ), - ], - builder: (context, toggle, focusNode) => - AppToolbarDropdownButton( - buttonKey: const Key('media-project-button'), - focusNode: focusNode, - onPressed: toggle, - child: Row( - children: [ - Expanded( - child: Text( - selected?.name ?? - context.l10n.selectProject, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ), - const SizedBox(width: AppSpacing.tiny), - const Icon( - Icons.keyboard_arrow_down, - size: AppIconSize.header, - ), - ], - ), - ), + const SizedBox(width: AppSpacing.tiny), + ConstrainedBox( + constraints: BoxConstraints( + maxWidth: (constraints.maxWidth * .45).clamp( + 28, + double.infinity, ), ), - const SizedBox(width: AppSpacing.tiny), - if (compact) - SizedBox.square( - dimension: AppControlSize.headerButton, - child: IconButton( - key: const Key('media-import-button'), - tooltip: context.l10n.importMedia, - onPressed: canImport ? onImport : null, - icon: const Icon(Icons.add, size: AppIconSize.header), - ), - ) - else - SizedBox( - height: AppControlSize.headerButton, - child: TextButton.icon( + child: SizedBox( + height: AppControlSize.headerButton, + child: Tooltip( + message: context.l10n.importMedia, + child: TextButton( key: const Key('media-import-button'), style: AppTheme.toolbarButtonStyle(context), onPressed: canImport ? onImport : null, - icon: const Icon(Icons.add, size: AppIconSize.header), - label: Text(context.l10n.importMedia), + child: Text( + context.l10n.importMedia, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), ), ), - ], - ); - }, + ), + ), + ], + ), ), ), _filterControls ??= row( @@ -206,7 +258,7 @@ class _MediaBrowserToolbarState extends State { ), const SizedBox(width: AppSpacing.tiny), const Icon( - Icons.keyboard_arrow_down, + AppIcons.expandMore, size: AppIconSize.header, ), ], @@ -224,7 +276,7 @@ class _MediaBrowserToolbarState extends State { key: const Key('media-layout-toggle'), onPressed: onToggleGrid, icon: Icon( - grid ? Icons.view_list_outlined : Icons.grid_view_outlined, + grid ? AppIcons.listView : AppIcons.gridView, size: AppIconSize.header, ), tooltip: grid @@ -238,4 +290,314 @@ class _MediaBrowserToolbarState extends State { ], ); } + + Widget _desktopToolbar(BuildContext context, RecentProject? selected) { + Widget category() => Semantics( + label: context.l10n.mediaCategory, + child: AppDropdownMenu( + items: [ + for (final option in MediaFilter.values) + AppMenuItem( + key: ValueKey('media-filter-${option.name}'), + label: option.label(context), + selected: option == filter, + selectOption: true, + onPressed: () => onFilterChanged(option), + ), + ], + builder: (context, toggle, focus) => AppToolbarDropdownButton( + buttonKey: const Key('media-category-button'), + focusNode: focus, + onPressed: toggle, + child: Row( + children: [ + Expanded( + child: Text( + filter.label(context), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + const Icon(AppIcons.expandMore, size: 16), + ], + ), + ), + ), + ); + String sortLabel(MediaSort value) => switch (value) { + MediaSort.importOrder => context.l10n.mediaSortImportOrder, + MediaSort.nameAscending => context.l10n.mediaSortNameAscending, + MediaSort.nameDescending => context.l10n.mediaSortNameDescending, + }; + return Column( + key: const Key('media-panel-header'), + mainAxisSize: MainAxisSize.min, + children: [ + if (widget.projectScoped) + ResourceSectionTabs( + selected: widget.resourceSection, + onSelected: widget.onResourceSectionChanged, + ) + else + SizedBox( + key: const Key('media-project-row'), + height: 36, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), + child: LayoutBuilder( + builder: (context, constraints) => Row( + children: [ + Expanded( + child: AppDropdownMenu( + enabled: + onProjectSelected != null && projects.isNotEmpty, + maxHeight: 320, + items: [ + for (final project in projects) + AppMenuItem( + key: ValueKey('media-project-${project.id}'), + label: project.name, + selected: project.id == selectedProjectId, + selectOption: true, + onPressed: onProjectSelected == null + ? null + : () => onProjectSelected!(project), + ), + ], + builder: (context, toggle, focusNode) => + AppToolbarDropdownButton( + buttonKey: const Key('media-project-button'), + focusNode: focusNode, + onPressed: toggle, + child: Row( + children: [ + Expanded( + child: Text( + selected?.name ?? + context.l10n.selectProject, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + const Icon(AppIcons.expandMore, size: 16), + ], + ), + ), + ), + ), + const SizedBox(width: 4), + ConstrainedBox( + constraints: BoxConstraints( + maxWidth: (constraints.maxWidth * .45).clamp( + 28, + double.infinity, + ), + ), + child: SizedBox( + height: 28, + child: Tooltip( + message: context.l10n.importMedia, + child: TextButton( + key: const Key('media-import-button'), + style: AppTheme.toolbarButtonStyle(context), + onPressed: canImport ? onImport : null, + child: Text( + context.l10n.importMedia, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + if (!widget.projectScoped || + widget.resourceSection == ResourceSection.imported) + _filterControls ??= _desktopControls(context, category, sortLabel), + ], + ); + } + + Widget _desktopControls( + BuildContext context, + Widget Function() category, + String Function(MediaSort) sortLabel, + ) { + List sortItems() => [ + for (final value in MediaSort.values) + AppMenuItem( + key: ValueKey('media-sort-${value.name}'), + label: sortLabel(value), + selected: widget.sort == value, + selectOption: true, + onPressed: widget.onSortChanged == null + ? null + : () => widget.onSortChanged!(value), + ), + ]; + String sizeLabel(MediaGridSize value) => switch (value) { + MediaGridSize.small => context.l10n.mediaThumbnailSmall, + MediaGridSize.medium => context.l10n.mediaThumbnailMedium, + MediaGridSize.large => context.l10n.mediaThumbnailLarge, + }; + List sizeItems() => [ + for (final value in MediaGridSize.values) + AppMenuItem( + key: ValueKey('media-size-${value.name}'), + label: sizeLabel(value), + selected: widget.gridSize == value, + selectOption: true, + onPressed: !grid || widget.onGridSizeChanged == null + ? null + : () => widget.onGridSizeChanged!(value), + ), + ]; + Widget menuButton({ + required Key key, + required String tooltip, + required IconData icon, + required List items, + }) => SizedBox.square( + dimension: 28, + child: AppDropdownMenu( + items: items, + builder: (context, toggle, focus) => IconButton( + key: key, + focusNode: focus, + tooltip: tooltip, + onPressed: toggle, + padding: EdgeInsets.zero, + icon: Icon(icon, size: 16), + ), + ), + ); + return SizedBox( + key: const Key('media-filter-row'), + height: 40, + child: Padding( + padding: const EdgeInsets.fromLTRB(12, 4, 12, 4), + child: LayoutBuilder( + builder: (context, constraints) { + final wide = constraints.maxWidth >= 400; + return Row( + children: [ + Expanded( + child: TextField( + key: const Key('media-search'), + controller: _search, + enabled: widget.onQueryChanged != null, + style: AppTheme.inputTextStyle( + context, + style: AppTheme.toolbarTextStyle(context), + ), + cursorHeight: AppTheme.inputCursorHeight( + context, + style: AppTheme.toolbarTextStyle(context), + ), + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: context.l10n.searchOptions( + context.l10n.materials, + ), + hintStyle: AppTheme.inputHintStyle( + context, + style: AppTheme.toolbarTextStyle(context), + ), + isDense: true, + constraints: const BoxConstraints(minHeight: 32), + contentPadding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + prefixIcon: constraints.maxWidth < 160 + ? null + : const Icon(AppIcons.search, size: 16), + prefixIconConstraints: const BoxConstraints( + minWidth: 28, + minHeight: 28, + ), + ), + onChanged: (value) => widget.onQueryChanged?.call(value), + ), + ), + const SizedBox(width: 4), + if (wide) ...[ + SizedBox(width: 88, height: 28, child: category()), + const SizedBox(width: 4), + menuButton( + key: const Key('media-sort-button'), + tooltip: context.l10n.sortMedia, + icon: AppIcons.sort, + items: sortItems(), + ), + const SizedBox(width: 4), + menuButton( + key: const Key('media-size-button'), + tooltip: context.l10n.mediaThumbnailSize, + icon: AppIcons.gridView, + items: sizeItems(), + ), + ] else + menuButton( + key: const Key('media-category-button'), + tooltip: MaterialLocalizations.of(context).showMenuTooltip, + icon: AppIcons.more, + items: [ + AppMenuLabel(context.l10n.mediaCategory), + for (final option in MediaFilter.values) + AppMenuItem( + key: ValueKey('media-filter-${option.name}'), + label: option.label(context), + selected: option == filter, + selectOption: true, + onPressed: () => onFilterChanged(option), + ), + const AppMenuSeparator(), + AppMenuLabel(context.l10n.sortMedia), + ...sortItems(), + const AppMenuSeparator(), + AppMenuLabel(context.l10n.mediaThumbnailSize), + ...sizeItems(), + ], + ), + const SizedBox(width: 4), + SizedBox.square( + dimension: 28, + child: IconButton( + key: const Key('media-layout-toggle'), + onPressed: onToggleGrid, + padding: EdgeInsets.zero, + icon: Icon( + grid ? AppIcons.listView : AppIcons.gridView, + size: 16, + ), + tooltip: grid + ? context.l10n.listLayout + : context.l10n.gridLayout, + ), + ), + if (widget.projectScoped) ...[ + const SizedBox(width: 4), + SizedBox.square( + dimension: 28, + child: IconButton( + key: const Key('media-import-button'), + onPressed: canImport ? () => onImport() : null, + tooltip: context.l10n.importMedia, + padding: EdgeInsets.zero, + icon: const Icon(AppIcons.add, size: 16), + ), + ), + ], + ], + ); + }, + ), + ), + ); + } } diff --git a/lib/features/media/media_browser_toolbar_previews.dart b/lib/features/media/media_browser_toolbar_previews.dart new file mode 100644 index 0000000..126967a --- /dev/null +++ b/lib/features/media/media_browser_toolbar_previews.dart @@ -0,0 +1,76 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../../l10n/app_localizations.dart'; +import '../../workspace/project_state.dart'; +import 'media_browser_controller.dart'; +import 'media_browser_toolbar.dart'; + +@Preview( + name: 'Media toolbar — light', + group: 'Desktop media', + size: Size(320, 76), +) +Widget desktopMediaToolbarLightPreview() => _preview(Brightness.light); + +@Preview( + name: 'Media toolbar — dark', + group: 'Desktop media', + size: Size(240, 76), +) +@Preview( + name: 'Media toolbar — narrow', + group: 'Desktop media', + size: Size(180, 76), +) +Widget desktopMediaToolbarDarkPreview() => _preview(Brightness.dark); + +@Preview( + name: 'Media toolbar — wide', + group: 'Desktop media', + size: Size(640, 76), +) +Widget desktopMediaToolbarWidePreview() => _preview(Brightness.light); + +Widget _preview(Brightness brightness) { + var query = ''; + var filter = MediaFilter.all; + var sort = MediaSort.importOrder; + var grid = true; + var gridSize = MediaGridSize.medium; + return MaterialApp( + debugShowCheckedModeBanner: false, + 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) => MediaBrowserToolbar( + desktop: true, + projects: const [ + RecentProject(id: 'demo', name: '城市漫游', path: '/demo'), + RecentProject(id: 'other', name: '旅行记录', path: '/other'), + ], + selectedProjectId: 'demo', + onProjectSelected: (_) {}, + canImport: true, + onImport: () {}, + filter: filter, + onFilterChanged: (value) => setState(() => filter = value), + grid: grid, + onToggleGrid: () => setState(() => grid = !grid), + query: query, + onQueryChanged: (value) => setState(() => query = value), + sort: sort, + onSortChanged: (value) => setState(() => sort = value), + gridSize: gridSize, + onGridSizeChanged: (value) => setState(() => gridSize = value), + ), + ), + ), + ); +} diff --git a/lib/features/media/media_panel.dart b/lib/features/media/media_panel.dart index e0574b0..176383b 100644 --- a/lib/features/media/media_panel.dart +++ b/lib/features/media/media_panel.dart @@ -16,6 +16,7 @@ import 'media_browser_body.dart'; import 'media_browser_toolbar.dart'; import 'media_browser_controller.dart'; import 'media_browser_feedback.dart'; +import 'resource_navigation.dart'; /// Desktop presentation owns compact controls and native file dragging. class MediaPanel extends ConsumerStatefulWidget { @@ -26,8 +27,10 @@ class MediaPanel extends ConsumerStatefulWidget { this.grid, this.onGridChanged, this.onSelectProject, + this.projectScoped = false, }) : assert((grid == null) == (onGridChanged == null)); final String? projectId; + final bool projectScoped; final ValueChanged? onSelectProject; final Color? backgroundColor; final bool? grid; @@ -50,6 +53,7 @@ class _MediaPanelState extends ConsumerState { grid: grid, draggable: true, compact: true, + desktop: true, ); } return _body!; @@ -81,6 +85,8 @@ class _MediaPanelState extends ConsumerState { child: Column( children: [ MediaBrowserToolbar( + desktop: true, + projectScoped: widget.projectScoped, projects: workspace.$1, onProjectSelected: onSelectProject, canImport: false, @@ -96,18 +102,32 @@ class _MediaPanelState extends ConsumerState { ); } final browser = ref.watch(mediaBrowserProvider(projectId)); - ref.watch(externalMediaImportProvider(projectId)); + ref.watch( + externalMediaImportProvider(projectId).select((value) => value.isLoading), + ); final nativeDrop = ref.watch(platformCapabilitiesProvider).nativeFileDrop; return ListenableSelector( listenable: browser, - select: () => - (browser.filter, browser.grid, browser.busy, browser.canImport), + select: () => ( + browser.filter, + browser.grid, + browser.busy, + browser.importing, + browser.canImport, + browser.query, + browser.sort, + browser.gridSize, + browser.resourceSection, + ), builder: (context, _) { final grid = widget.grid ?? browser.grid; final visible = TickerMode.valuesOf(context).enabled && (ModalRoute.of(context)?.isCurrent ?? true); final enabled = browser.canImport && visible; + final browsingImports = + !widget.projectScoped || + browser.resourceSection == ResourceSection.imported; void toggleGrid() { final next = !grid; if (widget.onGridChanged case final onChanged?) { @@ -128,6 +148,11 @@ class _MediaPanelState extends ConsumerState { Column( children: [ MediaBrowserToolbar( + desktop: true, + projectScoped: widget.projectScoped, + resourceSection: browser.resourceSection, + onResourceSectionChanged: (value) => + browser.resourceSection = value, projects: workspace.$1, selectedProjectId: projectId, onProjectSelected: onSelectProject, @@ -137,21 +162,45 @@ class _MediaPanelState extends ConsumerState { onFilterChanged: (value) => browser.filter = value, grid: grid, onToggleGrid: toggleGrid, + query: browser.query, + onQueryChanged: (value) => browser.query = value, + sort: browser.sort, + onSortChanged: (value) => browser.sort = value, + gridSize: browser.gridSize, + onGridSizeChanged: (value) => browser.gridSize = value, ), Expanded( key: const Key('media-panel-body'), - child: _browserBody(projectId, grid), + child: widget.projectScoped + ? IndexedStack( + index: browsingImports ? 0 : 1, + children: [ + TickerMode( + enabled: browsingImports, + child: _browserBody(projectId, grid), + ), + ResourceLibraryEmpty( + key: ValueKey(( + 'resource-library-empty', + projectId, + browser.resourceSection, + )), + section: browser.resourceSection, + ), + ], + ) + : _browserBody(projectId, grid), ), ], ), - if (browser.busy) + if (browser.importing) const DelayedLoadingIndicator( child: Align( alignment: Alignment.topCenter, child: LinearProgressIndicator(), ), ), - if (_hovering && enabled) + if (_hovering && enabled && browsingImports) const DropToAddOverlay(key: Key('media-drop-highlight')), ], ), @@ -159,7 +208,11 @@ class _MediaPanelState extends ConsumerState { ); if (!nativeDrop) return content; return NativeProjectDropRegion( - enabled: visible && browser.active && (enabled || browser.busy), + enabled: + browsingImports && + visible && + browser.active && + (enabled || browser.busy), onEnter: (_) { if (enabled) setState(() => _hovering = true); }, diff --git a/lib/features/media/resource_navigation.dart b/lib/features/media/resource_navigation.dart new file mode 100644 index 0000000..c42163f --- /dev/null +++ b/lib/features/media/resource_navigation.dart @@ -0,0 +1,208 @@ +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; + +import '../../l10n/app_localizations.dart'; +import 'resource_section.dart'; + +export 'resource_section.dart'; + +extension ResourceSectionPresentation on ResourceSection { + String label(AppLocalizations l10n) => switch (this) { + ResourceSection.imported => l10n.resourceMyMedia, + ResourceSection.audio => l10n.audio, + ResourceSection.text => l10n.text, + ResourceSection.stickers => l10n.resourceStickers, + ResourceSection.effects => l10n.resourceEffects, + ResourceSection.transitions => l10n.resourceTransitions, + }; + + IconData get icon => switch (this) { + ResourceSection.imported => AppIcons.mediaLibrary, + ResourceSection.audio => AppIcons.audio, + ResourceSection.text => AppIcons.rename, + ResourceSection.stickers => AppIcons.image, + ResourceSection.effects => AppIcons.assistant, + ResourceSection.transitions => AppIcons.splitVertical, + }; +} + +/// Desktop resource tabs share the timeline's scrolling and edge fades. +class ResourceSectionTabs extends StatefulWidget { + const ResourceSectionTabs({ + super.key, + required this.selected, + required this.onSelected, + }); + + final ResourceSection selected; + final ValueChanged? onSelected; + + @override + State createState() => _ResourceSectionTabsState(); +} + +class _ResourceSectionTabsState extends State { + final _scrollController = ScrollController(); + final _selectedTabKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _showSelectedTab(); + } + + @override + void didUpdateWidget(covariant ResourceSectionTabs oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.selected != widget.selected) _showSelectedTab(); + } + + void _showSelectedTab() { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!mounted) return; + final selected = _selectedTabKey.currentContext; + if (selected == null) return; + if (_scrollController.hasClients) { + final position = _scrollController.position; + if (widget.selected == ResourceSection.values.first) { + _scrollController.jumpTo(position.minScrollExtent); + return; + } + if (widget.selected == ResourceSection.values.last) { + _scrollController.jumpTo(position.maxScrollExtent); + return; + } + } + Scrollable.ensureVisible( + selected, + alignmentPolicy: ScrollPositionAlignmentPolicy.keepVisibleAtEnd, + ); + Scrollable.ensureVisible( + selected, + alignmentPolicy: ScrollPositionAlignmentPolicy.keepVisibleAtStart, + ); + }); + } + + void _onPointerSignal(PointerSignalEvent event) { + if (event is! PointerScrollEvent || !_scrollController.hasClients) return; + final delta = event.scrollDelta.dy != 0 + ? event.scrollDelta.dy + : event.scrollDelta.dx; + if (delta == 0) return; + final position = _scrollController.position; + final target = (position.pixels + delta).clamp( + position.minScrollExtent, + position.maxScrollExtent, + ); + if (target == position.pixels) return; + GestureBinding.instance.pointerSignalResolver.register(event, (_) { + if (_scrollController.hasClients) _scrollController.jumpTo(target); + }); + } + + @override + void dispose() { + _scrollController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final l10n = AppLocalizations.of(context)!; + return SizedBox( + key: const Key('resource-section-tabs'), + height: 36, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5), + child: ScrollEdgeFade( + controller: _scrollController, + axis: Axis.horizontal, + child: Listener( + onPointerSignal: _onPointerSignal, + child: SingleChildScrollView( + key: const Key('resource-tabs-list'), + controller: _scrollController, + scrollDirection: Axis.horizontal, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Row( + children: [ + for (final section in ResourceSection.values) ...[ + if (section != ResourceSection.values.first) + const SizedBox(width: 4), + KeyedSubtree( + key: widget.selected == section + ? _selectedTabKey + : null, + child: Semantics( + selected: widget.selected == section, + child: TextButton( + key: ValueKey('resource-tab-${section.name}'), + style: AppTheme.timelineTabStyle( + context, + selected: widget.selected == section, + ), + onPressed: widget.onSelected == null + ? null + : () => widget.onSelected!(section), + child: Text(section.label(l10n), maxLines: 1), + ), + ), + ), + ], + ], + ), + ), + ), + ), + ), + ), + ); + } +} + +class ResourceLibraryEmpty extends StatelessWidget { + const ResourceLibraryEmpty({super.key, required this.section}); + final ResourceSection section; + + @override + Widget build(BuildContext context) { + final l10n = AppLocalizations.of(context)!; + final theme = Theme.of(context); + return Center( + child: SingleChildScrollView( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + section.icon, + size: 28, + color: theme.colorScheme.onSurfaceVariant, + ), + const SizedBox(height: 12), + Text( + l10n.resourceLibraryEmpty(section.label(l10n)), + textAlign: TextAlign.center, + style: theme.textTheme.bodyMedium, + ), + if (section == ResourceSection.audio) ...[ + const SizedBox(height: 6), + Text( + l10n.resourceImportedAudioHint, + textAlign: TextAlign.center, + style: theme.textTheme.bodySmall?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + ), + ), + ], + ], + ), + ), + ); + } +} diff --git a/lib/features/media/resource_navigation_previews.dart b/lib/features/media/resource_navigation_previews.dart new file mode 100644 index 0000000..8969ce7 --- /dev/null +++ b/lib/features/media/resource_navigation_previews.dart @@ -0,0 +1,56 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../../l10n/app_localizations.dart'; +import 'resource_navigation.dart'; + +@Preview( + name: 'Resource categories — wide', + group: 'Desktop media', + size: Size(560, 260), +) +Widget wideResourceNavigationPreview() => _preview(Brightness.light); + +@Preview( + name: 'Resource categories — narrow', + group: 'Desktop media', + size: Size(240, 260), +) +Widget narrowResourceNavigationPreview() => _preview(Brightness.dark); + +Widget _preview(Brightness brightness) { + var section = ResourceSection.imported; + return MaterialApp( + debugShowCheckedModeBanner: false, + 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) => Column( + children: [ + ResourceSectionTabs( + selected: section, + onSelected: (value) => setState(() => section = value), + ), + const Divider(height: 1), + Expanded( + child: section == ResourceSection.imported + ? Center( + child: Text( + AppLocalizations.of(context)!.dragMediaHint, + textAlign: TextAlign.center, + ), + ) + : ResourceLibraryEmpty(section: section), + ), + ], + ), + ), + ), + ); +} diff --git a/lib/features/media/resource_section.dart b/lib/features/media/resource_section.dart new file mode 100644 index 0000000..712a452 --- /dev/null +++ b/lib/features/media/resource_section.dart @@ -0,0 +1,2 @@ +/// Resource navigation is separate from filters on project-imported files. +enum ResourceSection { imported, audio, text, stickers, effects, transitions } diff --git a/lib/features/media/transcription_dialog.dart b/lib/features/media/transcription_dialog.dart index dcbdede..4b2adf7 100644 --- a/lib/features/media/transcription_dialog.dart +++ b/lib/features/media/transcription_dialog.dart @@ -1,3 +1,5 @@ +import '../../shared/widgets/listenable_selector.dart'; + import 'package:cutdex/l10n/l10n.dart'; import 'package:cutdex_sdk/project.dart'; @@ -11,6 +13,7 @@ import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import '../../shared/widgets/confirm_resource_download_cancel.dart'; +import '../../shared/widgets/error_notification_host.dart'; import '../../shared/widgets/processing_resource_download_dialog.dart'; import '../../workspace/timeline_session.dart'; @@ -268,11 +271,11 @@ class _TranscriptionDialogState extends ConsumerState { _closing = true; WidgetsBinding.instance.addPostFrameCallback((_) { if (!mounted) return; - final messenger = ScaffoldMessenger.maybeOf(context); + final notifications = ErrorNotificationHost.maybeOf(context); final message = context.l10n.subtitleTaskStarted; _dismissDialog(); if (next is SubtitleStarted) { - messenger?.showSnackBar(SnackBar(content: Text(message))); + notifications?.showMessage(content: Text(message)); } }); } @@ -280,8 +283,18 @@ class _TranscriptionDialogState extends ConsumerState { ref.listen(subtitleDownloadProvider, (_, next) => handleResult(next)); ref.listen(_startProvider, (_, next) => handleResult(next)); - return ListenableBuilder( + return ListenableSelector( listenable: widget.session, + select: () { + final service = widget.session.transcriptions; + return ( + service?.recognitionAvailable, + service?.translationAvailable, + service?.tasks.any((task) => !task.terminal), + service?.translationTasks.any((task) => !task.terminal), + widget.session.acceptsEdits, + ); + }, builder: (context, _) { final service = widget.session.transcriptions; if (service?.recognitionAvailable != true || diff --git a/lib/features/media/unavailable_media_placeholder.dart b/lib/features/media/unavailable_media_placeholder.dart index 4db98b2..48a7892 100644 --- a/lib/features/media/unavailable_media_placeholder.dart +++ b/lib/features/media/unavailable_media_placeholder.dart @@ -1,6 +1,7 @@ import 'package:cutdex/l10n/l10n.dart'; import 'package:flutter/material.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import '../../workspace/media_availability.dart'; @@ -34,7 +35,7 @@ class UnavailableMediaPlaceholder extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Icon( - Icons.broken_image_outlined, + AppIcons.imageUnavailable, size: isPreview ? 32 : 24, color: theme.colorScheme.error, ), diff --git a/lib/features/media/visual_asset_tile.dart b/lib/features/media/visual_asset_tile.dart index 39cac85..49bc304 100644 --- a/lib/features/media/visual_asset_tile.dart +++ b/lib/features/media/visual_asset_tile.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'media_asset_cover.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; class VisualAssetTile extends StatelessWidget { @@ -25,8 +26,8 @@ class VisualAssetTile extends StatelessWidget { fallback: Center( child: Icon( asset.metadata['kind'] == 'image' - ? Icons.image_outlined - : Icons.movie_outlined, + ? AppIcons.image + : AppIcons.video, size: AppIconSize.emptyState, color: Theme.of(context).colorScheme.onSurfaceVariant, ), diff --git a/lib/features/preview/fullscreen_playback_bar.dart b/lib/features/preview/fullscreen_playback_bar.dart index 6dd39f8..87a6960 100644 --- a/lib/features/preview/fullscreen_playback_bar.dart +++ b/lib/features/preview/fullscreen_playback_bar.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import '../../l10n/l10n.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; class FullscreenPlaybackBar extends StatefulWidget { @@ -84,7 +85,7 @@ class _FullscreenPlaybackBarState extends State { alignment: Alignment.centerLeft, child: _button( context, - Icons.first_page, + AppIcons.seekStart, context.l10n.previewGoToStart, enabled ? () => widget.onSeek!(0) : null, ), @@ -94,20 +95,20 @@ class _FullscreenPlaybackBarState extends State { children: [ _button( context, - Icons.skip_previous, + AppIcons.previousFrame, context.l10n.previewPreviousFrame, enabled && _position > 0 ? () => _step(-1) : null, ), _button( context, - widget.playing ? Icons.pause : Icons.play_arrow, + widget.playing ? AppIcons.pause : AppIcons.play, widget.playing ? context.l10n.pause : context.l10n.play, widget.onPlayPause, size: 32, ), _button( context, - Icons.skip_next, + AppIcons.nextFrame, context.l10n.previewNextFrame, enabled && _position < widget.durationTick ? () => _step(1) @@ -119,7 +120,7 @@ class _FullscreenPlaybackBarState extends State { alignment: Alignment.centerRight, child: _button( context, - Icons.fullscreen_exit, + AppIcons.exitFullscreen, context.l10n.exitPreviewFullscreen, widget.onExit, key: const Key('preview-fullscreen'), diff --git a/lib/features/preview/preview_fullscreen.dart b/lib/features/preview/preview_fullscreen.dart index 16c7fb4..b814dea 100644 --- a/lib/features/preview/preview_fullscreen.dart +++ b/lib/features/preview/preview_fullscreen.dart @@ -136,7 +136,11 @@ class PreviewFullscreenLayout extends StatelessWidget { fit: StackFit.expand, children: [ Positioned.fill( - bottom: fullscreen ? 0 : AppControlSize.panelHeader, + bottom: fullscreen + ? 0 + : AppTheme.isDesktop(context) + ? AppDesktopMetrics.playbackBar + : AppControlSize.panelHeader, child: canvas, ), Align( diff --git a/lib/features/preview/preview_panel.dart b/lib/features/preview/preview_panel.dart index d6b9f7a..8c82eb6 100644 --- a/lib/features/preview/preview_panel.dart +++ b/lib/features/preview/preview_panel.dart @@ -16,6 +16,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -118,9 +119,10 @@ FutureOr _preparePreview( } try { if (!ref.mounted) throw StateError('Editor closed'); - final result = ref - .read(previewControllerRegistryProvider) - .prepare(ids, timeline); + final registry = ref.read(previewControllerRegistryProvider); + final release = registry.retain(ids); + ref.onDispose(release); + final result = registry.prepare(ids, timeline); if (result case Future future) { return future.catchError((Object error, StackTrace stack) { AppDiagnostics.failure( @@ -183,10 +185,12 @@ class _EditorPreviewContent extends ConsumerWidget { final watched = pending ? const AsyncData(null) : ref.watch(provider); - final registry = ref.watch(previewControllerRegistryProvider); - final cached = watched.isLoading && !watched.hasError - ? registry.cached((projectId, timelineId)) - : null; + final prepared = ref.watch( + previewControllerRegistryProvider.select( + (registry) => registry.cached((projectId, timelineId)), + ), + ); + final cached = watched.isLoading && !watched.hasError ? prepared : null; final state = cached == null ? watched : AsyncData(cached); @@ -219,8 +223,14 @@ class _EditorPreviewContent extends ConsumerWidget { PreviewFullscreenScope.of(context)?.fullscreen != true && activeController.session != null && activeController.error == null - ? (Rect rect) => ListenableBuilder( + ? (Rect rect) => ListenableSelector( listenable: activeController.positionChanges, + select: () => ( + activeController.positionTick, + activeController.selectedVisualIds.isNotEmpty, + activeController.maskEditingElement, + activeController.obscureEditingElement, + ), builder: (context, _) => Theme( data: AppTheme.previewCanvasTheme, child: NativePreviewOverlay( @@ -263,6 +273,8 @@ class _EditorPreviewContent extends ConsumerWidget { padding: PreviewFullscreenScope.of(context)?.fullscreen == true ? EdgeInsets.zero + : AppTheme.isDesktop(context) + ? const EdgeInsets.all(AppDesktopMetrics.panelPadding) : AppSpacing.panelSection, child: PreviewCanvas( alignment: Alignment.center, @@ -490,9 +502,11 @@ class _SourcePreviewPanel extends ConsumerWidget { child: Focus( autofocus: true, child: WorkspacePanel( - title: asset.name, + title: AppTheme.isDesktop(context) ? null : asset.name, showHeaderDivider: false, - headerHeight: PreviewFullscreenScope.of(context)?.fullscreen == true + headerHeight: + AppTheme.isDesktop(context) || + PreviewFullscreenScope.of(context)?.fullscreen == true ? 0 : AppControlSize.panelHeader, child: PreviewFullscreenLayout( @@ -520,6 +534,8 @@ class _SourcePreviewPanel extends ConsumerWidget { padding: PreviewFullscreenScope.of(context)?.fullscreen == true ? EdgeInsets.zero + : AppTheme.isDesktop(context) + ? const EdgeInsets.all(AppDesktopMetrics.panelPadding) : AppSpacing.panelSection, child: PreviewCanvas( alignment: Alignment.center, @@ -634,6 +650,64 @@ class _PreviewToolbar extends StatelessWidget { controller?.frameDuration ?? TimelineFormat.fps30.frameDuration; + Future _seek(BuildContext context, int requested) async { + final preview = controller; + final duration = source?.durationTick ?? preview?.durationTick ?? 0; + final frameTick = TimelineClock.standard.toTicks(_frameDuration); + final lastTick = duration > 0 + ? ((duration - 1) ~/ frameTick) * frameTick + : 0; + final tick = requested.clamp(0, lastTick); + try { + final time = CommandTime(tick, TimelineClock.ticksPerSecond); + if (source case final source?) { + await source.control(SourcePreviewAction.seek, at: time); + } else if (preview?.activeSequence() case final sequence?) { + await preview!.controlPreview(sequence, PreviewAction.seek, at: time); + } + } catch (error) { + if (context.mounted) { + ErrorNotificationHost.maybeOf(context)?.show( + ErrorNotification( + content: Text(previewErrorMessage(error, context.l10n)), + ), + ); + } + } + } + + Widget _frameButton( + BuildContext context, + int direction, + ) => ListenableSelector( + listenable: _clock, + select: () => ( + source?.canPlay ?? controller?.canPlay ?? false, + source?.durationTick ?? controller?.durationTick ?? 0, + ), + builder: (context, state) => IconButton( + key: Key(direction < 0 ? 'preview-previous-frame' : 'preview-next-frame'), + tooltip: direction < 0 + ? context.l10n.previewPreviousFrame + : context.l10n.previewNextFrame, + onPressed: !state.$1 || state.$2 <= 0 + ? null + : () { + final position = + source?.positionTick ?? controller?.positionTick ?? 0; + unawaited( + _seek( + context, + position + + direction * + TimelineClock.standard.toTicks(_frameDuration), + ), + ); + }, + icon: Icon(direction < 0 ? AppIcons.previousFrame : AppIcons.nextFrame), + ), + ); + Widget _build(BuildContext context) { final preview = controller; final playing = source?.playing ?? preview?.playing ?? false; @@ -646,32 +720,7 @@ class _PreviewToolbar extends StatelessWidget { final duration = source?.durationTick ?? preview?.durationTick ?? 0; final frameTick = TimelineClock.standard.toTicks(frameDuration); final canPlay = source?.canPlay ?? preview?.canPlay ?? false; - Future seek(int requested) async { - final lastTick = duration > 0 - ? ((duration - 1) ~/ frameTick) * frameTick - : 0; - final tick = requested.clamp(0, lastTick); - try { - final time = CommandTime(tick, TimelineClock.ticksPerSecond); - if (source case final source?) { - await source.control(SourcePreviewAction.seek, at: time); - } else if (preview?.activeSequence() case final sequence?) { - await preview!.controlPreview( - sequence, - PreviewAction.seek, - at: time, - ); - } - } catch (error) { - if (context.mounted) { - ErrorNotificationHost.maybeOf(context)?.show( - ErrorNotification( - content: Text(previewErrorMessage(error, context.l10n)), - ), - ); - } - } - } + Future seek(int requested) => _seek(context, requested); final sequence = preview?.activeSequence(); final view = sequence == null ? null : preview!.viewForSequence(sequence); @@ -709,138 +758,158 @@ class _PreviewToolbar extends StatelessWidget { } return SizedBox( key: const Key('preview-toolbar'), - height: AppControlSize.panelHeader, + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.playbackBar + : AppControlSize.panelHeader, child: Padding( padding: const EdgeInsets.symmetric(horizontal: AppSpacing.compact), - child: Row( - children: [ - Expanded( - child: ListenableSelector( - key: const Key('preview-time'), - listenable: _clock, - select: () => ( - source?.positionTick ?? preview?.positionTick ?? 0, - source?.durationTick ?? preview?.durationTick ?? 0, - _frameDuration, - ), - builder: (context, _) => Text.rich( - TextSpan( - children: [ + child: LayoutBuilder( + builder: (context, constraints) { + final controls = Row( + children: [ + Expanded( + child: ListenableSelector( + key: const Key('preview-time'), + listenable: _clock, + select: () => ( + source?.positionTick ?? preview?.positionTick ?? 0, + source?.durationTick ?? preview?.durationTick ?? 0, + _frameDuration, + ), + builder: (context, _) => Text.rich( TextSpan( - text: _time( - source?.positionTick ?? preview?.positionTick ?? 0, - _frameDuration, - ), - style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - ), - ), - TextSpan( - text: - ' / ${_time(source?.durationTick ?? preview?.durationTick ?? 0, _frameDuration)}', - style: TextStyle( - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), - ), - ], - ), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.bodySmall?.copyWith( - fontFeatures: [const FontFeature.tabularFigures()], - ), - ), - ), - ), - ListenableSelector( - listenable: source ?? preview, - select: () => ( - source?.playing ?? preview?.playing ?? false, - source?.canPlay ?? preview?.canPlay ?? false, - ), - builder: (context, value) { - final playing = value.$1; - return IconButton( - tooltip: playing ? context.l10n.pause : context.l10n.play, - onPressed: source != null - ? (source!.canPlay ? source!.togglePlayback : null) - : preview != null && preview.canPlay - ? preview.togglePlayback - : null, - icon: Icon(playing ? Icons.pause : Icons.play_arrow), - ); - }, - ), - Expanded( - child: ListenableSelector( - listenable: source ?? preview, - select: () => ( - preview?.canvas, - preview?.error, - preview?.hasUnavailableMedia, - preview?.busy, - preview?.session, - source?.session, - source?.image, - ), - builder: (context, _) => Align( - alignment: Alignment.centerRight, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (preview != null && - (preview.error != null || - preview.hasUnavailableMedia)) ...[ - IconButton( - tooltip: context.l10n.retryPreview, - onPressed: preview.busy ? null : preview.retry, - icon: const Icon(Icons.refresh), - ), - const SizedBox(width: AppSpacing.gap), - ], - if (source == null && - PreviewFullscreenScope.of(context)?.fullscreen != - true) - Flexible( - child: AppSelect( - emptyLabel: context.l10n.noMatchingOptions, - label: context.l10n.canvasRatio, - outlined: false, - value: preview?.canvas ?? ProjectCanvas.widescreen, - onChanged: preview?.setCanvas, - options: [ - for (final entry - in ProjectCanvasPresets.values.entries) - AppSelectOption(entry.value, entry.key), - ], + children: [ + TextSpan( + text: _time( + source?.positionTick ?? + preview?.positionTick ?? + 0, + _frameDuration, + ), + style: TextStyle( + color: Theme.of(context).colorScheme.onSurface, + ), ), - ), - if (PreviewFullscreenScope.of(context) - case final fullscreen?) - IconButton( - key: const Key('preview-fullscreen'), - tooltip: fullscreen.fullscreen - ? context.l10n.exitPreviewFullscreen - : context.l10n.previewFullscreen, - onPressed: - fullscreen.fullscreen || - source?.session != null || - source?.image != null || - preview?.session != null - ? fullscreen.toggle - : null, - icon: Icon( - fullscreen.fullscreen - ? Icons.fullscreen_exit - : Icons.fullscreen, + TextSpan( + text: + ' / ${_time(source?.durationTick ?? preview?.durationTick ?? 0, _frameDuration)}', + style: TextStyle( + color: Theme.of(context) + .colorScheme + .onSurfaceVariant, + ), ), - ), - ], + ], + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodySmall?.copyWith( + fontFeatures: [const FontFeature.tabularFigures()], + ), + ), ), ), - ), - ), - ], + if (AppTheme.isDesktop(context)) _frameButton(context, -1), + ListenableSelector( + listenable: source ?? preview, + select: () => ( + source?.playing ?? preview?.playing ?? false, + source?.canPlay ?? preview?.canPlay ?? false, + ), + builder: (context, value) { + final playing = value.$1; + return IconButton( + tooltip: playing ? context.l10n.pause : context.l10n.play, + onPressed: source != null + ? (source!.canPlay ? source!.togglePlayback : null) + : preview != null && preview.canPlay + ? preview.togglePlayback + : null, + icon: Icon(playing ? AppIcons.pause : AppIcons.play), + ); + }, + ), + if (AppTheme.isDesktop(context)) _frameButton(context, 1), + Expanded( + child: ListenableSelector( + listenable: source ?? preview, + select: () => ( + preview?.canvas, + preview?.error, + preview?.hasUnavailableMedia, + preview?.busy, + preview?.session, + source?.session, + source?.image, + ), + builder: (context, _) => Align( + alignment: Alignment.centerRight, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (preview != null && + (preview.error != null || + preview.hasUnavailableMedia)) ...[ + IconButton( + tooltip: context.l10n.retryPreview, + onPressed: preview.busy ? null : preview.retry, + icon: const Icon(AppIcons.refresh), + ), + const SizedBox(width: AppSpacing.gap), + ], + if (source == null && + PreviewFullscreenScope.of(context)?.fullscreen != + true) + Flexible( + child: AppSelect( + emptyLabel: context.l10n.noMatchingOptions, + label: context.l10n.canvasRatio, + outlined: false, + value: + preview?.canvas ?? ProjectCanvas.widescreen, + onChanged: preview?.setCanvas, + options: [ + for (final entry + in ProjectCanvasPresets.values.entries) + AppSelectOption(entry.value, entry.key), + ], + ), + ), + if (PreviewFullscreenScope.of(context) + case final fullscreen?) + IconButton( + key: const Key('preview-fullscreen'), + tooltip: fullscreen.fullscreen + ? context.l10n.exitPreviewFullscreen + : context.l10n.previewFullscreen, + onPressed: + fullscreen.fullscreen || + source?.session != null || + source?.image != null || + preview?.session != null + ? fullscreen.toggle + : null, + icon: Icon( + fullscreen.fullscreen + ? AppIcons.exitFullscreen + : AppIcons.fullscreen, + ), + ), + ], + ), + ), + ), + ), + ], + ); + if (AppTheme.isDesktop(context) && constraints.maxWidth < 240) { + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SizedBox(width: 240, child: controls), + ); + } + return controls; + }, ), ), ); diff --git a/lib/features/projects/chat_header.dart b/lib/features/projects/chat_header.dart new file mode 100644 index 0000000..f798df4 --- /dev/null +++ b/lib/features/projects/chat_header.dart @@ -0,0 +1,272 @@ +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/material.dart'; + +import '../../l10n/app_localizations.dart'; + +/// Desktop conversation navigation, independent of project and agent state. +class ChatHeader extends StatelessWidget { + const ChatHeader({ + super.key, + required this.title, + required this.historyBuilder, + required this.onNew, + required this.actions, + this.busy = false, + this.panelActions = const [], + }); + + final String title; + final Widget Function(BuildContext context, VoidCallback close) + historyBuilder; + final VoidCallback? onNew; + final List actions; + final bool busy; + final List panelActions; + + @override + Widget build(BuildContext context) { + final l10n = AppLocalizations.of(context)!; + final iconStyle = IconButton.styleFrom( + fixedSize: const Size.square(26), + minimumSize: const Size.square(26), + maximumSize: const Size.square(26), + padding: EdgeInsets.zero, + iconSize: 16, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ); + return SizedBox( + key: const Key('project-chat-header'), + height: AppDesktopMetrics.panelHeader, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Row( + children: [ + Expanded( + child: AppPopover( + enabled: !busy, + width: 300, + surfaceKey: const Key('project-chat-history-menu'), + child: Builder( + builder: (menuContext) { + final menu = MenuController.maybeOf(menuContext); + return historyBuilder(menuContext, () { + if (menu?.isOpen == true) menu!.close(); + }); + }, + ), + builder: (context, toggle) => Tooltip( + message: '$title\n${l10n.agentConversations}', + child: TextButton( + key: const Key('project-chat-history'), + onPressed: busy ? null : toggle, + style: AppTheme.toolbarButtonStyle(context).copyWith( + minimumSize: const WidgetStatePropertyAll(Size(0, 26)), + maximumSize: const WidgetStatePropertyAll( + Size(double.infinity, 26), + ), + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: const WidgetStatePropertyAll( + EdgeInsets.symmetric(horizontal: 6), + ), + ), + child: Row( + children: [ + Expanded( + child: Text( + title, + key: const Key('project-chat-title'), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: AppTheme.toolbarTextStyle(context) + .copyWith(fontWeight: FontWeight.w500), + ), + ), + const SizedBox(width: 4), + const Icon(AppIcons.expandMore, size: 14), + ], + ), + ), + ), + ), + ), + const SizedBox(width: 4), + IconButton( + key: const Key('project-chat-new'), + tooltip: l10n.agentNewConversation, + style: iconStyle, + onPressed: busy ? null : onNew, + icon: const Icon(AppIcons.edit), + ), + const SizedBox(width: 4), + AppDropdownMenu( + enabled: (!busy && actions.isNotEmpty) || panelActions.isNotEmpty, + items: [ + if (!busy) ...actions, + if (!busy && actions.isNotEmpty && panelActions.isNotEmpty) + const AppMenuSeparator(), + ...panelActions, + ], + builder: (context, toggle, focus) => IconButton( + key: const Key('project-chat-more'), + tooltip: l10n.agentConversationActions, + style: iconStyle, + focusNode: focus, + onPressed: toggle, + icon: const Icon(AppIcons.more), + ), + ), + ], + ), + ), + ); + } +} + +typedef ChatHistoryEntry = ({String id, String title}); + +/// Search remains local to the currently open project's conversation list. +class ChatHistoryMenu extends StatefulWidget { + const ChatHistoryMenu({ + super.key, + required this.entries, + required this.onSelect, + this.selectedId, + this.itemBuilder, + this.footer, + this.error, + }); + + static const contentInset = 8.0; + static const sectionPadding = EdgeInsets.symmetric( + horizontal: contentInset, + vertical: 8, + ); + + final List entries; + final String? selectedId; + final ValueChanged onSelect; + final Widget Function(BuildContext, String id, VoidCallback onSelect)? + itemBuilder; + final Widget? footer; + final String? error; + + @override + State createState() => _ChatHistoryMenuState(); +} + +class _ChatHistoryMenuState extends State { + String _query = ''; + + @override + void didUpdateWidget(ChatHistoryMenu oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.entries.isEmpty) _query = ''; + } + + @override + Widget build(BuildContext context) { + final l10n = AppLocalizations.of(context)!; + final searchStyle = AppTheme.inputTextStyle( + context, + style: AppTheme.toolbarTextStyle(context), + ); + final entries = widget.entries.where( + (entry) => + entry.title.toLowerCase().contains(_query.trim().toLowerCase()), + ); + return SizedBox( + height: + widget.entries.isEmpty && + widget.footer == null && + widget.error == null + ? 88 + : 360, + child: Padding( + padding: const EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (widget.entries.isNotEmpty) + TextField( + key: const Key('project-chat-search'), + autofocus: true, + style: searchStyle, + cursorHeight: AppTheme.inputCursorHeight( + context, + style: searchStyle, + ), + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + isDense: true, + constraints: const BoxConstraints(minHeight: 28), + contentPadding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 5, + ), + hintText: l10n.searchOptions(l10n.agentConversations), + hintStyle: AppTheme.inputHintStyle( + context, + style: searchStyle, + ), + prefixIcon: const Icon(AppIcons.search, size: 14), + prefixIconConstraints: const BoxConstraints( + minWidth: 30, + minHeight: 28, + ), + ), + onChanged: (value) => setState(() => _query = value), + ), + Padding( + padding: ChatHistoryMenu.sectionPadding, + child: Text( + key: const Key('project-chat-group'), + l10n.agentConversations, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodySmall, + ), + ), + Expanded( + child: ListView( + primary: false, + padding: EdgeInsets.zero, + children: [ + if (entries.isEmpty) + Padding( + padding: ChatHistoryMenu.sectionPadding, + child: Text( + _query.trim().isEmpty + ? l10n.agentNoConversations + : l10n.noMatchingOptions, + ), + ), + for (final entry in entries) + widget.itemBuilder?.call( + context, + entry.id, + () => widget.onSelect(entry.id), + ) ?? + AppMenuItem( + key: ValueKey('chat-history-${entry.id}'), + label: entry.title, + selectOption: true, + selected: entry.id == widget.selectedId, + onPressed: () => widget.onSelect(entry.id), + ), + if (widget.error != null) + Padding( + padding: ChatHistoryMenu.sectionPadding, + child: Text(widget.error!), + ), + if (widget.footer != null) widget.footer!, + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/features/projects/chat_header_previews.dart b/lib/features/projects/chat_header_previews.dart new file mode 100644 index 0000000..2eb2522 --- /dev/null +++ b/lib/features/projects/chat_header_previews.dart @@ -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), + ], + ); + }, + ), + ), + ); +} diff --git a/lib/features/projects/conversation_sidebar.dart b/lib/features/projects/conversation_sidebar.dart index 02a8804..bb100a5 100644 --- a/lib/features/projects/conversation_sidebar.dart +++ b/lib/features/projects/conversation_sidebar.dart @@ -60,8 +60,13 @@ class ConversationSelection extends _$ConversationSelection { ref.onDispose(() { if (_draftKey case final key?) composers.removeDraft(projectId, key); }); - ref.watch( + ref.listen( projectsProvider.select((value) => value.value?.activeProject?.id), + (_, next) { + if (next == projectId && state.selectedId != null) { + state = state.copyWith(initialized: false); + } + }, ); final saved = savedConversationSelectionProvider(projectId); ref.listen(saved, (_, next) { diff --git a/lib/features/projects/conversation_sidebar.g.dart b/lib/features/projects/conversation_sidebar.g.dart index bc1ef6a..4d8185f 100644 --- a/lib/features/projects/conversation_sidebar.g.dart +++ b/lib/features/projects/conversation_sidebar.g.dart @@ -135,7 +135,7 @@ final class ConversationSelectionProvider } String _$conversationSelectionHash() => - r'eef3c6c95f86b017e73d3244adccc257f717699b'; + r'5b5036b69fd203ed7827d9f81d446786b7de373c'; /// Keeps a draft or explicit selection stable while the list refreshes. diff --git a/lib/features/projects/editor_loading_region.dart b/lib/features/projects/editor_loading_region.dart index 9c696fd..73b3ab5 100644 --- a/lib/features/projects/editor_loading_region.dart +++ b/lib/features/projects/editor_loading_region.dart @@ -3,7 +3,10 @@ import 'package:flutter/material.dart'; import '../../l10n/l10n.dart'; import '../../workspace/project_state.dart'; +import '../../integrations/platform/device_experience.dart'; +import '../editor/editor_page.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; class EmptyEditor extends StatelessWidget { @@ -13,78 +16,92 @@ class EmptyEditor extends StatelessWidget { required this.headerLeading, required this.showProjectName, this.desktop = false, + this.experience = DeviceExperience.desktop, }); final ProjectState state; final Widget headerLeading; final bool showProjectName; final bool desktop; + final DeviceExperience experience; @override - Widget build(BuildContext context) => Column( - children: [ - SizedBox( - height: desktop - ? AppControlSize.panelToolbar - : AppControlSize.panelHeader, - child: Padding( - padding: desktop - ? const EdgeInsets.symmetric( - horizontal: AppSidebarMetrics.outerPadding, - vertical: AppSpacing.gap, - ) - : EdgeInsets.zero, - child: WindowHeaderPadding( - child: Row( - children: [ - headerLeading, - if (showProjectName) - Expanded( - child: Text( - state.activeProject?.name ?? '', - key: const Key('workspace-project-title'), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.titleSmall, - ), + Widget build(BuildContext context) => state.activeProject == null + ? EditorWorkspace( + projectId: '', + timelineId: '', + projectName: '', + integratedTitlebar: false, + headerLeading: headerLeading, + showProjectName: showProjectName, + experience: experience, + projectLoading: true, + ) + : Column( + children: [ + SizedBox( + height: desktop + ? AppControlSize.panelToolbar + : AppControlSize.panelHeader, + child: Padding( + padding: desktop + ? const EdgeInsets.symmetric( + horizontal: AppSidebarMetrics.outerPadding, + vertical: AppSpacing.gap, + ) + : EdgeInsets.zero, + child: WindowHeaderPadding( + child: Row( + children: [ + headerLeading, + if (!showProjectName) const Spacer(), + if (showProjectName) + Expanded( + child: Text( + state.activeProject?.name ?? '', + key: const Key('workspace-project-title'), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.titleSmall, + ), + ), + ], ), - ], + ), + ), ), - ), - ), - ), - Expanded( - child: Center( - child: SingleChildScrollView( - padding: const EdgeInsets.all(AppSpacing.page), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - Icons.movie_outlined, - size: AppIconSize.project, - color: Theme.of(context).colorScheme.primary, - ), - const SizedBox(height: AppSpacing.medium), - Text( - state.activeProject == null - ? context.l10n.projectsEmpty - : context.l10n.projectNoTimelines, - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headlineMedium, - ), - if (state.activeProject != null) ...[ - const SizedBox(height: AppSpacing.small), - Text( - context.l10n.createTimelineHint, - textAlign: TextAlign.center, + Expanded( + child: Center( + child: SingleChildScrollView( + padding: const EdgeInsets.all(AppSpacing.page), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + AppIcons.video, + size: AppIconSize.project, + color: Theme.of(context).colorScheme.primary, + ), + const SizedBox(height: AppSpacing.medium), + Text( + state.activeProject == null + ? context.l10n.projectsEmpty + : context.l10n.projectNoTimelines, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.headlineMedium, + ), + if (state.activeProject != null) ...[ + const SizedBox(height: AppSpacing.small), + Text( + context.l10n.createTimelineHint, + textAlign: TextAlign.center, + ), + ], + ], ), - ], - ], + ), + ), ), - ), - ), - ), - ], - ); + ], + ); } diff --git a/lib/features/projects/project_sidebar.dart b/lib/features/projects/project_sidebar.dart index 66d86ce..d93504c 100644 --- a/lib/features/projects/project_sidebar.dart +++ b/lib/features/projects/project_sidebar.dart @@ -4,6 +4,7 @@ import '../../integrations/platform/device_experience.dart'; import 'touch_project_navigation.dart'; import '../media/media_panel.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'dart:async'; @@ -36,6 +37,9 @@ import '../../integrations/agent/agent_models.dart'; import 'widgets/name_dialog.dart'; import 'conversation_sidebar.dart'; +import 'chat_header.dart'; +import 'sidebar_category_tabs.dart'; +import 'sidebar_navigation_controller.dart'; typedef ProjectRenamer = Future Function(RecentProject project); @@ -44,7 +48,11 @@ class ProjectSidebar extends ConsumerStatefulWidget { super.key, required this.agent, this.navigationOnly = false, + this.chatOnly = false, + this.chatPanelActions = const [], this.resourcesSelected = false, + this.onResourcesSelected, + this.librarySelected = false, this.externalWindowFrame = false, this.experience = DeviceExperience.desktop, this.onNavigationComplete, @@ -66,7 +74,11 @@ class ProjectSidebar extends ConsumerStatefulWidget { final Widget agent; final bool navigationOnly; + final bool chatOnly; + final List chatPanelActions; final bool resourcesSelected; + final ValueChanged? onResourcesSelected; + final bool librarySelected; final bool externalWindowFrame; final DeviceExperience experience; final VoidCallback? onNavigationComplete; @@ -90,6 +102,13 @@ class ProjectSidebar extends ConsumerStatefulWidget { } class _ProjectSidebarState extends ConsumerState { + ProjectState get _projectState => + ref.read(projectsProvider).value ?? widget.state; + SidebarNavigationContext _navigationContext(ProjectState state) => + (projectId: state.activeProject?.id, timelineId: state.visibleTimelineId); + late final _navigation = SidebarNavigationController( + _navigationContext(_projectState), + ); bool _resourcesVisited = false; bool get _touch => widget.experience != DeviceExperience.desktop; bool _projectHeaderHovered = false; @@ -115,10 +134,17 @@ class _ProjectSidebarState extends ConsumerState { _projectSelection.value = widget.selectedProjectId; final ids = widget.state.recent.map((project) => project.id).toSet(); _groupWidgets.removeWhere((id, _) => !ids.contains(id)); + _navigation.update(_navigationContext(_projectState)); + if (oldWidget.mode != widget.mode || + oldWidget.resourcesSelected != widget.resourcesSelected || + oldWidget.librarySelected != widget.librarySelected) { + _navigation.cancel(); + } } @override void dispose() { + _navigation.dispose(); _projectSelection.dispose(); super.dispose(); } @@ -150,11 +176,15 @@ class _ProjectSidebarState extends ConsumerState { } void _selectProjectFromNavigation(RecentProject project) { + _navigation.cancel(); widget.onSelectProject?.call(project); if (widget.navigationOnly) _finishNavigation(); } - void _newConversation() => _conversations.newConversation(); + void _newConversation() { + _navigation.cancel(); + _conversations.newConversation(); + } Future _newConversationForProject(RecentProject project) async { _cutProjectsMenu.close(); @@ -162,52 +192,75 @@ class _ProjectSidebarState extends ConsumerState { !project.availability.canOpen) { return; } - if (widget.state.activeProject?.id != project.id) { - final opened = await ref - .read(projectsProvider.notifier) - .open(project.path, expectedId: project.id); - if (!opened || !mounted) return; + final navigation = _navigation.begin(project.id); + bool isCurrent() => mounted && navigation(); + try { + if (_projectState.activeProject?.id != project.id) { + final opened = await ref + .read(projectsProvider.notifier) + .open(project.path, expectedId: project.id, isCurrent: isCurrent); + if (!opened || !isCurrent()) return; + } + if (!isCurrent() || _projectState.activeProject?.id != project.id) return; + _newConversation(); + widget.onModeChanged(WorkspaceMode.agent); + _finishNavigation(); + } finally { + _navigation.finish(navigation); } - _newConversation(); - widget.onModeChanged(WorkspaceMode.agent); - _finishNavigation(); } Future _selectConversation(ConversationMetadata item) async { _cutProjectsMenu.close(); if (ref.read(projectsProvider).value?.projectBusy == true) return; - await _conversations.rememberSelection(item); - final currentProject = widget.state.activeProject?.id; - if (currentProject != item.projectId) { - final project = widget.state.recent - .where((entry) => entry.id == item.projectId) - .firstOrNull; - if (project == null || !project.availability.canOpen) return; - var opened = await ref - .read(projectsProvider.notifier) - .open( - project.path, - expectedId: project.id, - timelineId: item.timelineId, - ); - if (!opened) { - opened = await ref + final navigation = _navigation.begin( + item.projectId, + timelineId: item.timelineId, + ); + bool isCurrent() => mounted && navigation(); + try { + await _conversations.rememberSelection(item); + if (!isCurrent()) return; + final currentProject = _projectState.activeProject?.id; + if (currentProject != item.projectId) { + final project = _projectState.recent + .where((entry) => entry.id == item.projectId) + .firstOrNull; + if (project == null || !project.availability.canOpen) return; + var opened = await ref .read(projectsProvider.notifier) - .open(project.path, expectedId: project.id); + .open( + project.path, + expectedId: project.id, + timelineId: item.timelineId, + isCurrent: isCurrent, + ); + if (!isCurrent()) return; + if (!opened) { + _navigation.useProjectDefault(navigation); + opened = await ref + .read(projectsProvider.notifier) + .open(project.path, expectedId: project.id, isCurrent: isCurrent); + } + if (!opened) return; + } else if (_projectState.timeline?.id != item.timelineId && + _projectState.timelines.any( + (timeline) => timeline.id == item.timelineId, + )) { + final opened = await ref + .read(projectsProvider.notifier) + .openTimeline(item.projectId, item.timelineId); + if (!opened) return; } - if (!opened) return; - } else if (widget.state.timeline?.id != item.timelineId && - widget.state.timelines.any( - (timeline) => timeline.id == item.timelineId, - )) { - await ref - .read(projectsProvider.notifier) - .openTimeline(item.projectId, item.timelineId); + if (!isCurrent() || _projectState.activeProject?.id != item.projectId) { + return; + } + _conversations.activate(item); + widget.onModeChanged(WorkspaceMode.agent); + _finishNavigation(); + } finally { + _navigation.finish(navigation); } - if (!mounted || widget.state.activeProject?.id != item.projectId) return; - _conversations.activate(item); - widget.onModeChanged(WorkspaceMode.agent); - _finishNavigation(); } Future _renameConversation(ConversationMetadata item) async { @@ -254,7 +307,7 @@ class _ProjectSidebarState extends ConsumerState { ), ), ); - if (selected == null) return; + if (selected == null || !mounted) return; await _conversations.updateMetadata(item.copyWith(providerId: selected)); } @@ -266,16 +319,12 @@ class _ProjectSidebarState extends ConsumerState { .read(projectsProvider.notifier) .removeRecentProject(project.id); if (!removed || !mounted) return; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(context.l10n.projectRemoved), - action: SnackBarAction( - label: context.l10n.undo, - onPressed: () => ref - .read(projectsProvider.notifier) - .restoreRecentProject(project, index), - ), - ), + ErrorNotificationHost.of(context).showMessage( + content: Text(context.l10n.projectRemoved), + actionLabel: context.l10n.undo, + onAction: () => ref + .read(projectsProvider.notifier) + .restoreRecentProject(project, index), ); } @@ -325,7 +374,32 @@ class _ProjectSidebarState extends ConsumerState { ) == true; - Widget _conversationRow(ConversationMetadata item) => Consumer( + List _conversationActions(ConversationMetadata item) => [ + AppMenuItem( + label: context.l10n.rename, + onPressed: () => _renameConversation(item), + ), + AppMenuItem( + label: context.l10n.agentMoveToTrash, + onPressed: () => _trashConversation(item), + ), + AppMenuItem( + label: context.l10n.agentRelinkProvider, + onPressed: () => _relinkProvider(item), + ), + const AppMenuSeparator(), + AppMenuItem( + label: '${context.l10n.agentDeleteForever}…', + destructive: true, + onPressed: () => _deleteForever(item), + ), + ]; + + Widget _conversationRow( + ConversationMetadata item, { + VoidCallback? onSelected, + bool inMenu = false, + }) => Consumer( builder: (context, ref, _) { final active = ref.watch( projectsProvider.select( @@ -338,44 +412,40 @@ class _ProjectSidebarState extends ConsumerState { .select((value) => value.selectedId == item.id), ) && active; - List actions(BuildContext context) => [ - AppMenuItem( - label: context.l10n.rename, - onPressed: () => _renameConversation(item), - ), - AppMenuItem( - label: context.l10n.agentMoveToTrash, - onPressed: () => _trashConversation(item), - ), - AppMenuItem( - label: context.l10n.agentRelinkProvider, - onPressed: () => _relinkProvider(item), - ), - const AppMenuSeparator(), - AppMenuItem( - label: '${context.l10n.agentDeleteForever}…', - destructive: true, - onPressed: () => _deleteForever(item), - ), - ]; + if (inMenu) { + return AppContextMenu( + itemsBuilder: (_) => _conversationActions(item), + child: AppMenuItem( + key: ValueKey('sidebar-conversation-${item.id}'), + label: item.title, + selectOption: true, + selected: selected, + onPressed: onSelected ?? () => _selectConversation(item), + ), + ); + } if (_touch) { return TouchConversationTile( id: item.id, title: item.title, selected: selected, - onSelect: () => _selectConversation(item), - actions: actions, + onSelect: onSelected ?? () => _selectConversation(item), + actions: (_) => _conversationActions(item), ); } return Padding( padding: AppSidebarMetrics.rowPadding, child: AppContextMenu( - itemsBuilder: actions, + itemsBuilder: (_) => _conversationActions(item), child: Material( color: selected ? AppSidebarColors.of(context).hover : Colors.transparent, - borderRadius: BorderRadius.circular(AppSidebarMetrics.radius), + borderRadius: BorderRadius.circular( + AppTheme.isDesktop(context) + ? AppRadius.large + : AppSidebarMetrics.radius, + ), child: InkWell( key: ValueKey('sidebar-conversation-${item.id}'), hoverColor: selected @@ -383,28 +453,61 @@ class _ProjectSidebarState extends ConsumerState { : AppSidebarColors.of(context).hover, splashColor: Colors.transparent, highlightColor: Colors.transparent, - borderRadius: BorderRadius.circular(AppSidebarMetrics.radius), - onTap: () => _selectConversation(item), + borderRadius: BorderRadius.circular( + AppTheme.isDesktop(context) + ? AppRadius.large + : AppSidebarMetrics.radius, + ), + onTap: onSelected ?? () => _selectConversation(item), child: SizedBox( - height: AppSidebarMetrics.rowHeight, - child: Align( - alignment: AlignmentDirectional.centerStart, - child: Padding( - padding: const EdgeInsetsDirectional.only( - start: AppSidebarMetrics.textInset, - end: AppSidebarMetrics.cellPadding, - ), - child: Text( - item.title, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: AppSidebarTypography.style( - context, - fontSize: AppSidebarMetrics.conversationFontSize, - height: AppSidebarMetrics.conversationLineHeight, + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.sidebarRow + : AppSidebarMetrics.rowHeight, + child: Stack( + fit: StackFit.expand, + children: [ + if (selected && AppTheme.isDesktop(context)) + PositionedDirectional( + start: AppSidebarMetrics.cellPadding, + top: 8, + bottom: 8, + width: 2, + child: IgnorePointer( + child: DecoratedBox( + key: ValueKey( + 'sidebar-conversation-selection-${item.id}', + ), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.primary, + borderRadius: BorderRadius.circular(1), + ), + ), + ), + ), + Align( + alignment: AlignmentDirectional.centerStart, + child: Padding( + padding: const EdgeInsetsDirectional.only( + start: AppSidebarMetrics.textInset, + end: AppSidebarMetrics.cellPadding, + ), + child: Text( + item.title, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: AppSidebarTypography.style( + context, + fontSize: AppTheme.isDesktop(context) + ? 13 + : AppSidebarMetrics.conversationFontSize, + height: AppTheme.isDesktop(context) + ? 20 / 13 + : AppSidebarMetrics.conversationLineHeight, + ), + ), ), ), - ), + ], ), ), ), @@ -592,6 +695,130 @@ class _ProjectSidebarState extends ConsumerState { @override Widget build(BuildContext context) { + _navigation.update(_navigationContext(_projectState)); + ref.listen( + projectsProvider.select( + (value) => + value.value == null ? null : _navigationContext(value.requireValue), + ), + (_, next) { + if (next != null) _navigation.update(next); + }, + ); + if (widget.chatOnly) { + final snapshot = ref.watch(conversationSidebarProvider).value; + final projectId = widget.state.activeProject?.id; + final conversations = + snapshot?.groups[projectId] ?? const []; + final selectedId = ref.watch( + conversationSelectionProvider(projectId) + .select((value) => value.selectedId), + ); + final selected = conversations + .where((item) => item.id == selectedId) + .firstOrNull; + return Material( + key: const Key('project-chat-sidebar'), + color: Theme.of(context).colorScheme.surface, + child: Column( + children: [ + ChatHeader( + key: ValueKey(('chat-header', projectId)), + title: selected?.title ?? context.l10n.agentUntitledConversation, + busy: widget.state.projectBusy, + onNew: _newConversation, + panelActions: widget.chatPanelActions, + actions: selected == null + ? const [] + : _conversationActions(selected), + historyBuilder: (menuContext, close) => ChatHistoryMenu( + entries: [ + for (final item in conversations) + (id: item.id, title: item.title), + ], + selectedId: selectedId, + error: _conversationError, + onSelect: (id) { + close(); + _selectConversation( + conversations.firstWhere((item) => item.id == id), + ); + }, + itemBuilder: (_, id, onSelect) => _conversationRow( + conversations.firstWhere((item) => item.id == id), + onSelected: onSelect, + inMenu: true, + ), + footer: _trashed.isEmpty + ? null + : Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Divider(), + Padding( + padding: ChatHistoryMenu.sectionPadding, + child: Text( + context.l10n.agentTrash, + key: const Key('project-chat-trash-title'), + style: Theme.of(context).textTheme.bodySmall, + ), + ), + for (final item in _trashed) + Padding( + padding: const EdgeInsets.symmetric( + horizontal: ChatHistoryMenu.contentInset, + ), + child: SizedBox( + height: 28, + child: Row( + children: [ + Expanded( + child: Text( + item.title, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: AppTheme.toolbarTextStyle( + context, + ), + ), + ), + for (final restore in [true, false]) + IconButton( + tooltip: restore + ? context.l10n.agentRestore + : context.l10n.agentDeleteForever, + style: IconButton.styleFrom( + fixedSize: const Size.square(24), + minimumSize: const Size.square(24), + maximumSize: const Size.square(24), + padding: EdgeInsets.zero, + iconSize: 14, + tapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + onPressed: () => restore + ? _restoreConversation(item) + : _deleteForever(item), + icon: Icon( + restore + ? AppIcons.undo + : AppIcons.delete, + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + const Divider(height: 1), + Expanded(child: widget.agent), + ], + ), + ); + } final compact = MediaQuery.sizeOf(context).height < 520; final headerHeight = widget.externalWindowFrame ? 0.0 @@ -601,8 +828,12 @@ class _ProjectSidebarState extends ConsumerState { ? AppControlSize.panelHeader : AppControlSize.headerButton; final modeTop = headerHeight; - final modeHeader = SizedBox( - key: const Key('project-content-header'), + final legacyModeHeader = SizedBox( + key: Key( + !_touch && widget.navigationOnly + ? 'sidebar-window-header' + : 'project-content-header', + ), height: modeTop + (_touch ? AppSidebarMetrics.modeHeight : 0) + @@ -713,7 +944,7 @@ class _ProjectSidebarState extends ConsumerState { ), const SizedBox(width: AppSpacing.small), const Icon( - Icons.keyboard_arrow_down, + AppIcons.expandMore, size: AppSidebarMetrics.iconSize, ), ], @@ -725,13 +956,89 @@ class _ProjectSidebarState extends ConsumerState { ], ), ); + final sectionHeader = !_touch && widget.externalWindowFrame + ? SizedBox( + key: Key( + widget.navigationOnly + ? 'sidebar-projects-header' + : 'project-content-header', + ), + height: AppDesktopMetrics.panelHeader, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12), + child: Row( + children: [ + Icon( + widget.resourcesSelected + ? AppIcons.mediaLibrary + : AppIcons.folder, + size: 16, + ), + const SizedBox(width: 8), + Expanded( + child: Text( + key: !widget.resourcesSelected && !widget.librarySelected + ? const Key('projects-heading') + : null, + widget.resourcesSelected + ? context.l10n.materials + : widget.librarySelected + ? context.l10n.navigationLibrary + : context.l10n.projects, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.titleSmall, + ), + ), + if (!widget.resourcesSelected && !widget.librarySelected) + IconButton( + key: const Key('create-project'), + tooltip: context.l10n.newProject, + onPressed: widget.onCreateProject, + icon: const Icon(AppIcons.add, size: 16), + ), + ], + ), + ), + ) + : legacyModeHeader; + final modeHeader = !_touch && widget.navigationOnly + ? Column( + key: const Key('project-content-header'), + mainAxisSize: MainAxisSize.min, + children: [ + if (!widget.externalWindowFrame) legacyModeHeader, + if (widget.librarySelected) + SizedBox( + height: AppDesktopMetrics.panelHeader, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12), + child: Align( + alignment: AlignmentDirectional.centerStart, + child: Text(context.l10n.navigationLibrary), + ), + ), + ) + else + SidebarCategoryTabs( + mediaSelected: widget.resourcesSelected, + onSelected: widget.onResourcesSelected, + ), + if (widget.externalWindowFrame && + !widget.resourcesSelected && + !widget.librarySelected) + sectionHeader, + ], + ) + : sectionHeader; final projectList = SingleChildScrollView( key: const Key('sidebar-projects-conversations'), primary: false, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - if (widget.mode == WorkspaceMode.agent || widget.navigationOnly) + if ((widget.mode == WorkspaceMode.agent || widget.navigationOnly) && + (_touch || !widget.externalWindowFrame)) MouseRegion( onEnter: (_) => setState(() => _projectHeaderHovered = true), onExit: (_) => setState(() => _projectHeaderHovered = false), @@ -813,7 +1120,11 @@ class _ProjectSidebarState extends ConsumerState { onExpansionChanged: (value) => setState(() => _showTrash = value), trailing: _trashed.isEmpty - ? null + ? Icon( + _showTrash + ? AppIcons.expandLess + : AppIcons.expandMore, + ) : TextButton( onPressed: _emptyTrash, child: Text(context.l10n.agentEmptyTrash), @@ -838,28 +1149,25 @@ class _ProjectSidebarState extends ConsumerState { color: AppSidebarColors.of(context).secondary, ), ), - trailing: PopupMenuButton( - tooltip: context.l10n.agentConversationActions, - onSelected: (value) { - if (value == 'restore') { - _restoreConversation(item); - } - if (value == 'delete') _deleteForever(item); - }, - itemBuilder: (context) => [ - PopupMenuItem( - height: AppMenuMetrics.rowHeight, - value: 'restore', - child: Text(context.l10n.agentRestore), + trailing: AppDropdownMenu( + items: [ + AppMenuItem( + label: context.l10n.agentRestore, + onPressed: () => _restoreConversation(item), ), - PopupMenuItem( - height: AppMenuMetrics.rowHeight, - value: 'delete', - child: Text( - context.l10n.agentDeleteForever, - ), + AppMenuItem( + label: context.l10n.agentDeleteForever, + destructive: true, + onPressed: () => _deleteForever(item), ), ], + builder: (context, toggle, focus) => IconButton( + focusNode: focus, + onPressed: toggle, + icon: const Icon(AppIcons.more), + tooltip: + context.l10n.agentConversationActions, + ), ), ); }, @@ -883,20 +1191,38 @@ class _ProjectSidebarState extends ConsumerState { child: _touch ? projectList : IndexedStack( - index: widget.resourcesSelected ? 1 : 0, + index: widget.librarySelected + ? 2 + : widget.resourcesSelected + ? 1 + : 0, children: [ TickerMode( - enabled: !widget.resourcesSelected, + enabled: + !widget.resourcesSelected && + !widget.librarySelected, child: projectList, ), TickerMode( - enabled: widget.resourcesSelected, - child: _resourcesVisited - ? MediaPanel( - projectId: widget.state.activeProject?.id, - onSelectProject: widget.onSelectProject, - ) - : Center(child: Text(context.l10n.projectsNone)), + enabled: + widget.resourcesSelected && + !widget.librarySelected, + child: ExcludeFocus( + excluding: + !widget.resourcesSelected || + widget.librarySelected, + child: _resourcesVisited + ? MediaPanel( + projectId: widget.state.activeProject?.id, + onSelectProject: widget.onSelectProject, + ) + : Center( + child: Text(context.l10n.projectsNone), + ), + ), + ), + const SizedBox.expand( + key: Key('resource-library-empty'), ), ], ), @@ -924,7 +1250,6 @@ class _ProjectSidebarState extends ConsumerState { VerticalDivider( key: const Key('sidebar-chat-divider'), width: 1, - thickness: 1, color: AppTheme.sidebarDividerColor(context), ), Expanded( @@ -981,7 +1306,7 @@ class _ProjectSidebarState extends ConsumerState { onPressed: widget.onExpandEditor, padding: EdgeInsets.zero, icon: const Icon( - Icons.vertical_split_outlined, + AppIcons.splitVertical, size: AppIconSize.header, ), ), @@ -1122,7 +1447,9 @@ class _ProjectsHeader extends StatelessWidget { overflow: TextOverflow.ellipsis, style: AppSidebarTypography.style( context, - fontSize: AppSidebarMetrics.sectionFontSize, + fontSize: AppTheme.isDesktop(context) + ? 13 + : AppSidebarMetrics.sectionFontSize, weight: FontWeight.w500, color: AppSidebarColors.of(context).section, ), @@ -1131,7 +1458,7 @@ class _ProjectsHeader extends StatelessWidget { if (onPressed != null) ...[ const SizedBox(width: AppSpacing.tiny), Icon( - Icons.keyboard_arrow_down, + AppIcons.expandMore, size: AppSidebarMetrics.iconSize, color: AppSidebarColors.of(context).secondary, ), @@ -1152,7 +1479,7 @@ class _ProjectsHeader extends StatelessWidget { dimension: AppSidebarMetrics.actionSize, child: Center( child: Icon( - Icons.more_horiz, + AppIcons.more, size: AppSidebarMetrics.iconSize, color: AppSidebarColors.of(context).tertiary, ), @@ -1172,7 +1499,7 @@ class _ProjectsHeader extends StatelessWidget { tooltip: context.l10n.newProject, onPressed: onCreateProject, padding: EdgeInsets.zero, - icon: const Icon(Icons.add, size: AppSidebarMetrics.iconSize), + icon: const Icon(AppIcons.add, size: AppSidebarMetrics.iconSize), ), ), ), @@ -1187,6 +1514,38 @@ Color _sidebarItemHighlightColor(BuildContext context) => ButtonStyle sidebarActionButtonStyle(BuildContext context) => AppTheme.iconButtonStyle(context); +ButtonStyle _projectActionButtonStyle(BuildContext context) { + if (!AppTheme.isDesktop(context)) return sidebarActionButtonStyle(context); + final colors = AppSidebarColors.of(context); + final accent = Theme.of(context).colorScheme.primary; + return sidebarActionButtonStyle(context).copyWith( + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.disabled)) return colors.disabled; + if (states.contains(WidgetState.hovered) || + states.contains(WidgetState.focused) || + states.contains(WidgetState.pressed)) { + return accent; + } + return colors.secondary; + }), + backgroundColor: const WidgetStatePropertyAll(Colors.transparent), + overlayColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.disabled)) return Colors.transparent; + if (states.contains(WidgetState.pressed)) { + return accent.withValues(alpha: .16); + } + if (states.contains(WidgetState.hovered) || + states.contains(WidgetState.focused)) { + return accent.withValues(alpha: .10); + } + return Colors.transparent; + }), + shape: WidgetStatePropertyAll( + RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), + ), + ); +} + String _availabilityLabel( BuildContext context, ProjectAvailability availability, @@ -1228,7 +1587,7 @@ class _ProjectTile extends StatelessWidget { List _menuItems(BuildContext context) => [ AppMenuItem( label: context.l10n.rename, - icon: Icons.drive_file_rename_outline, + icon: AppIcons.rename, onPressed: project.availability.canOpen ? onRename : null, ), if (sidebarStyle) ...[ @@ -1248,14 +1607,20 @@ class _ProjectTile extends StatelessWidget { '${sidebarStyle ? 'sidebar-project' : 'open-project'}-${project.id}', ), minTileHeight: sidebarStyle - ? AppSidebarMetrics.rowHeight + ? (AppTheme.isDesktop(context) + ? AppDesktopMetrics.sidebarRow + : AppSidebarMetrics.rowHeight) : project.availability.canOpen ? 36 : 48, minVerticalPadding: 0, - contentPadding: EdgeInsets.symmetric( - horizontal: sidebarStyle ? 0 : AppSpacing.small, - ), + contentPadding: sidebarStyle + ? EdgeInsetsDirectional.only( + end: AppTheme.isDesktop(context) + ? AppSidebarMetrics.cellPadding + : 0, + ) + : const EdgeInsets.symmetric(horizontal: AppSpacing.small), horizontalTitleGap: sidebarStyle ? AppSidebarMetrics.iconGap : AppSpacing.small, @@ -1264,7 +1629,9 @@ class _ProjectTile extends StatelessWidget { titleAlignment: ListTileTitleAlignment.center, selected: active, selectedTileColor: sidebarStyle - ? Colors.transparent + ? AppTheme.isDesktop(context) + ? AppSidebarColors.of(context).hover + : Colors.transparent : _sidebarItemHighlightColor(context), textColor: project.availability.canOpen ? null @@ -1273,7 +1640,11 @@ class _ProjectTile extends StatelessWidget { ? null : Theme.of(context).disabledColor, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(AppRadius.extraLarge), + borderRadius: BorderRadius.circular( + sidebarStyle && AppTheme.isDesktop(context) + ? AppRadius.large + : AppRadius.extraLarge, + ), ), hoverColor: sidebarStyle ? AppSidebarColors.of(context).hover @@ -1283,7 +1654,9 @@ class _ProjectTile extends StatelessWidget { leading: sidebarStyle ? SizedBox( width: AppSidebarMetrics.iconSlotWidth, - height: AppSidebarMetrics.rowHeight, + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.sidebarRow + : AppSidebarMetrics.rowHeight, child: IconButton( key: ValueKey('sidebar-project-toggle-${project.id}'), tooltip: expanded @@ -1294,22 +1667,18 @@ class _ProjectTile extends StatelessWidget { onPressed: onToggleExpanded, icon: Icon( !project.availability.canOpen - ? Icons.folder_off_outlined + ? AppIcons.folderUnavailable : hovered - ? (expanded - ? Icons.keyboard_arrow_down - : Icons.chevron_right) - : (expanded - ? Icons.folder_open_outlined - : Icons.folder_outlined), + ? (expanded ? AppIcons.expandMore : AppIcons.chevronRight) + : (expanded ? AppIcons.folderOpen : AppIcons.folder), size: AppSidebarMetrics.iconSize, ), ), ) : Icon( project.availability.canOpen - ? Icons.folder_outlined - : Icons.folder_off_outlined, + ? AppIcons.folder + : AppIcons.folderUnavailable, size: 18, ), title: Text( @@ -1319,6 +1688,15 @@ class _ProjectTile extends StatelessWidget { style: sidebarStyle ? AppSidebarTypography.style( context, + fontSize: AppTheme.isDesktop(context) + ? 13 + : AppSidebarMetrics.fontSize, + height: AppTheme.isDesktop(context) + ? 20 / 13 + : AppSidebarMetrics.lineHeight, + weight: AppTheme.isDesktop(context) + ? FontWeight.w500 + : FontWeight.w400, color: project.availability.canOpen ? AppSidebarColors.of(context).primary : AppSidebarColors.of(context).disabled, @@ -1364,11 +1742,13 @@ class _ProjectTile extends StatelessWidget { builder: (context, toggle) => IconButton( key: ValueKey('sidebar-project-more-${project.id}'), onPressed: toggle, - style: sidebarActionButtonStyle(context), + style: _projectActionButtonStyle(context), padding: EdgeInsets.zero, - icon: const Icon( - Icons.more_horiz, - size: AppSidebarMetrics.iconSize, + icon: Icon( + AppIcons.more, + size: AppTheme.isDesktop(context) + ? 14 + : AppSidebarMetrics.iconSize, ), ), ), @@ -1380,11 +1760,13 @@ class _ProjectTile extends StatelessWidget { key: ValueKey('new-agent-conversation-${project.id}'), tooltip: context.l10n.agentNewConversation, onPressed: onNewConversation, - style: sidebarActionButtonStyle(context), + style: _projectActionButtonStyle(context), padding: EdgeInsets.zero, - icon: const Icon( - Icons.edit_square, - size: AppSidebarMetrics.iconSize, + icon: Icon( + AppIcons.edit, + size: AppTheme.isDesktop(context) + ? 14 + : AppSidebarMetrics.iconSize, ), ), ), diff --git a/lib/features/projects/project_switch_region.dart b/lib/features/projects/project_switch_region.dart index e1d7d4a..9ac28de 100644 --- a/lib/features/projects/project_switch_region.dart +++ b/lib/features/projects/project_switch_region.dart @@ -1,60 +1,19 @@ -import 'dart:async'; - import 'package:flutter/widgets.dart'; -/// Keeps the current content during short switches without delaying completion. -class ProjectSwitchRegion extends StatefulWidget { +/// Keeps prepared content mounted until the next project is published. +class ProjectSwitchRegion extends StatelessWidget { const ProjectSwitchRegion({ super.key, required this.pendingProjectId, - required this.builder, + required this.child, }); final String? pendingProjectId; - final Widget Function(BuildContext context, bool showDefaults) builder; - - @override - State createState() => _ProjectSwitchRegionState(); -} - -class _ProjectSwitchRegionState extends State { - Timer? _timer; - bool _showDefaults = false; - - @override - void initState() { - super.initState(); - _reset(); - } - - @override - void didUpdateWidget(covariant ProjectSwitchRegion oldWidget) { - super.didUpdateWidget(oldWidget); - if (oldWidget.pendingProjectId != widget.pendingProjectId) _reset(); - } - - void _reset() { - _timer?.cancel(); - _showDefaults = false; - if (widget.pendingProjectId != null) { - _timer = Timer(const Duration(milliseconds: 150), () { - if (mounted) setState(() => _showDefaults = true); - }); - } - } + final Widget child; @override Widget build(BuildContext context) => ExcludeFocus( - excluding: widget.pendingProjectId != null, - child: IgnorePointer( - ignoring: widget.pendingProjectId != null, - child: widget.builder(context, _showDefaults), - ), + excluding: pendingProjectId != null, + child: IgnorePointer(ignoring: pendingProjectId != null, child: child), ); - - @override - void dispose() { - _timer?.cancel(); - super.dispose(); - } } diff --git a/lib/features/projects/project_tabs_bar.dart b/lib/features/projects/project_tabs_bar.dart new file mode 100644 index 0000000..fa03fea --- /dev/null +++ b/lib/features/projects/project_tabs_bar.dart @@ -0,0 +1,434 @@ +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:cutdex_native/cutdex_native.dart'; + +import '../../l10n/l10n.dart'; +import '../../workspace/project_state.dart'; + +class ProjectTabsBar extends StatefulWidget { + const ProjectTabsBar({ + super.key, + required this.projects, + required this.recent, + required this.selectedId, + required this.onSelect, + required this.onClose, + required this.onCreate, + required this.onOpen, + required this.onRename, + this.onRemoveRecent, + this.projectMenuActions = const [], + this.leadingActions = const [], + this.trailingActions = const [], + }); + + final List projects; + final List recent; + final String? selectedId; + final ValueChanged onSelect; + final ValueChanged onClose; + final VoidCallback onCreate; + final VoidCallback onOpen; + final ValueChanged onRename; + final ValueChanged? onRemoveRecent; + final List projectMenuActions; + final List leadingActions; + final List trailingActions; + + @override + State createState() => _ProjectTabsBarState(); +} + +class _ProjectTabsBarState extends State { + final _tabKeys = {}; + final _addKey = GlobalKey(); + double? _availableWidth; + bool _active = true; + List get projects => widget.projects; + List get recent => widget.recent; + String? get selectedId => widget.selectedId; + ValueChanged get onSelect => widget.onSelect; + ValueChanged get onClose => widget.onClose; + VoidCallback get onCreate => widget.onCreate; + VoidCallback get onOpen => widget.onOpen; + ValueChanged get onRename => widget.onRename; + + void _revealSelection() { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!mounted || !_active) return; + final context = projects.lastOrNull?.id == selectedId + ? _addKey.currentContext + : _tabKeys[selectedId]?.currentContext; + if (context != null) { + Scrollable.ensureVisible( + context, + duration: const Duration(milliseconds: 150), + alignmentPolicy: ScrollPositionAlignmentPolicy.keepVisibleAtEnd, + ); + } + }); + } + + @override + void initState() { + super.initState(); + _revealSelection(); + } + + @override + void didUpdateWidget(covariant ProjectTabsBar oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.selectedId != selectedId || + oldWidget.projects.length != projects.length || + oldWidget.projects.any( + (project) => + projects.where((item) => item.id == project.id).firstOrNull != + project, + )) { + _revealSelection(); + } + final ids = projects.map((project) => project.id).toSet(); + _tabKeys.removeWhere((id, _) => !ids.contains(id)); + } + + @override + void deactivate() { + _active = false; + super.deactivate(); + } + + @override + void activate() { + super.activate(); + _active = true; + _revealSelection(); + } + + @override + Widget build(BuildContext context) => LayoutBuilder( + builder: (context, constraints) { + if (_availableWidth != constraints.maxWidth) { + _availableWidth = constraints.maxWidth; + _revealSelection(); + } + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: AppProjectTabMetrics.gap, + ), + child: Row( + key: const Key('window-project-tabs'), + children: [ + for (final action in widget.leadingActions) ...[ + HeaderControlRegion( + child: SizedBox.square( + dimension: AppProjectTabMetrics.height, + child: action, + ), + ), + const SizedBox(width: AppProjectTabMetrics.gap), + ], + AppDropdownMenu( + maxHeight: 400, + items: [ + AppMenuItem( + label: context.l10n.newProject, + icon: AppIcons.add, + onPressed: onCreate, + ), + AppMenuItem( + label: context.l10n.openProjectMore, + icon: AppIcons.folder, + onPressed: onOpen, + ), + if (recent.isNotEmpty) const AppMenuSeparator(), + for (final project in recent) + AppContextMenu( + itemsBuilder: (_) => [ + AppMenuItem( + label: context.l10n.rename, + icon: AppIcons.rename, + onPressed: !project.availability.canOpen + ? null + : () => onRename(project), + ), + if (widget.onRemoveRecent != null) + AppMenuItem( + label: context.l10n.removeProjectFromRecent, + onPressed: () => widget.onRemoveRecent!(project), + ), + ], + child: AppMenuItem( + key: ValueKey('project-menu-${project.id}'), + label: project.availability.canOpen + ? project.name + : '${project.name} · ${context.l10n.projectAccessFailed}', + icon: project.availability.canOpen + ? AppIcons.folder + : AppIcons.folderUnavailable, + selected: project.id == selectedId, + onPressed: () => onSelect(project), + ), + ), + if (widget.projectMenuActions.isNotEmpty) ...[ + const AppMenuSeparator(), + ...widget.projectMenuActions, + ], + ], + builder: (context, toggle, focusNode) => HeaderControlRegion( + child: IconButton( + key: const Key('project-tabs-projects'), + focusNode: focusNode, + tooltip: context.l10n.projects, + onPressed: toggle, + constraints: const BoxConstraints.tightFor( + width: AppProjectTabMetrics.height, + height: AppProjectTabMetrics.height, + ), + padding: EdgeInsets.zero, + iconSize: AppIconSize.small, + style: AppTheme.projectTabActionStyle(context), + icon: const Icon(AppIcons.home), + ), + ), + ), + const SizedBox(width: AppProjectTabMetrics.gap), + Expanded( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + for (var index = 0; index < projects.length; index++) ...[ + if (index > 0) + const SizedBox(width: AppProjectTabMetrics.gap), + _ProjectTab( + key: ValueKey(projects[index].id), + anchorKey: _tabKeys.putIfAbsent( + projects[index].id, + GlobalKey.new, + ), + project: projects[index], + selected: projects[index].id == selectedId, + maxWidth: + (constraints.maxWidth - + 5 * AppProjectTabMetrics.gap - + 3 * AppProjectTabMetrics.height - + (widget.leadingActions.length + + widget.trailingActions.length) * + (AppProjectTabMetrics.height + + AppProjectTabMetrics.gap)) + .clamp( + AppProjectTabMetrics.minWidth, + AppProjectTabMetrics.maxWidth, + ), + onSelect: () => onSelect(projects[index]), + onClose: () => onClose(projects[index]), + onRename: () => onRename(projects[index]), + ), + ], + if (projects.isNotEmpty) + const SizedBox(width: AppProjectTabMetrics.gap), + HeaderControlRegion( + key: _addKey, + child: IconButton( + key: const Key('project-tabs-add'), + tooltip: context.l10n.newProject, + onPressed: onCreate, + iconSize: 16, + style: AppTheme.projectTabActionStyle(context), + icon: const Icon(AppIcons.add), + ), + ), + ], + ), + ), + ), + const SizedBox(width: AppProjectTabMetrics.gap), + AppDropdownMenu( + enabled: projects.isNotEmpty, + maxHeight: 400, + items: [ + for (final project in projects) + AppMenuItem( + key: ValueKey('project-tabs-menu-${project.id}'), + label: project.name, + icon: AppIcons.folder, + selected: project.id == selectedId, + onPressed: () => onSelect(project), + ), + ], + builder: (context, toggle, focusNode) => HeaderControlRegion( + child: IconButton( + key: const Key('project-tabs-list'), + focusNode: focusNode, + tooltip: context.l10n.selectProject, + onPressed: toggle, + padding: EdgeInsets.zero, + iconSize: 14, + style: AppTheme.projectTabActionStyle(context), + icon: const Icon(AppIcons.expandMore), + ), + ), + ), + for (final action in widget.trailingActions) ...[ + const SizedBox(width: AppProjectTabMetrics.gap), + HeaderControlRegion( + child: SizedBox.square( + dimension: AppProjectTabMetrics.height, + child: action, + ), + ), + ], + ], + ), + ); + }, + ); +} + +class _ProjectTab extends StatefulWidget { + const _ProjectTab({ + super.key, + required this.anchorKey, + required this.project, + required this.selected, + required this.maxWidth, + required this.onSelect, + required this.onClose, + required this.onRename, + }); + final GlobalKey anchorKey; + final RecentProject project; + final bool selected; + final double maxWidth; + final VoidCallback onSelect, onClose, onRename; + @override + State<_ProjectTab> createState() => _ProjectTabState(); +} + +class _ProjectTabState extends State<_ProjectTab> { + bool _hovered = false; + bool _focused = false; + + @override + Widget build(BuildContext context) { + final project = widget.project; + final style = AppTheme.projectTabStyle(context, selected: widget.selected); + final states = { + if (_hovered) WidgetState.hovered, + if (_focused) WidgetState.focused, + }; + final showClose = widget.selected || _hovered || _focused; + return HeaderControlRegion( + child: MouseRegion( + onEnter: (_) => setState(() => _hovered = true), + onExit: (_) => setState(() => _hovered = false), + child: Focus( + canRequestFocus: false, + onFocusChange: (value) => setState(() => _focused = value), + child: AppContextMenu( + itemsBuilder: (_) => [ + AppMenuItem( + label: context.l10n.rename, + onPressed: widget.onRename, + ), + AppMenuItem( + label: MaterialLocalizations.of(context).closeButtonTooltip, + onPressed: widget.onClose, + ), + ], + child: Semantics( + selected: widget.selected, + child: Material( + key: widget.anchorKey, + color: style.backgroundColor!.resolve(states), + borderRadius: BorderRadius.circular( + AppProjectTabMetrics.radius, + ), + child: ConstrainedBox( + key: ValueKey('project-tab-surface-${project.id}'), + constraints: BoxConstraints( + minWidth: AppProjectTabMetrics.minWidth, + maxWidth: widget.maxWidth, + ), + child: IntrinsicWidth( + child: SizedBox( + height: AppProjectTabMetrics.height, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: Tooltip( + message: '${project.name}\n${project.path}', + child: TextButton( + key: ValueKey('project-tab-${project.id}'), + onPressed: widget.onSelect, + style: style.copyWith( + alignment: Alignment.centerLeft, + backgroundColor: const WidgetStatePropertyAll( + Colors.transparent, + ), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Icon(AppIcons.folder, size: 14), + const SizedBox(width: 6), + Flexible( + child: Text( + project.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ), + ), + ), + ExcludeFocus( + excluding: !showClose, + child: IgnorePointer( + ignoring: !showClose, + child: ExcludeSemantics( + excluding: !showClose, + child: Opacity( + opacity: showClose ? 1 : 0, + child: IconButton( + key: ValueKey( + 'project-tab-close-${project.id}', + ), + tooltip: MaterialLocalizations.of(context) + .closeButtonTooltip, + onPressed: widget.onClose, + constraints: const BoxConstraints.tightFor( + width: AppProjectTabMetrics.close, + height: AppProjectTabMetrics.close, + ), + padding: EdgeInsets.zero, + iconSize: 12, + style: AppTheme.projectTabActionStyle( + context, + size: AppProjectTabMetrics.close, + ), + icon: const Icon(AppIcons.close), + ), + ), + ), + ), + ), + const SizedBox(width: 4), + ], + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/features/projects/project_tabs_bar_previews.dart b/lib/features/projects/project_tabs_bar_previews.dart new file mode 100644 index 0000000..321606a --- /dev/null +++ b/lib/features/projects/project_tabs_bar_previews.dart @@ -0,0 +1,77 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../../l10n/app_localizations.dart'; +import '../../workspace/project_state.dart'; +import 'project_tabs_bar.dart'; + +@Preview( + name: 'Rounded project tabs — dark', + group: 'Desktop navigation', + size: Size(720, 44), +) +Widget projectTabsDarkPreview() => _preview(Brightness.dark); + +@Preview( + name: 'Rounded project tabs — light, narrow', + group: 'Desktop navigation', + size: Size(320, 44), +) +Widget projectTabsLightPreview() => _preview(Brightness.light); + +@Preview( + name: 'Rounded project tabs — dark, compact', + group: 'Desktop navigation', + size: Size(240, 44), +) +Widget projectTabsCompactPreview() => _preview(Brightness.dark); + +Widget _preview(Brightness brightness) { + const projects = [ + RecentProject(id: 'travel', name: '旅行短片', path: '/Projects/Travel.cutdex'), + RecentProject( + id: 'product', + name: '产品介绍', + path: '/Projects/Product.cutdex', + ), + RecentProject(id: 'city', name: '城市漫步', path: '/Projects/City.cutdex'), + ]; + var opened = projects.take(2).toList(); + var selected = 'travel'; + 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) => ColoredBox( + color: Theme.of(context).colorScheme.surfaceContainer, + child: ProjectTabsBar( + projects: opened, + recent: projects, + selectedId: selected, + onSelect: (project) => setState(() { + selected = project.id; + if (!opened.contains(project)) { + opened = [...opened, project]; + } + }), + onClose: (project) => setState(() { + opened = opened.where((item) => item.id != project.id).toList(); + if (selected == project.id) { + selected = opened.firstOrNull?.id ?? ''; + } + }), + onCreate: () {}, + onOpen: () {}, + onRename: (_) {}, + ), + ), + ), + ), + ); +} diff --git a/lib/features/projects/project_tabs_controller.dart b/lib/features/projects/project_tabs_controller.dart new file mode 100644 index 0000000..00546da --- /dev/null +++ b/lib/features/projects/project_tabs_controller.dart @@ -0,0 +1,52 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../shared/widgets/presentation_list.dart'; +import '../../workspace/project_state.dart'; +import '../../workspace/projects.dart'; + +final projectTabsProvider = + NotifierProvider>( + ProjectTabsController.new, + ); + +/// Open tabs are separate from the recent-project history. +class ProjectTabsController extends Notifier> { + @override + List build() { + ref.listen( + projectsProvider.select( + (value) => ( + value.value?.activeProject, + PresentationList(value.value?.recent ?? const []), + ), + ), + (_, next) { + final (active, recent) = next; + final metadata = {for (final project in recent) project.id: project}; + if (active != null) metadata[active.id] = active; + final updated = [ + for (final project in state) metadata[project.id] ?? project, + if (active != null && !state.any((tab) => tab.id == active.id)) + active, + ]; + if (!listEquals(state, updated)) state = List.unmodifiable(updated); + }, + ); + final active = ref.read(projectsProvider).value?.activeProject; + return List.unmodifiable([?active]); + } + + void remove(String id) => state = List.unmodifiable([ + for (final tab in state) + if (tab.id != id) tab, + ]); + + void updateProject(RecentProject project) { + final updated = [ + for (final tab in state) + if (tab.id == project.id) project else tab, + ]; + if (!listEquals(state, updated)) state = List.unmodifiable(updated); + } +} diff --git a/lib/features/projects/projects_page.dart b/lib/features/projects/projects_page.dart index fb03e7d..ac45c68 100644 --- a/lib/features/projects/projects_page.dart +++ b/lib/features/projects/projects_page.dart @@ -1,3 +1,6 @@ +import '../../shared/widgets/presentation_list.dart'; +import '../assistant/agent_panel_presentation.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import 'package:cutdex/errors/app_failure.dart'; @@ -23,6 +26,8 @@ import 'package:cutdex_native/cutdex_native.dart'; import '../../persistence/app_settings_repositories.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/widgets.dart'; import 'package:cutdex_ui/theme.dart'; import '../../workspace/project_state.dart'; @@ -38,6 +43,8 @@ import '../settings/settings_page.dart'; import 'editor_loading_region.dart'; import 'project_switch_region.dart'; import 'project_sidebar.dart'; +import 'project_tabs_bar.dart'; +import 'project_tabs_controller.dart'; import 'widgets/name_dialog.dart'; /// The single application surface: project navigation beside the editor. @@ -90,13 +97,26 @@ class _EditingPageState extends ConsumerState { WidgetRef ref, { required bool create, }) async { - if (ref.read(projectsProvider).value?.projectBusy == true) return; + if (_switchingProject || + ref.read(projectsProvider).value?.projectBusy == true) { + return; + } + FocusManager.instance.primaryFocus?.unfocus(); try { if (create) { final name = await askName( context, title: context.l10n.newProject, label: context.l10n.projectName, + validateName: (name) async { + final failure = await ref + .read(projectsProvider.notifier) + .validateNewProjectName(name); + if (!context.mounted) return null; + return failure == null + ? null + : context.l10n.failureMessage(failure); + }, ); if (name == null || !context.mounted) return; final created = await ref @@ -130,15 +150,50 @@ class _EditingPageState extends ConsumerState { } } - Future _openProject(WidgetRef ref, RecentProject project) => - ref.read(workspaceNavigationProvider.notifier).openProject(project); + Future _openProject(WidgetRef ref, RecentProject project) { + FocusManager.instance.primaryFocus?.unfocus(); + return ref.read(workspaceNavigationProvider.notifier).openProject(project); + } + + Future _closeProjectTab(RecentProject project) async { + if (_switchingProject || + ref.read(projectsProvider).value?.projectBusy == true) { + return; + } + FocusManager.instance.primaryFocus?.unfocus(); + final tabs = ref.read(projectTabsProvider); + if (ref.read(projectsProvider).value?.activeProject?.id == project.id) { + final index = tabs.indexWhere((tab) => tab.id == project.id); + final neighbors = [ + ...tabs.skip(index + 1), + ...tabs.take(index).toList().reversed, + ]; + final next = neighbors.firstOrNull; + if (next != null) { + await _openProject(ref, next); + if (!mounted || + ref.read(projectsProvider).value?.activeProject?.id != next.id) { + return; + } + } else { + final closed = await ref + .read(projectsProvider.notifier) + .closeActiveProject(); + if (!closed || !mounted) return; + } + } + if (mounted) ref.read(projectTabsProvider.notifier).remove(project.id); + } Future _renameProject( BuildContext context, WidgetRef ref, RecentProject project, ) async { - if (ref.read(projectsProvider).value?.projectBusy == true) return false; + if (_switchingProject || + ref.read(projectsProvider).value?.projectBusy == true) { + return false; + } final name = await askName( context, title: context.l10n.rename, @@ -147,7 +202,35 @@ class _EditingPageState extends ConsumerState { submitLabel: context.l10n.rename, ); if (name == null || !context.mounted || name == project.name) return false; - return ref.read(projectsProvider.notifier).renameProject(project, name); + final renamed = await ref + .read(projectsProvider.notifier) + .renameProject(project, name); + if (renamed && mounted) { + ref + .read(projectTabsProvider.notifier) + .updateProject(project.copyWith(name: name.trim())); + } + return renamed; + } + + Future _removeRecentProject(RecentProject project) async { + if (_switchingProject || + ref.read(projectsProvider).value?.projectBusy == true) { + return; + } + final recent = ref.read(projectsProvider).value?.recent ?? const []; + final index = recent.indexWhere((item) => item.id == project.id); + final removed = await ref + .read(projectsProvider.notifier) + .removeRecentProject(project.id); + if (!removed || !mounted) return; + ErrorNotificationHost.of(context).showMessage( + content: Text(context.l10n.projectRemoved), + actionLabel: context.l10n.undo, + onAction: () => ref + .read(projectsProvider.notifier) + .restoreRecentProject(project, index), + ); } Future _relocateProject( @@ -155,7 +238,10 @@ class _EditingPageState extends ConsumerState { WidgetRef ref, RecentProject project, ) async { - if (ref.read(projectsProvider).value?.projectBusy == true) return; + if (_switchingProject || + ref.read(projectsProvider).value?.projectBusy == true) { + return; + } final directory = await ref .read(filePickerProvider) .pickDirectory(confirmButtonText: context.l10n.openProject); @@ -183,7 +269,30 @@ class _EditingPageState extends ConsumerState { final experience = ref.watch(deviceExperienceProvider); final desktop = experience == DeviceExperience.desktop; final contentSelection = ref.watch(desktopContentProvider); - final projects = ref.watch(projectsProvider); + final openProjects = ref.watch(projectTabsProvider); + // Window/navigation subscribe to chrome only. Content owns live values. + ref.watch( + projectsProvider.select((value) { + final state = value.value; + return ( + value.isLoading, + value.error, + state?.activeProject, + PresentationList(state?.recent ?? const []), + state?.timeline?.id, + state?.projectBusy, + state?.openingTimelineId, + state?.error, + PresentationList( + state?.timelines.map( + (timeline) => (timeline.id, timeline.name, timeline.pinned), + ) ?? + const <(String, String, bool)>[], + ), + ); + }), + ); + final projects = ref.read(projectsProvider); final state = projects.value ?? const ProjectState(); return EditorWindowChrome( headerHeight: desktop ? DesktopWindowFrame.headerHeight : 48, @@ -210,6 +319,42 @@ class _EditingPageState extends ConsumerState { ); final navigationCollapsed = _sidebarCollapsed || navigationHiddenBySpace; + void toggleSidebar() { + if (desktop && _desktopSplits.agentFloating) { + _desktopSplits.setAgentFloating(false); + _sidebarCollapsed = false; + _saveViewState(); + if (navigationHiddenBySpace) { + _desktopScaffoldKey.currentState + ?.openDrawer(); + } + } else if (navigationHiddenBySpace) { + final scaffold = + _desktopScaffoldKey.currentState; + if (scaffold?.isDrawerOpen == true) { + scaffold?.closeDrawer(); + } else { + scaffold?.openDrawer(); + } + } else { + _sidebarCollapsed = !_sidebarCollapsed; + _saveViewState(); + } + } + + void toggleAgentFloating() { + final floating = !_desktopSplits.agentFloating; + if (floating) { + _desktopScaffoldKey.currentState?.closeDrawer(); + _sidebarCollapsed = false; + _saveViewState(); + } + _desktopSplits.setAgentFloating(floating); + if (!floating && navigationHiddenBySpace) { + _desktopScaffoldKey.currentState?.openDrawer(); + } + } + Widget controlSlot(Widget child) { if (!desktop) { return SizedBox.square( @@ -263,9 +408,7 @@ class _EditingPageState extends ConsumerState { child: Padding( padding: EdgeInsets.only( left: desktop - ? (DesktopWindowFrame.railWidth - - AppControlSize.headerButton) / - 2 + ? DesktopWindowFrame.headerInset : 0, ), child: Row( @@ -281,21 +424,12 @@ class _EditingPageState extends ConsumerState { tooltip: navigationCollapsed ? context.l10n.expandSidebar : context.l10n.collapseSidebar, - onPressed: () { - if (navigationHiddenBySpace) { - _desktopScaffoldKey.currentState - ?.openDrawer(); - } else { - _sidebarCollapsed = - !_sidebarCollapsed; - _saveViewState(); - } - }, + onPressed: toggleSidebar, style: sidebarActionButtonStyle( context, ), icon: const Icon( - Icons.view_sidebar_outlined, + AppIcons.sidebar, size: AppIconSize.header, ), ), @@ -316,7 +450,7 @@ class _EditingPageState extends ConsumerState { context, ), icon: const Icon( - Icons.settings_outlined, + AppIcons.settings, size: AppIconSize.header, ), ), @@ -349,6 +483,7 @@ class _EditingPageState extends ConsumerState { final agent = WorkspaceAgentSurface( key: _agentKey, + showProjectSelector: !desktop, state: state, onSelectProject: (project) => project.availability.canOpen @@ -357,14 +492,10 @@ class _EditingPageState extends ConsumerState { onCreateProject: () => _selectProject(context, ref, create: true), ); - void selectSidebar(bool resources) { + void selectSidebar(DesktopContent surface) { ref .read(desktopContentProvider.notifier) - .select( - resources - ? DesktopContent.library - : DesktopContent.workspace, - ); + .select(surface); setState(() => _sidebarCollapsed = false); _saveViewState(); if (navigationHiddenBySpace) { @@ -384,15 +515,23 @@ class _EditingPageState extends ConsumerState { VoidCallback? expandEditor, bool drawer = false, }) => ProjectSidebar( + chatOnly: desktop, experience: experience, + librarySelected: + desktop && contentSelection.librarySelected, resourcesSelected: desktop && contentSelection.resourcesSelected, + onResourcesSelected: desktop + ? (media) => selectSidebar( + media + ? DesktopContent.library + : DesktopContent.workspace, + ) + : null, key: drawer ? _drawerNavigationKey : _navigationKey, - agent: desktop && !drawer - ? agent - : const SizedBox.shrink(), + agent: desktop ? agent : const SizedBox.shrink(), navigationOnly: true, onNavigationComplete: desktop && !drawer ? null @@ -431,70 +570,66 @@ class _EditingPageState extends ConsumerState { onPressed: () => Scaffold.of(context) .closeDrawer(), - icon: const Icon(Icons.close), + icon: const Icon(AppIcons.close), ), ), ], ), ), ); - final pendingProject = _switchingProject - ? state.recent + final selectedProjectId = + _selectedProjectId ?? state.activeProject?.id; + final pendingProject = _selectedProjectId == null + ? null + : state.recent .where( - (item) => item.id == _selectedProjectId, + (item) => item.id == selectedProjectId, ) - .firstOrNull - : null; - final projectLoading = - pendingProject != null && - pendingProject.id != state.activeProject?.id; + .firstOrNull; + final visibleProjects = [ + ...openProjects, + if (pendingProject != null && + !openProjects.any( + (item) => item.id == pendingProject.id, + )) + pendingProject, + ]; final editor = ProjectSwitchRegion( - pendingProjectId: projectLoading - ? pendingProject.id + pendingProjectId: + selectedProjectId != state.activeProject?.id + ? _selectedProjectId : null, - builder: (context, showDefaults) { - final displayDefaults = - projectLoading && showDefaults; - final visibleProject = displayDefaults - ? pendingProject - : state.activeProject; - return visibleProject != null && - (displayDefaults || - state.timeline != null) - ? EditorWorkspace( - key: _editorKey, - experience: experience, - projectId: visibleProject.id, - timelineId: displayDefaults - ? '' - : state.visibleTimelineId!, - projectName: visibleProject.name, - projectLoading: displayDefaults, - timelineLoading: - state.openingTimelineId != null, - showProjectName: - desktop && - _mode == WorkspaceMode.cut, - integratedTitlebar: false, - headerLeading: desktop - ? const SizedBox.shrink() - : const SizedBox( - width: AppSpacing.compact, - ), - ) - : EmptyEditor( - desktop: desktop, - state: state, - showProjectName: - desktop && - _mode == WorkspaceMode.cut, - headerLeading: desktop - ? const SizedBox.shrink() - : const SizedBox( - width: AppSpacing.compact, - ), - ); - }, + child: + state.activeProject != null && + state.timeline != null + ? EditorWorkspace( + key: _editorKey, + experience: experience, + projectId: state.activeProject!.id, + timelineId: state.timeline!.id, + projectName: state.activeProject!.name, + timelineLoading: + state.openingTimelineId != null, + showProjectName: false, + integratedTitlebar: false, + headerLeading: desktop + ? const SizedBox.shrink() + : const SizedBox( + width: AppSpacing.compact, + ), + ) + : EmptyEditor( + experience: experience, + desktop: desktop, + state: state, + showProjectName: + desktop && _mode == WorkspaceMode.cut, + headerLeading: desktop + ? const SizedBox.shrink() + : const SizedBox( + width: AppSpacing.compact, + ), + ), ); Widget contentSurface( DesktopContent surface, @@ -534,6 +669,12 @@ class _EditingPageState extends ConsumerState { ), child: SettingsContent( cardLayout: true, + onBack: () => ref + .read( + desktopContentProvider + .notifier, + ) + .closeSettings(), initialTab: contentSelection.settingsTab, navigationRequest: contentSelection @@ -549,22 +690,105 @@ class _EditingPageState extends ConsumerState { return switch (experience) { DeviceExperience.desktop => DesktopWindowFrame( integratedTitlebar: integrated, - headerControls: controls(), - librarySelected: + headerControls: const SizedBox.shrink(), + projectTabs: ListenableBuilder( + listenable: _desktopSplits, + builder: (context, _) => ProjectTabsBar( + projects: visibleProjects, + recent: state.recent, + selectedId: selectedProjectId, + onSelect: (project) { + ref + .read(desktopContentProvider.notifier) + .select(DesktopContent.workspace); + selectProject(project); + }, + onClose: _closeProjectTab, + onCreate: () => _selectProject( + context, + ref, + create: true, + ), + onOpen: () => _selectProject( + context, + ref, + create: false, + ), + onRename: (project) => + _renameProject(context, ref, project), + onRemoveRecent: _removeRecentProject, + leadingActions: [ + IconButton( + key: const Key( + 'project-sidebar-toggle', + ), + tooltip: + navigationCollapsed || + _desktopSplits.agentFloating + ? context.l10n.expandSidebar + : context.l10n.collapseSidebar, + onPressed: toggleSidebar, + style: AppTheme.projectTabActionStyle( + context, + ), + icon: const Icon( + AppIcons.sidebar, + size: 16, + ), + ), + ], + trailingActions: [ + IconButton( + key: const Key('agent-minimize-button'), + tooltip: _desktopSplits.agentFloating + ? context.l10n.agentDock + : context.l10n.agentMinimize, + onPressed: toggleAgentFloating, + isSelected: + _desktopSplits.agentFloating, + style: AppTheme.projectTabActionStyle( + context, + ), + icon: const Icon( + AppIcons.fullscreen, + size: 16, + ), + ), + const BackgroundTasksButton( + iconSize: 16, + alignment: + AlignmentDirectional.bottomEnd, + ), + ], + projectMenuActions: [ + AppMenuItem( + key: const Key( + 'project-settings-button', + ), + label: context.l10n.settings, + icon: AppIcons.settings, + onPressed: () => + showSettingsPage(context), + ), + ], + ), + ), + resourceLibrarySelected: contentSelection.surface == - DesktopContent.library, + DesktopContent.resourceLibrary, + onResourceLibraryPressed: () => selectSidebar( + DesktopContent.resourceLibrary, + ), settingsSelected: contentSelection.surface == DesktopContent.settings, - onModeChanged: (mode) { - selectSidebar(false); - _setMode(mode); - }, - onLibraryPressed: () => selectSidebar(true), + onHomePressed: () => + selectSidebar(DesktopContent.workspace), onSettingsPressed: () => showSettingsPage(context), child: desktopContents( DesktopWorkspaceShell( + projectTabsLayout: true, controller: _desktopSplits, scaffoldKey: _desktopScaffoldKey, navigationDrawer: navigation(drawer: true), @@ -584,63 +808,90 @@ class _EditingPageState extends ConsumerState { geometry: geometry, expandEditor: expand, ), - agentBuilder: (geometry, expand) => Column( - children: [ - SizedBox( - key: const Key( - 'agent-content-header', - ), - height: AppControlSize.panelToolbar, - child: Padding( - padding: const EdgeInsets.all( - AppSpacing.gap, - ), - child: Row( - children: [ - const Spacer(), - HeaderControlRegion( - child: SizedBox.square( - dimension: AppControlSize - .headerButton, - child: IconButton( - key: const Key( - 'agent-fullscreen-button', + agentBuilder: (geometry, expand) => + _desktopSplits.agentFloating + ? AgentPanelPresentation( + compact: true, + expanded: _desktopSplits + .agentFloatingExpanded, + onToggleExpanded: _desktopSplits + .toggleFloatingConversation, + onDock: () => _desktopSplits + .setAgentFloating(false), + child: agent, + ) + : Column( + children: [ + SizedBox( + key: const Key( + 'agent-content-header', + ), + height: AppDesktopMetrics + .panelHeader, + child: Padding( + padding: + const EdgeInsets.symmetric( + horizontal: 12, ), - isSelected: - geometry.editorHidden, - tooltip: - geometry.editorHidden - ? context - .l10n - .exitPreviewFullscreen - : context - .l10n - .agentFullscreen, - onPressed: - geometry.editorHidden - ? expand - : () => _desktopSplits - .setAgentFullscreen( - true, - ), - icon: Icon( - size: - AppIconSize.header, - geometry.editorHidden - ? Icons - .fullscreen_exit - : Icons.fullscreen, + child: Row( + children: [ + const Icon( + AppIcons.chat, + size: 16, ), - ), + const SizedBox(width: 8), + Expanded( + child: Text( + context + .l10n + .workspaceAgent, + maxLines: 1, + overflow: TextOverflow + .ellipsis, + ), + ), + HeaderControlRegion( + child: IconButton( + key: const Key( + 'agent-fullscreen-button', + ), + isSelected: + _desktopSplits + .agentFullscreen, + tooltip: + geometry + .editorHidden + ? context + .l10n + .expandEditor + : context + .l10n + .agentFullscreen, + onPressed: + geometry + .editorHidden + ? expand + : () => _desktopSplits + .setAgentFullscreen( + true, + ), + icon: Icon( + geometry.editorHidden + ? AppIcons + .splitVertical + : AppIcons + .fullscreen, + size: 16, + ), + ), + ), + ], ), ), - ], - ), + ), + Expanded(child: agent), + ], ), - ), - Expanded(child: agent), - ], - ), editor: editor, ), ), diff --git a/lib/features/projects/sidebar_category_tabs.dart b/lib/features/projects/sidebar_category_tabs.dart new file mode 100644 index 0000000..ec575fd --- /dev/null +++ b/lib/features/projects/sidebar_category_tabs.dart @@ -0,0 +1,66 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; + +import '../../l10n/l10n.dart'; + +/// Desktop sidebar categories change navigation content, not workspace layout. +class SidebarCategoryTabs extends StatelessWidget { + const SidebarCategoryTabs({ + super.key, + required this.mediaSelected, + required this.onSelected, + }); + + final bool mediaSelected; + final ValueChanged? onSelected; + + @override + Widget build(BuildContext context) => SizedBox( + key: const Key('sidebar-category-header'), + height: AppDesktopMetrics.panelHeader, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), + child: Row( + children: [ + for (final media in [false, true]) ...[ + if (media) const SizedBox(width: 4), + Expanded( + child: Semantics( + selected: mediaSelected == media, + child: Tooltip( + message: media + ? context.l10n.materials + : context.l10n.navigationChat, + child: TextButton( + key: Key( + media ? 'sidebar-tab-resources' : 'sidebar-tab-chat', + ), + onPressed: onSelected == null + ? null + : () => onSelected!(media), + style: + AppTheme.panelTabStyle( + context, + selected: mediaSelected == media, + ).copyWith( + padding: const WidgetStatePropertyAll( + EdgeInsets.symmetric(horizontal: 6), + ), + ), + child: Text( + media + ? context.l10n.materials + : context.l10n.navigationChat, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ), + ), + ), + ], + ], + ), + ), + ); +} diff --git a/lib/features/projects/sidebar_category_tabs_previews.dart b/lib/features/projects/sidebar_category_tabs_previews.dart new file mode 100644 index 0000000..5cbb06f --- /dev/null +++ b/lib/features/projects/sidebar_category_tabs_previews.dart @@ -0,0 +1,40 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../../l10n/app_localizations.dart'; +import 'sidebar_category_tabs.dart'; + +@Preview( + name: 'Sidebar categories — light', + group: 'Desktop navigation', + size: Size(280, 36), +) +Widget sidebarCategoriesLightPreview() => _preview(Brightness.light); + +@Preview( + name: 'Sidebar categories — dark', + group: 'Desktop navigation', + size: Size(180, 36), +) +Widget sidebarCategoriesDarkPreview() => _preview(Brightness.dark); + +Widget _preview(Brightness brightness) { + var media = false; + 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) => SidebarCategoryTabs( + mediaSelected: media, + onSelected: (value) => setState(() => media = value), + ), + ), + ), + ); +} diff --git a/lib/features/projects/sidebar_navigation_controller.dart b/lib/features/projects/sidebar_navigation_controller.dart new file mode 100644 index 0000000..31e88ba --- /dev/null +++ b/lib/features/projects/sidebar_navigation_controller.dart @@ -0,0 +1,45 @@ +import '../../shared/state/operation_scope.dart'; + +typedef SidebarNavigationContext = ({String? projectId, String? timelineId}); + +/// Owns navigation intent while allowing the context changes it requested. +class SidebarNavigationController { + SidebarNavigationController(this._context); + + SidebarNavigationContext _context; + SidebarNavigationContext? _target; + final _operations = OperationScope(null); + + bool Function() begin(String projectId, {String? timelineId}) { + _target = (projectId: projectId, timelineId: timelineId); + return _operations.begin(); + } + + void update(SidebarNavigationContext context) { + if (_context == context) return; + _context = context; + final target = _target; + if (target == null || + context.projectId != target.projectId || + (target.timelineId != null && + context.timelineId != target.timelineId)) { + cancel(); + } + } + + void finish(bool Function() isCurrent) { + if (isCurrent()) _target = null; + } + + void useProjectDefault(bool Function() isCurrent) { + if (!isCurrent() || _target == null) return; + _target = (projectId: _target!.projectId, timelineId: null); + } + + void cancel() { + _target = null; + _operations.invalidate(); + } + + void dispose() => _operations.dispose(); +} diff --git a/lib/features/projects/touch_project_navigation.dart b/lib/features/projects/touch_project_navigation.dart index 5b0dec0..1df3685 100644 --- a/lib/features/projects/touch_project_navigation.dart +++ b/lib/features/projects/touch_project_navigation.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../../l10n/l10n.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/widgets.dart'; import '../../workspace/project_state.dart'; @@ -20,7 +21,7 @@ class TouchProjectsHeader extends StatelessWidget { key: const Key('create-project'), tooltip: context.l10n.newProject, onPressed: onCreate, - icon: const Icon(Icons.add), + icon: const Icon(AppIcons.add), ), ), ], @@ -64,7 +65,7 @@ class TouchProjectTile extends StatelessWidget { ? context.l10n.collapseProject : context.l10n.expandProject, onPressed: onToggle, - icon: Icon(expanded ? Icons.expand_more : Icons.chevron_right), + icon: Icon(expanded ? AppIcons.expandMore : AppIcons.chevronRight), ), title: Text(project.name, maxLines: 1, overflow: TextOverflow.ellipsis), subtitle: project.availability.canOpen ? null : Text(availabilityLabel), @@ -76,7 +77,7 @@ class TouchProjectTile extends StatelessWidget { constraints: const BoxConstraints.tightFor(width: 48, height: 48), tooltip: context.l10n.agentNewConversation, onPressed: onNewConversation, - icon: const Icon(Icons.edit_square), + icon: const Icon(AppIcons.edit), ), AppPopover( child: Column( @@ -93,7 +94,7 @@ class TouchProjectTile extends StatelessWidget { key: ValueKey('sidebar-project-more-${project.id}'), constraints: const BoxConstraints.tightFor(width: 48, height: 48), onPressed: toggle, - icon: const Icon(Icons.more_horiz), + icon: const Icon(AppIcons.more), ), ), ], @@ -130,7 +131,7 @@ class TouchConversationTile extends StatelessWidget { key: ValueKey('sidebar-conversation-more-$id'), constraints: const BoxConstraints.tightFor(width: 48, height: 48), onPressed: toggle, - icon: const Icon(Icons.more_horiz), + icon: const Icon(AppIcons.more), ), ), ); diff --git a/lib/features/projects/widgets/name_dialog.dart b/lib/features/projects/widgets/name_dialog.dart index 03498c2..fc642c7 100644 --- a/lib/features/projects/widgets/name_dialog.dart +++ b/lib/features/projects/widgets/name_dialog.dart @@ -11,6 +11,7 @@ Future askName( String? description, String initialValue = '', String? submitLabel, + Future Function(String name)? validateName, }) => showAppDialog( context: context, builder: (_) => _NameDialog( @@ -19,6 +20,7 @@ Future askName( description: description, initialValue: initialValue, submitLabel: submitLabel, + validateName: validateName, ), ); @@ -29,12 +31,14 @@ class _NameDialog extends StatefulWidget { this.description, required this.initialValue, this.submitLabel, + this.validateName, }); final String title; final String label; final String? description; final String initialValue; final String? submitLabel; + final Future Function(String name)? validateName; @override State<_NameDialog> createState() => _NameDialogState(); } @@ -46,16 +50,39 @@ class _NameDialogState extends State<_NameDialog> { extentOffset: widget.initialValue.length, ); final _form = GlobalKey(); + bool _validating = false; + String? _validationError; @override void dispose() { _controller.dispose(); super.dispose(); } - void _submit() { - if (_form.currentState!.validate()) { - Navigator.pop(context, _controller.text.trim()); + Future _submit() async { + if (_validating) return; + _validationError = null; + if (!_form.currentState!.validate()) return; + final name = _controller.text.trim(); + if (widget.validateName != null) { + setState(() => _validating = true); + String? error; + try { + error = await widget.validateName!(name); + } catch (_) { + if (!mounted) return; + error = context.l10n.operationFailed; + } + if (!mounted || ModalRoute.of(context)?.isCurrent != true) return; + setState(() { + _validating = false; + _validationError = error; + }); + if (error != null) { + _form.currentState!.validate(); + return; + } } + if (mounted) Navigator.pop(context, name); } @override @@ -69,7 +96,7 @@ class _NameDialogState extends State<_NameDialog> { child: Text(context.l10n.cancel), ), FilledButton( - onPressed: _submit, + onPressed: _validating ? null : _submit, child: Text(widget.submitLabel ?? context.l10n.create), ), ], @@ -78,8 +105,10 @@ class _NameDialogState extends State<_NameDialog> { key: _form, child: TextFormField( controller: _controller, + readOnly: _validating, style: AppTheme.inputTextStyle(dialogContext), cursorHeight: AppTheme.inputCursorHeight(dialogContext), + textAlignVertical: TextAlignVertical.center, autofocus: true, maxLength: 80, buildCounter: ( @@ -88,13 +117,22 @@ class _NameDialogState extends State<_NameDialog> { required isFocused, maxLength, }) => null, - decoration: InputDecoration(hintText: widget.label), + decoration: InputDecoration( + hintText: widget.label, + hintStyle: AppTheme.inputHintStyle(dialogContext), + errorMaxLines: 3, + ), validator: (value) => value == null || value.trim().isEmpty ? context.l10n.enterName : RegExp(r'[/\\\x00-\x1F]').hasMatch(value) || ['.', '..'].contains(value.trim()) ? context.l10n.invalidName - : null, + : _validationError, + onChanged: (_) { + if (_validationError == null) return; + _validationError = null; + _form.currentState!.validate(); + }, onFieldSubmitted: (_) => _submit(), ), ), diff --git a/lib/features/properties/audio_properties.dart b/lib/features/properties/audio_properties.dart index aee5489..2271ad9 100644 --- a/lib/features/properties/audio_properties.dart +++ b/lib/features/properties/audio_properties.dart @@ -1,9 +1,12 @@ +import '../../shared/widgets/listenable_selector.dart'; + import 'package:cutdex/l10n/l10n.dart'; import 'package:cutdex/features/properties/audio_gain_scale.dart'; import 'package:cutdex_sdk/timeline/engine.dart'; import 'package:cutdex_sdk/timeline/model.dart'; import 'package:flutter/material.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:cutdex_ui/theme.dart'; @@ -123,8 +126,28 @@ class _AudioPropertiesState extends State { @override Widget build(BuildContext context) { final view = widget.session.view(widget.sequence); - return ListenableBuilder( - listenable: view, + return ListenableSelector( + listenable: Listenable.merge([view, widget.session]), + select: () { + final query = view.version.kernelVersion.query(); + final handle = query.elementById(widget.clip.id); + final record = handle == null ? widget.clip : query.element(handle); + final localTick = handle == null + ? 0 + : view.playheadTick - query.absoluteStart(handle); + final tick = TimelineSourceClock(record).nearestSourceTick( + localTick.clamp(0, record.duration > 0 ? record.duration - 1 : 0), + ); + final gain = ClipAudioGain.fromRecord(record, sourceTick: tick); + return ( + record, + gain.db, + gain.muted, + record.parameters?[ClipAudioGain.gainId]?.keyframeAt(tick), + widget.session.acceptsEdits, + _editValid, + ); + }, builder: (context, _) { final query = view.version.kernelVersion.query(); final handle = query.elementById(widget.clip.id); @@ -147,7 +170,7 @@ class _AudioPropertiesState extends State { } if (ClipAudioGain.isDetached(record)) { return Padding( - padding: AppSpacing.panelSection, + padding: AppTheme.propertySectionPadding(context), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -155,10 +178,10 @@ class _AudioPropertiesState extends State { context.l10n.audioDetached, style: AppTheme.propertySectionTitleStyle(context), ), - const SizedBox(height: AppSpacing.small), + SizedBox(height: AppTheme.propertyRowGap(context)), OutlinedButton.icon( key: const Key('audio-restore'), - icon: const Icon(Icons.volume_up_outlined), + icon: const Icon(AppIcons.volume), label: Text(context.l10n.restoreAudio), onPressed: !enabled || !widget.session.acceptsEdits ? null @@ -187,172 +210,171 @@ class _AudioPropertiesState extends State { ), ); } + final volumeActions = [ + IconButton( + key: const Key('audio-key'), + tooltip: context.l10n.toggleKeyframe( + keyed ? context.l10n.delete : context.l10n.addKeyframeAction, + context.l10n.volume, + ), + isSelected: keyed, + icon: Transform.rotate( + angle: 0.7853981633974483, + child: Icon( + keyed ? AppIcons.squareFilled : AppIcons.square, + size: 12, + ), + ), + onPressed: !enabled + ? null + : () { + if (_dirty && !_submit(_text.text)) return; + _focus.unfocus(); + FocusManager.instance.applyFocusChangesIfNeeded(); + try { + widget.session.commands.editKeyframeChannel( + sequence: widget.sequence, + clip: widget.clip.id, + tick: view.playheadTick, + parameterIds: [ClipAudioGain.gainId], + ); + } catch (_) { + setState( + () => _error = context.l10n.updateKeyframesFailed, + ); + } + }, + ), + IconButton( + key: const Key('audio-mute'), + tooltip: value.muted ? context.l10n.unmute : context.l10n.mute, + isSelected: value.muted, + icon: Icon(value.muted ? AppIcons.mute : AppIcons.volume), + onPressed: !enabled + ? null + : () { + _editVersion = null; + _editTick = null; + _commit(ClipAudioGain(saved.db, muted: !saved.muted)); + }, + ), + IconButton( + key: const Key('audio-reset'), + tooltip: context.l10n.resetVolume, + icon: const Icon(AppIcons.reset), + onPressed: !enabled + ? null + : () { + _editVersion = null; + _editTick = null; + _commit(const ClipAudioGain(0)); + }, + ), + ]; + final volumeControls = Row( + children: [ + Expanded( + child: AppSlider( + key: const Key('audio-slider'), + value: value.muted ? 0 : AudioGainScale.positionAt(value.db), + semanticFormatterCallback: (p) => p == 0 + ? context.l10n.mute + : '${AudioGainScale.formatDb(AudioGainScale.dbAt(p))} dB', + onChangeStart: !enabled + ? null + : (_) { + _focus.unfocus(); + FocusManager.instance.applyFocusChangesIfNeeded(); + _beginEdit(); + }, + onChanged: !enabled + ? null + : (p) => setState(() { + if (!_editValid) { + widget.session.clearAudioGainPreview(widget.clip.id); + _timeline = null; + return; + } + _dirty = false; + _timeline = p == 0 + ? ClipAudioGain(saved.db, muted: true) + : ClipAudioGain( + AudioGainScale.quantizeDb( + AudioGainScale.dbAt(p), + ), + ); + widget.session.previewAudioGain( + widget.sequence, + widget.clip.id, + _timeline!, + ); + }), + onChangeEnd: !enabled + ? null + : (_) => _commit(_timeline ?? saved), + ), + ), + SizedBox(width: AppTheme.propertyRowGap(context)), + SizedBox( + width: 84, + child: AppTextField( + key: const Key('audio-db'), + controller: _text, + focusNode: _focus, + label: null, + unit: 'dB', + enabled: enabled, + errorText: _error, + keyboardType: const TextInputType.numberWithOptions( + signed: true, + decimal: true, + ), + onChanged: (_) { + if (!_dirty) { + _beginEdit(); + } + _dirty = true; + }, + onSubmitted: _submit, + ), + ), + ], + ); return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Padding( - padding: AppSpacing.panelSection, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( - children: [ - Expanded( - child: Text( - widget.hasAudio - ? context.l10n.volume - : context.l10n.unboundAudio, - style: AppTheme.propertySectionTitleStyle(context), + padding: AppTheme.propertySectionPadding(context), + child: AppTheme.isDesktop(context) + ? AppPropertyGroup( + label: widget.hasAudio + ? context.l10n.volume + : context.l10n.unboundAudio, + actions: volumeActions, + child: volumeControls, + ) + : Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + children: [ + Expanded( + child: Text( + widget.hasAudio + ? context.l10n.volume + : context.l10n.unboundAudio, + style: AppTheme.propertySectionTitleStyle( + context, + ), + ), + ), + ...volumeActions, + ], ), - ), - IconButton( - key: const Key('audio-key'), - tooltip: context.l10n.toggleKeyframe( - keyed - ? context.l10n.delete - : context.l10n.addKeyframeAction, - context.l10n.volume, - ), - isSelected: keyed, - icon: Transform.rotate( - angle: 0.7853981633974483, - child: Icon( - keyed ? Icons.square : Icons.crop_square, - size: 12, - ), - ), - onPressed: !enabled - ? null - : () { - if (_dirty && !_submit(_text.text)) return; - _focus.unfocus(); - FocusManager.instance - .applyFocusChangesIfNeeded(); - try { - widget.session.commands.editKeyframeChannel( - sequence: widget.sequence, - clip: widget.clip.id, - tick: view.playheadTick, - parameterIds: [ClipAudioGain.gainId], - ); - } catch (_) { - setState( - () => _error = - context.l10n.updateKeyframesFailed, - ); - } - }, - ), - IconButton( - key: const Key('audio-mute'), - tooltip: value.muted - ? context.l10n.unmute - : context.l10n.mute, - isSelected: value.muted, - icon: Icon( - value.muted ? Icons.volume_off : Icons.volume_up, - ), - onPressed: !enabled - ? null - : () { - _editVersion = null; - _editTick = null; - _commit( - ClipAudioGain(saved.db, muted: !saved.muted), - ); - }, - ), - IconButton( - key: const Key('audio-reset'), - tooltip: context.l10n.resetVolume, - icon: const Icon(Icons.restart_alt), - onPressed: !enabled - ? null - : () { - _editVersion = null; - _editTick = null; - _commit(const ClipAudioGain(0)); - }, - ), - ], - ), - const SizedBox(height: AppSpacing.small), - Row( - children: [ - Expanded( - child: AppSlider( - key: const Key('audio-slider'), - value: value.muted - ? 0 - : AudioGainScale.positionAt(value.db), - semanticFormatterCallback: (p) => p == 0 - ? context.l10n.mute - : '${AudioGainScale.formatDb(AudioGainScale.dbAt(p))} dB', - onChangeStart: !enabled - ? null - : (_) { - _focus.unfocus(); - FocusManager.instance - .applyFocusChangesIfNeeded(); - _beginEdit(); - }, - onChanged: !enabled - ? null - : (p) => setState(() { - if (!_editValid) { - widget.session.clearAudioGainPreview( - widget.clip.id, - ); - _timeline = null; - return; - } - _dirty = false; - _timeline = p == 0 - ? ClipAudioGain(saved.db, muted: true) - : ClipAudioGain( - AudioGainScale.quantizeDb( - AudioGainScale.dbAt(p), - ), - ); - widget.session.previewAudioGain( - widget.sequence, - widget.clip.id, - _timeline!, - ); - }), - onChangeEnd: !enabled - ? null - : (_) => _commit(_timeline ?? saved), - ), - ), - const SizedBox(width: AppSpacing.small), - SizedBox( - width: 84, - child: AppTextField( - key: const Key('audio-db'), - controller: _text, - focusNode: _focus, - label: null, - unit: 'dB', - enabled: enabled, - errorText: _error, - keyboardType: const TextInputType.numberWithOptions( - signed: true, - decimal: true, - ), - onChanged: (_) { - if (!_dirty) { - _beginEdit(); - } - _dirty = true; - }, - onSubmitted: _submit, - ), - ), - ], - ), - ], - ), + SizedBox(height: AppTheme.propertyRowGap(context)), + volumeControls, + ], + ), ), ], ); diff --git a/lib/features/properties/caption_properties.dart b/lib/features/properties/caption_properties.dart index dc315c9..00fcb1c 100644 --- a/lib/features/properties/caption_properties.dart +++ b/lib/features/properties/caption_properties.dart @@ -1,9 +1,13 @@ +import '../../shared/widgets/listenable_selector.dart'; +import '../../shared/widgets/presentation_list.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import 'package:cutdex/l10n/l10n.dart'; import 'package:cutdex_sdk/editor.dart'; import 'package:cutdex_sdk/timeline/model.dart'; import 'package:flutter/material.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -187,15 +191,15 @@ class _CaptionPropertiesState extends State { final matches = cues.indexed .where((entry) => entry.$2.text.toLowerCase().contains(_captionQuery)) .toList(); + final actionSize = AppTheme.isDesktop(context) + ? AppInspectorMetrics.action + : 28.0; return Column( children: [ Padding( - padding: const EdgeInsets.symmetric( - horizontal: AppSpacing.panelContentHorizontal, - vertical: AppSpacing.small, - ), + padding: AppTheme.propertySectionPadding(context), child: SizedBox( - height: 28, + height: AppTheme.propertyInputHeight(context), child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -203,7 +207,7 @@ class _CaptionPropertiesState extends State { child: TextField( key: const ValueKey('caption-search'), controller: _captionSearch, - style: Theme.of(context).textTheme.bodyMedium, + style: AppTheme.inputTextStyle(context), cursorHeight: AppTheme.inputCursorHeight(context), textAlignVertical: TextAlignVertical.center, textInputAction: TextInputAction.search, @@ -212,12 +216,16 @@ class _CaptionPropertiesState extends State { context.l10n.captions, ), isDense: true, - constraints: const BoxConstraints.tightFor(height: 28), + constraints: BoxConstraints.tightFor( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.input + : 28, + ), contentPadding: const EdgeInsets.symmetric( horizontal: 8, vertical: 0, ), - prefixIcon: const Icon(Icons.search, size: 14), + prefixIcon: const Icon(AppIcons.search, size: 14), prefixIconConstraints: const BoxConstraints( minWidth: 28, minHeight: 28, @@ -229,27 +237,29 @@ class _CaptionPropertiesState extends State { ), ), const SizedBox(width: 4), - IconButton( - key: const ValueKey('caption-wrap-toggle'), - tooltip: _wrapCaptions - ? context.l10n.captionSingleLine - : context.l10n.captionWrapLines, - isSelected: _wrapCaptions, - color: _wrapCaptions - ? Theme.of(context).colorScheme.primary - : null, - icon: const Icon(Icons.wrap_text, size: 16), - padding: EdgeInsets.zero, - style: IconButton.styleFrom( - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - visualDensity: VisualDensity.standard, + Align( + child: IconButton( + key: const ValueKey('caption-wrap-toggle'), + tooltip: _wrapCaptions + ? context.l10n.captionSingleLine + : context.l10n.captionWrapLines, + isSelected: _wrapCaptions, + color: _wrapCaptions + ? Theme.of(context).colorScheme.primary + : null, + icon: const Icon(AppIcons.textWrap, size: 16), + padding: EdgeInsets.zero, + style: IconButton.styleFrom( + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + visualDensity: VisualDensity.standard, + ), + constraints: BoxConstraints.tightFor( + width: actionSize, + height: actionSize, + ), + onPressed: () => + setState(() => _wrapCaptions = !_wrapCaptions), ), - constraints: const BoxConstraints.tightFor( - width: 28, - height: 28, - ), - onPressed: () => - setState(() => _wrapCaptions = !_wrapCaptions), ), ], ), @@ -273,8 +283,10 @@ class _CaptionPropertiesState extends State { children: [ for (final (index, cue) in matches) Padding( - padding: const EdgeInsets.symmetric( - horizontal: AppSpacing.panelContentHorizontal, + padding: EdgeInsets.symmetric( + horizontal: AppTheme.isDesktop(context) + ? AppInspectorMetrics.padding + : AppSpacing.panelContentHorizontal, vertical: AppSpacing.hairline, ), child: Material( @@ -332,21 +344,20 @@ class _CaptionPropertiesState extends State { ), const SizedBox(width: 4), SizedBox( - width: 28, - height: 28, + width: actionSize, + height: actionSize, child: IconButton( key: ValueKey( 'caption-action-${cue.id}', ), tooltip: context.l10n.select, padding: EdgeInsets.zero, - constraints: - const BoxConstraints.tightFor( - width: 28, - height: 28, - ), + constraints: BoxConstraints.tightFor( + width: actionSize, + height: actionSize, + ), icon: const Icon( - Icons.chevron_right, + AppIcons.chevronRight, size: 14, ), onPressed: () => _selectCue(cue.id), @@ -368,8 +379,42 @@ class _CaptionPropertiesState extends State { } @override - Widget build(BuildContext context) => ListenableBuilder( + Widget build(BuildContext context) => ListenableSelector( listenable: widget.session, + select: () { + final query = widget.session.persistence + .timeline(widget.sequence) + .current + .query(); + final handle = query.elementById(ElementId(widget.clipId)); + if (handle == null) return (null, widget.session.acceptsEdits); + final clip = query.element(handle); + final role = clip.containerStoryline != null + ? handle + : widget.session.captionRole(widget.sequence); + final child = role == null + ? null + : query.element(role).containerStoryline; + return ( + clip, + clip.payloadRef == null + ? null + : widget.session.payloadFor(clip.payloadRef!), + query.localContext(handle).start, + widget.session.acceptsEdits, + widget.session.version, + PresentationList([ + if (child != null) + for (final cue in query.storylineElements(child)) + ( + query.element(cue), + query.element(cue).payloadRef == null + ? null + : widget.session.payloadFor(query.element(cue).payloadRef!), + ), + ]), + ); + }, builder: (context, _) { final q = widget.session.persistence .timeline(widget.sequence) @@ -402,7 +447,9 @@ class _CaptionPropertiesState extends State { final selected = isRole ? _CaptionPropertyCategory.captions : _selected; Widget panel(Widget content) => WorkspacePanel( paintBackground: false, - headerHeight: CompactPanelTabs.height, + headerHeight: AppTheme.isDesktop(context) + ? AppDesktopMetrics.panelHeader + : CompactPanelTabs.height, headerPadding: EdgeInsets.zero, showHeaderDivider: false, controls: CompactPanelTabs<_CaptionPropertyCategory>( @@ -421,6 +468,12 @@ class _CaptionPropertiesState extends State { final caption = widget.session.caption(widget.sequence, widget.clipId); final version = widget.session.version; + final editContext = ( + widget.session, + widget.sequence, + widget.clipId, + version, + ); final start = RationalTime.timelineTicks(q.localContext(handle).start) .seconds; final duration = RationalTime.timelineTicks(clip.duration).seconds; @@ -436,17 +489,21 @@ class _CaptionPropertiesState extends State { required double scale, String? unit, int decimalPlaces = 2, + bool inlineLabel = false, + String? prefix, required SetCaption Function(double, String) command, }) => PropertyNumberInput( key: ValueKey('caption-$field'), label: label, + inlineLabel: inlineLabel, + prefix: prefix, unit: unit, decimalPlaces: decimalPlaces, value: shown(field, value), enabled: true, readOnly: _scrubField != null, scrubbing: _scrubField == field, - editContext: (widget.clipId, version), + editContext: editContext, submit: (next) async { if (!next.isFinite || next < min || next > max) return false; return _save(command(next, version)); @@ -457,6 +514,51 @@ class _CaptionPropertiesState extends State { onScrubCancel: _cancelScrub, ); + final baselineInput = number( + field: 'positionY', + inlineLabel: AppTheme.isDesktop(context), + prefix: AppTheme.isDesktop(context) ? 'Y' : null, + label: context.l10n.vertical, + value: caption.positionY, + min: -.5, + max: .5, + scale: .002, + decimalPlaces: 3, + command: (value, expected) => SetCaption( + captionId: widget.clipId, + positionY: value, + expectedVersion: expected, + ), + ); + final contentInput = _CaptionTextInput( + key: ValueKey(('caption-text', widget.clipId)), + editContext: editContext, + value: caption.text, + maxLines: 3, + onSubmit: (text) => _save( + SetCaption( + captionId: widget.clipId, + text: text, + expectedVersion: version, + ), + ), + ); + final deleteAction = IconButton( + tooltip: context.l10n.deleteCaption, + icon: const Icon(AppIcons.delete), + onPressed: () { + try { + widget.session.commands.applyEdit( + widget.sequence, + DeleteClip(widget.clipId, expectedVersion: version), + ); + } on CommandRejected { + ErrorNotificationHost.maybeOf(context)?.show( + ErrorNotification(content: Text(context.l10n.captionChanged)), + ); + } + }, + ); return panel( ScrollEdgeFadeBuilder( key: const ValueKey('caption-detail-scroll-fade'), @@ -465,58 +567,39 @@ class _CaptionPropertiesState extends State { padding: const EdgeInsets.symmetric(vertical: AppSpacing.small), children: [ - Row( - children: [ - Expanded( - child: Text( - context.l10n.textClip, - style: AppTheme.propertySectionTitleStyle( - context, + if (AppTheme.isDesktop(context)) + AppPropertyGroup( + label: context.l10n.content, + actions: [deleteAction], + child: contentInput, + ) + else ...[ + Row( + children: [ + Expanded( + child: Text( + context.l10n.textClip, + style: AppTheme.propertySectionTitleStyle( + context, + ), ), ), - ), - IconButton( - tooltip: context.l10n.deleteCaption, - icon: const Icon(Icons.delete_outline), - onPressed: () { - try { - widget.session.commands.applyEdit( - widget.sequence, - DeleteClip( - widget.clipId, - expectedVersion: version, - ), - ); - } on CommandRejected { - ErrorNotificationHost.maybeOf(context)?.show( - ErrorNotification( - content: Text(context.l10n.captionChanged), - ), - ); - } - }, - ), - ], - ), - const SizedBox(height: AppSpacing.small), - Text( - context.l10n.content, - style: AppTheme.propertySectionTitleStyle(context), - ), - const SizedBox(height: AppSpacing.small), - _CaptionTextInput( - key: ValueKey(('caption-text', widget.clipId)), - value: caption.text, - maxLines: 3, - onSubmit: (text) => _save( - SetCaption( - captionId: widget.clipId, - text: text, - expectedVersion: version, - ), + deleteAction, + ], ), + SizedBox(height: AppTheme.propertyRowGap(context)), + Text( + context.l10n.content, + style: AppTheme.propertySectionTitleStyle(context), + ), + SizedBox(height: AppTheme.propertyRowGap(context)), + contentInput, + ], + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.small, ), - const SizedBox(height: AppSpacing.small), number( field: 'fontSize', label: context.l10n.fontSize, @@ -531,9 +614,14 @@ class _CaptionPropertiesState extends State { expectedVersion: expected, ), ), - const SizedBox(height: AppSpacing.small), + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.small, + ), _CaptionColorInput( key: ValueKey(('caption-color', widget.clipId)), + editContext: editContext, value: caption.color, label: context.l10n.color, onSubmit: (color) => _save( @@ -544,9 +632,14 @@ class _CaptionPropertiesState extends State { ), ), ), - const SizedBox(height: AppSpacing.small), + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.small, + ), _CaptionColorInput( key: ValueKey(('caption-strokeColor', widget.clipId)), + editContext: editContext, value: caption.strokeColor, label: context.l10n.outlineColor, onSubmit: (color) => _save( @@ -557,7 +650,11 @@ class _CaptionPropertiesState extends State { ), ), ), - const SizedBox(height: AppSpacing.small), + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.small, + ), number( field: 'strokeWidth', label: context.l10n.outlineWidth, @@ -573,42 +670,56 @@ class _CaptionPropertiesState extends State { ), ), if (widget.transformProperties case final transform?) ...[ - const SizedBox(height: AppSpacing.medium), - const Divider(height: 1), - const SizedBox(height: AppSpacing.medium), - Text( - context.l10n.transform, - style: AppTheme.propertySectionTitleStyle(context), + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.medium, ), - const SizedBox(height: AppSpacing.small), + const Divider(height: 1), + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.medium, + ), + if (!AppTheme.isDesktop(context)) ...[ + Text( + context.l10n.transform, + style: AppTheme.propertySectionTitleStyle(context), + ), + SizedBox(height: AppTheme.propertyRowGap(context)), + ], transform, ], - const SizedBox(height: AppSpacing.medium), - Text( - context.l10n.captionBaseline, - style: AppTheme.propertySectionTitleStyle(context), + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.medium, ), - const SizedBox(height: AppSpacing.small), - number( - field: 'positionY', - label: context.l10n.vertical, - value: caption.positionY, - min: -.5, - max: .5, - scale: .002, - decimalPlaces: 3, - command: (value, expected) => SetCaption( - captionId: widget.clipId, - positionY: value, - expectedVersion: expected, + if (AppTheme.isDesktop(context)) + AppPropertyGroup( + label: context.l10n.captionBaseline, + child: baselineInput, + ) + else ...[ + Text( + context.l10n.captionBaseline, + style: AppTheme.propertySectionTitleStyle(context), ), + SizedBox(height: AppTheme.propertyRowGap(context)), + baselineInput, + ], + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.medium, ), - const SizedBox(height: AppSpacing.medium), - Text( - context.l10n.time, - style: AppTheme.propertySectionTitleStyle(context), - ), - const SizedBox(height: AppSpacing.small), + if (!AppTheme.isDesktop(context)) ...[ + Text( + context.l10n.time, + style: AppTheme.propertySectionTitleStyle(context), + ), + SizedBox(height: AppTheme.propertyRowGap(context)), + ], LayoutBuilder( builder: (context, constraints) { Widget startField() => number( @@ -641,19 +752,23 @@ class _CaptionPropertiesState extends State { expectedVersion: expected, ), ); - if (constraints.maxWidth < 240) { + if (constraints.maxWidth < + (AppTheme.isDesktop(context) ? 180 : 240)) { return Column( children: [ startField(), - const SizedBox(height: AppSpacing.small), + SizedBox( + height: AppTheme.propertyRowGap(context), + ), durationField(), ], ); } return Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded(child: startField()), - const SizedBox(width: AppSpacing.small), + SizedBox(width: AppTheme.propertyRowGap(context)), Expanded(child: durationField()), ], ); @@ -666,8 +781,10 @@ class _CaptionPropertiesState extends State { identical(item, widget.transformProperties) ? item : Padding( - padding: const EdgeInsets.symmetric( - horizontal: AppSpacing.panelContentHorizontal, + padding: EdgeInsets.symmetric( + horizontal: AppTheme.isDesktop(context) + ? AppInspectorMetrics.padding + : AppSpacing.panelContentHorizontal, ), child: item, ), @@ -684,11 +801,13 @@ class _CaptionTextInput extends StatefulWidget { const _CaptionTextInput({ super.key, required this.value, + required this.editContext, required this.onSubmit, this.label, this.maxLines = 1, }); final String value; + final Object editContext; final String? label; final int maxLines; final bool Function(String) onSubmit; @@ -727,6 +846,12 @@ class _CaptionTextInputState extends State<_CaptionTextInput> { @override void didUpdateWidget(covariant _CaptionTextInput oldWidget) { super.didUpdateWidget(oldWidget); + // A new callback carries the new authored version. Never let a draft from + // the previous binding borrow that version and overwrite a newer edit. + if (oldWidget.editContext != widget.editContext) { + _dirty = false; + _error = null; + } if (!_dirty && _controller.text != widget.value) { _controller.text = widget.value; } @@ -763,34 +888,46 @@ class _CaptionColorInput extends StatelessWidget { const _CaptionColorInput({ super.key, required this.value, + required this.editContext, required this.label, required this.onSubmit, }); final String value; + final Object editContext; final String label; final bool Function(String) onSubmit; @override - Widget build(BuildContext context) => Row( - children: [ - Container( - width: 20, - height: 20, - decoration: BoxDecoration( - color: Color(int.parse('FF${value.substring(1)}', radix: 16)), - border: Border.all(color: Theme.of(context).colorScheme.outline), - borderRadius: BorderRadius.circular(AppRadius.extraSmall), + Widget build(BuildContext context) { + final desktop = AppTheme.isDesktop(context); + final controls = Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + color: Color(int.parse('FF${value.substring(1)}', radix: 16)), + border: Border.all(color: Theme.of(context).colorScheme.outline), + borderRadius: BorderRadius.circular(AppRadius.extraSmall), + ), ), - ), - const SizedBox(width: AppSpacing.small), - Expanded( - child: _CaptionTextInput( - value: value, - label: label, - onSubmit: onSubmit, + const SizedBox(width: AppSpacing.small), + Expanded( + child: _CaptionTextInput( + value: value, + editContext: editContext, + label: desktop ? null : label, + onSubmit: onSubmit, + ), ), - ), - ], - ); + ], + ); + return desktop + ? AppPropertyGroup( + label: label, + child: Semantics(label: label, child: controls), + ) + : controls; + } } diff --git a/lib/features/properties/color_interpretation_properties.dart b/lib/features/properties/color_interpretation_properties.dart index d973909..bb49e88 100644 --- a/lib/features/properties/color_interpretation_properties.dart +++ b/lib/features/properties/color_interpretation_properties.dart @@ -47,12 +47,35 @@ class ColorInterpretationProperties extends ConsumerWidget { : reported ? context.l10n.unknownColorSpace : context.l10n.colorInfoNotLoaded; - return Padding( - padding: AppSpacing.panelSection, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - spacing: AppSpacing.gap, - children: [ + final selector = AppSelect( + emptyLabel: context.l10n.noMatchingOptions, + key: const Key('media-color-menu'), + outlined: false, + label: context.l10n.mediaColorInterpretation, + value: selected?.name ?? 'auto', + onChanged: !reported + ? null + : (value) => session.commands.setMediaColor( + assetId, + trackIndex, + value == 'auto' ? null : MediaColorSpace.values.byName(value), + ), + options: [ + AppSelectOption('auto', context.l10n.auto), + for (final color in RenderColorSpace.values) + AppSelectOption(color.name, color.label(context.l10n)), + ], + ); + final controls = Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + spacing: AppSpacing.gap, + children: [ + if (AppTheme.isDesktop(context)) ...[ + AppPropertyGroup( + label: context.l10n.mediaColorSpace, + child: selector, + ), + ] else Row( children: [ Expanded( @@ -61,38 +84,42 @@ class ColorInterpretationProperties extends ConsumerWidget { style: AppTheme.propertySectionTitleStyle(context), ), ), - Flexible( - child: AppSelect( - emptyLabel: context.l10n.noMatchingOptions, - key: const Key('media-color-menu'), - outlined: false, - label: context.l10n.mediaColorInterpretation, - value: selected?.name ?? 'auto', - onChanged: !reported - ? null - : (value) => session.commands.setMediaColor( - assetId, - trackIndex, - value == 'auto' - ? null - : MediaColorSpace.values.byName(value), - ), - options: [ - AppSelectOption('auto', context.l10n.auto), - for (final color in RenderColorSpace.values) - AppSelectOption(color.name, color.label(context.l10n)), - ], - ), - ), + Flexible(child: selector), ], ), - Text( - status, - key: const Key('media-color-status'), - style: Theme.of(context).textTheme.bodySmall, - ), - ], - ), + Text( + status, + key: const Key('media-color-status'), + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ); + return Padding( + padding: AppTheme.propertySectionPadding(context), + child: AppTheme.isDesktop(context) + ? ExpansionTile( + key: PageStorageKey(( + 'media-color-section', + assetId, + trackIndex, + )), + title: Text( + context.l10n.mediaColorInterpretation, + style: AppTheme.propertySectionTitleStyle(context), + ), + tilePadding: EdgeInsets.zero, + childrenPadding: const EdgeInsets.only( + top: AppInspectorMetrics.rowGap, + ), + minTileHeight: AppInspectorMetrics.input, + dense: true, + maintainState: true, + initiallyExpanded: selected != null, + shape: const Border(), + collapsedShape: const Border(), + children: [controls], + ) + : controls, ); } diff --git a/lib/features/properties/mask_properties.dart b/lib/features/properties/mask_properties.dart index 190a5f6..1046689 100644 --- a/lib/features/properties/mask_properties.dart +++ b/lib/features/properties/mask_properties.dart @@ -1,3 +1,7 @@ +import '../../shared/widgets/listenable_selector.dart'; +import '../../shared/widgets/presentation_list.dart'; +import '../../shared/state/operation_scope.dart'; + import 'dart:async'; import 'package:cutdex/l10n/l10n.dart'; @@ -11,6 +15,7 @@ import 'package:cutdex_sdk/timeline/model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -31,18 +36,27 @@ class MaskProperties extends ConsumerStatefulWidget { } class _MaskPropertiesState extends ConsumerState { + Object get _editIdentity => + (widget.projectId, widget.timelineId, widget.element, _preview); + late final _operations = OperationScope(_editIdentity); PreviewController? _preview; - ElementId? _boundElement; + Object? _boundContext; + Object? _maskOwner; String? _error; int? _gestureGeneration; + bool _hasFocusedControl = false; String? _scrubField; ClipMask Function(double)? _scrubChange; double _scrubValue = 0; Future? _pendingValueCommit; @override void dispose() { + _operations.dispose(); final preview = _preview; - scheduleMicrotask(() => preview?.releaseMaskEditing(this)); + final owner = _maskOwner; + if (owner != null) { + scheduleMicrotask(() => preview?.releaseMaskEditing(owner)); + } super.dispose(); } @@ -78,6 +92,7 @@ class _MaskPropertiesState extends ConsumerState { } Future _editKeys(PreviewController preview, List ids) async { + final isCurrent = _operations.capture(); final element = widget.element; final maskId = preview.selectedMaskId; final tick = preview.positionTick; @@ -86,6 +101,7 @@ class _MaskPropertiesState extends ConsumerState { final pending = _pendingValueCommit; if (pending != null && !await pending) return; if (!mounted || + !isCurrent() || widget.element != element || _preview != preview || preview.maskEditingElement != element || @@ -101,479 +117,594 @@ class _MaskPropertiesState extends ConsumerState { } } + @override + void didUpdateWidget(covariant MaskProperties oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.projectId != widget.projectId || + oldWidget.timelineId != widget.timelineId || + oldWidget.element != widget.element) { + _scrubField = null; + _scrubChange = null; + _gestureGeneration = null; + _pendingValueCommit = null; + _error = null; + } + _operations.bind(_editIdentity); + } + @override Widget build(BuildContext context) { final preview = ref .watch(editorPreviewProvider(widget.projectId, widget.timelineId)) .value; - if (preview == null) return const SizedBox.shrink(); - if (_preview != preview || _boundElement != widget.element) { + if (preview == null) { final previous = _preview; - if (previous != null && previous != preview) { - scheduleMicrotask(() => previous.releaseMaskEditing(this)); + final owner = _maskOwner; + _preview = null; + _boundContext = null; + _maskOwner = null; + _operations.bind(_editIdentity); + if (previous != null && owner != null) { + scheduleMicrotask(() => previous.releaseMaskEditing(owner)); + } + return const SizedBox.shrink(); + } + final identity = ( + widget.projectId, + widget.timelineId, + widget.element, + preview, + ); + if (_boundContext != identity) { + final previous = _preview; + final previousOwner = _maskOwner; + if (previous != null && previousOwner != null) { + scheduleMicrotask(() => previous.releaseMaskEditing(previousOwner)); } _preview = preview; - _boundElement = widget.element; + _boundContext = identity; + _operations.bind(_editIdentity); + final isCurrent = _operations.capture(); + final element = widget.element; + final owner = _maskOwner = Object(); WidgetsBinding.instance.addPostFrameCallback((_) { - if (mounted && identical(_preview, preview)) { - preview.setMaskEditing(widget.element, owner: this); + if (mounted && isCurrent()) { + preview.setMaskEditing(element, owner: owner); } }); } - return ListenableBuilder( - listenable: preview, - builder: (context, _) { - final mask = preview.maskFor(widget.element); - final animation = preview.maskAnimation(widget.element); - final stack = preview.maskStackFor(widget.element); - final layers = - preview.maskStackFor(widget.element)?.layers ?? []; - final selectedId = preview.selectedMaskId; - final initialId = layers.where((e) => e.enabled).firstOrNull?.id; - final enabled = - preview.canPlay && - stack != null && - preview.maskEditingElement == widget.element; - Widget key(String label) { - final ids = localizedMaskChannels(context)[label]!; - return IconButton( - key: ValueKey('mask-key-$label'), - tooltip: context.l10n.keyframeLabel(label), - isSelected: animation?.keyed(ids) == true, - onPressed: enabled && _scrubField == null && animation != null - ? () => _editKeys(preview, ids) - : null, - icon: Transform.rotate( - angle: math.pi / 4, - child: Icon( - animation?.keyed(ids) == true - ? Icons.square - : Icons.crop_square, - size: 12, - color: animation?.keyed(ids) == true - ? Theme.of(context).colorScheme.primary - : null, + return Focus( + onFocusChange: (focused) { + if (mounted && focused != _hasFocusedControl) { + setState(() => _hasFocusedControl = focused); + } + }, + child: ListenableSelector( + listenable: preview, + select: () { + final mask = preview.maskFor(widget.element); + final animation = preview.maskAnimation(widget.element); + final stack = preview.maskStackFor(widget.element); + return ( + stack?.record, + _hasFocusedControl || _scrubField != null ? stack?.localTick : null, + preview.selectedMaskId, + preview.canPlay, + preview.maskEditingElement, + mask?.shape, + mask?.x, + mask?.y, + mask?.width, + mask?.height, + mask?.rotation, + mask?.feather, + mask?.inverted, + animation?.containsPlayhead, + PresentationList( + ClipMask.channels.map((ids) => animation?.keyed(ids)), + ), + PresentationList( + (stack?.layers ?? []).map( + (layer) => ( + layer.id, + layer.order, + layer.enabled, + layer.mode, + layer.mask.shape, + ), ), ), ); - } - - Widget field( - String label, - double value, - double min, - double max, - ClipMask Function(double) change, { - String? unit, - bool wrapRotation = false, - }) => PropertyNumberInput( - key: ValueKey((selectedId, label)), - label: label, - unit: unit, - value: value, - enabled: enabled, - readOnly: _scrubField != null, - scrubbing: _scrubField == label, - editContext: ( - widget.element, - selectedId, - stack?.record, - stack?.localTick, - ), - submit: (v) => _submitValue(preview, v, min, max, change), - onScrubStart: () { - if (_scrubField != null) return false; - final preparing = preview.beginMaskEdit(); - final generation = _gestureGeneration = preview.maskEditGeneration; - _scrubChange = change; - _scrubValue = value; - setState(() => _scrubField = label); - unawaited( - preparing - .then((ready) { - if (!ready && generation == preview.maskEditGeneration) { - preview.cancelMaskEdit(); - if (mounted) setState(() => _scrubField = null); - } - }) - .catchError((Object error) { - if (generation == preview.maskEditGeneration) { - preview.cancelMaskEdit(); - if (mounted) { - setState(() { - _scrubField = null; - _error = context.l10n.maskPreviewFailed; - }); - } - } - }), + }, + builder: (context, _) { + final mask = preview.maskFor(widget.element); + final animation = preview.maskAnimation(widget.element); + final stack = preview.maskStackFor(widget.element); + final layers = + preview.maskStackFor(widget.element)?.layers ?? []; + final selectedId = preview.selectedMaskId; + final initialId = layers.where((e) => e.enabled).firstOrNull?.id; + final enabled = + preview.canPlay && + stack != null && + preview.maskEditingElement == widget.element; + Widget key(String label) { + final ids = localizedMaskChannels(context)[label]!; + return IconButton( + key: ValueKey('mask-key-$label'), + tooltip: context.l10n.keyframeLabel(label), + isSelected: animation?.keyed(ids) == true, + onPressed: enabled && _scrubField == null && animation != null + ? () => _editKeys(preview, ids) + : null, + icon: Transform.rotate( + angle: math.pi / 4, + child: Icon( + animation?.keyed(ids) == true + ? AppIcons.squareFilled + : AppIcons.square, + size: 12, + color: animation?.keyed(ids) == true + ? Theme.of(context).colorScheme.primary + : null, + ), + ), ); - return true; - }, - onScrubUpdate: (distance) { - if (_gestureGeneration == preview.maskEditGeneration) { - preview.updateMask( - _scrubChange!( - wrapRotation - ? normalizeRotationDegrees(_scrubValue + distance) - : (_scrubValue + distance).clamp(min, max), - ), + } + + Widget field( + String label, + double value, + double min, + double max, + ClipMask Function(double) change, { + String? unit, + bool wrapRotation = false, + bool inlineLabel = false, + }) => PropertyNumberInput( + key: ValueKey((selectedId, label)), + label: label, + inlineLabel: inlineLabel, + labelActions: AppTheme.isDesktop(context) && !inlineLabel + ? [key(label)] + : const [], + unit: unit, + value: value, + enabled: enabled, + readOnly: _scrubField != null, + scrubbing: _scrubField == label, + editContext: ( + _editIdentity, + selectedId, + stack?.record, + stack?.localTick, + ), + submit: (v) => _submitValue(preview, v, min, max, change), + onScrubStart: () { + if (_scrubField != null) return false; + final preparing = preview.beginMaskEdit(); + final isCurrent = _operations.capture(); + final generation = _gestureGeneration = + preview.maskEditGeneration; + _scrubChange = change; + _scrubValue = value; + setState(() => _scrubField = label); + unawaited( + preparing + .then((ready) { + if (!ready && + isCurrent() && + generation == preview.maskEditGeneration) { + preview.cancelMaskEdit(); + if (mounted) setState(() => _scrubField = null); + } + }) + .catchError((Object error) { + if (isCurrent() && + generation == preview.maskEditGeneration) { + preview.cancelMaskEdit(); + if (mounted) { + setState(() { + _scrubField = null; + _error = context.l10n.maskPreviewFailed; + }); + } + } + }), ); - } - }, - onScrubEnd: () { - if (_gestureGeneration == preview.maskEditGeneration) { - preview.endMaskEdit(); - } - if (mounted) setState(() => _scrubField = null); - }, - onScrubCancel: () { - if (_gestureGeneration == preview.maskEditGeneration) { - preview.cancelMaskEdit(); - } - if (mounted) setState(() => _scrubField = null); - }, - ); - Widget axes(String label, Widget first, Widget second) => LayoutBuilder( - builder: (context, constraints) => Row( - children: [ - Expanded( - child: constraints.maxWidth < 240 - ? Column( - children: [ - first, - const SizedBox(height: AppSpacing.small), - second, - ], - ) - : Row( - children: [ - Expanded(child: first), - const SizedBox(width: AppSpacing.small), - Expanded(child: second), - ], - ), - ), - const SizedBox(width: AppSpacing.small), - key(label), - ], - ), - ); - Widget singleField(String label, Widget input) => Row( - children: [ - Expanded(child: input), - const SizedBox(width: AppSpacing.small), - key(label), - ], - ); - Widget heading(String label) => Padding( - padding: const EdgeInsets.only(bottom: AppSpacing.small), - child: Text( - label, - style: AppTheme.propertySectionTitleStyle(context), - ), - ); - Widget section(List children) => Padding( - padding: AppSpacing.panelSection, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: children, - ), - ); - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - section([ - Row( - children: [ - Expanded( - child: Text( - context.l10n.mask, - style: AppTheme.propertySectionTitleStyle(context), - ), + return true; + }, + onScrubUpdate: (distance) { + if (_gestureGeneration == preview.maskEditGeneration) { + preview.updateMask( + _scrubChange!( + wrapRotation + ? normalizeRotationDegrees(_scrubValue + distance) + : (_scrubValue + distance).clamp(min, max), ), - IconButton( - tooltip: context.l10n.moveMaskUp, - icon: const Icon(Icons.arrow_upward, size: 18), - onPressed: - enabled && - layers.indexWhere((e) => e.id == selectedId) > 0 - ? () { - final ids = layers.map((e) => e.id).toList(); - final i = ids.indexOf(selectedId!); - ids.insert(i - 1, ids.removeAt(i)); - preview.reorderMasks(ids); - } - : null, - ), - IconButton( - tooltip: context.l10n.moveMaskDown, - icon: const Icon(Icons.arrow_downward, size: 18), - onPressed: - enabled && - selectedId != null && - layers.lastOrNull?.id != selectedId - ? () { - final ids = layers.map((e) => e.id).toList(); - final i = ids.indexOf(selectedId); - ids.insert(i + 1, ids.removeAt(i)); - preview.reorderMasks(ids); - } - : null, - ), - AppDropdownMenu( - enabled: enabled, - items: [ - AppMenuItem( - label: context.l10n.rectangle, - onPressed: () => - preview.addMask(ClipMaskShape.rectangle), - ), - AppMenuItem( - label: context.l10n.ellipse, - onPressed: () => preview.addMask(ClipMaskShape.ellipse), - ), - ], - builder: (context, toggle, focusNode) => IconButton( - focusNode: focusNode, - tooltip: context.l10n.addMask, - icon: const Icon(Icons.add), - onPressed: toggle, - ), - ), - ], - ), - ]), - section([ - AppItemGroup( - children: [ - for (var i = 0; i < layers.length; i++) - AppItem( - key: ValueKey('mask-row-${layers[i].id}'), - selected: layers[i].id == selectedId, - onPressed: () => preview.selectMask(layers[i].id), - leading: IconButton( - tooltip: layers[i].enabled - ? context.l10n.disableMask - : context.l10n.enableMask, - icon: Icon( - layers[i].enabled - ? Icons.visibility_outlined - : Icons.visibility_off_outlined, - size: 18, - ), - onPressed: enabled - ? () => preview.configureMask( - layers[i].id, - enabled: !layers[i].enabled, - ) - : null, - ), - actions: [ - AppDropdownMenu( - enabled: enabled && layers[i].id != initialId, - items: [ - for (final mode in ClipMaskMode.values) - AppMenuItem( - label: [ - context.l10n.add, - context.l10n.intersect, - context.l10n.subtract, - ][mode.index], - selected: layers[i].mode == mode, - onPressed: () => preview.configureMask( - layers[i].id, - mode: mode, - ), - ), + ); + } + }, + onScrubEnd: () { + if (_gestureGeneration == preview.maskEditGeneration) { + preview.endMaskEdit(); + } + if (mounted) setState(() => _scrubField = null); + }, + onScrubCancel: () { + if (_gestureGeneration == preview.maskEditGeneration) { + preview.cancelMaskEdit(); + } + if (mounted) setState(() => _scrubField = null); + }, + ); + Widget axes(String label, Widget first, Widget second) => + LayoutBuilder( + builder: (context, constraints) { + final desktop = AppTheme.isDesktop(context); + final gap = AppTheme.propertyRowGap(context); + final pair = constraints.maxWidth < (desktop ? 180 : 240) + ? Column( + children: [ + first, + SizedBox(height: gap), + second, ], - builder: (context, toggle, focusNode) => IconButton( - focusNode: focusNode, - tooltip: layers[i].id == initialId - ? context.l10n.initialRegion - : context.l10n.maskMode( - [ - context.l10n.add, - context.l10n.intersect, - context.l10n.subtract, - ][layers[i].mode.index], - ), - icon: Icon( - layers[i].id == initialId - ? Icons.crop_free - : switch (layers[i].mode) { - ClipMaskMode.add => Icons.add, - ClipMaskMode.intersect => - Icons.filter_center_focus, - ClipMaskMode.subtract => Icons.remove, - }, - size: AppIconSize.standard, - ), - onPressed: toggle, - ), - ), - IconButton( - tooltip: context.l10n.deleteMask, - icon: const Icon(Icons.delete_outline, size: 18), - onPressed: enabled - ? () => preview.removeMask(layers[i].id) - : null, - ), - ], - child: Text( - '${[context.l10n.rectangle, context.l10n.ellipse][layers[i].mask.shape.index]} ${i + 1}', - ), - ), - ], - ), - ]), - if (mask != null && animation != null) ...[ - section([ - Row( + ) + : Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: first), + SizedBox(width: gap), + Expanded(child: second), + ], + ); + return desktop + ? AppPropertyGroup( + label: label, + actions: [key(label)], + child: pair, + ) + : Row( + children: [ + Expanded(child: pair), + SizedBox(width: gap), + key(label), + ], + ); + }, + ); + Widget singleField(String label, Widget input) => + AppTheme.isDesktop(context) + ? input + : Row( children: [ - Expanded( - child: AppButtonGroup( - expanded: true, - label: context.l10n.mask, - children: [ - for (final entry in [ - ( - ClipMaskShape.rectangle, - Icons.crop_square, - context.l10n.rectangle, - ), - ( - ClipMaskShape.ellipse, - Icons.circle_outlined, - context.l10n.ellipse, - ), - ]) - IconButton( - key: ValueKey('mask-shape-${entry.$1.name}'), - tooltip: entry.$3, - isSelected: mask.shape == entry.$1, - onPressed: enabled - ? () => _apply( - preview, - mask.copyWith(shape: entry.$1), - ) - : null, - icon: Icon(entry.$2), - ), - ], - ), - ), - const SizedBox(width: AppSpacing.small), - IconButton( - tooltip: context.l10n.resetMask, - onPressed: enabled - ? () => _apply(preview, ClipMask(shape: mask.shape)) - : null, - icon: const Icon(Icons.restart_alt), - ), + Expanded(child: input), + SizedBox(width: AppTheme.propertyRowGap(context)), + key(label), ], + ); + Widget heading(String label) => AppTheme.isDesktop(context) + ? const SizedBox.shrink() + : Padding( + padding: EdgeInsets.only( + bottom: AppTheme.propertyRowGap(context), + ), + child: Text( + label, + style: AppTheme.propertySectionTitleStyle(context), + ), + ); + Widget section(List children) => Padding( + padding: AppTheme.propertySectionPadding(context), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: children, + ), + ); + Widget shapeSelector() => AppButtonGroup( + expanded: true, + label: context.l10n.mask, + children: [ + for (final entry in [ + ( + ClipMaskShape.rectangle, + AppIcons.square, + context.l10n.rectangle, ), - ]), - section([ - heading(context.l10n.position), - axes( - context.l10n.position, - field( - 'X', - mask.x * 100, - ClipMask.minPosition * 100, - ClipMask.maxPosition * 100, - (v) => mask.copyWith(x: v / 100), - unit: '%', - ), - field( - 'Y', - mask.y * 100, - ClipMask.minPosition * 100, - ClipMask.maxPosition * 100, - (v) => mask.copyWith(y: v / 100), - unit: '%', - ), + (ClipMaskShape.ellipse, AppIcons.circle, context.l10n.ellipse), + ]) + IconButton( + key: ValueKey('mask-shape-${entry.$1.name}'), + tooltip: entry.$3, + isSelected: mask!.shape == entry.$1, + onPressed: enabled + ? () => _apply(preview, mask.copyWith(shape: entry.$1)) + : null, + icon: Icon(entry.$2), ), - ]), - section([ - singleField( - context.l10n.rotation, - field( - context.l10n.rotation, - mask.rotation, - -180, - 180, - (v) => mask.copyWith(rotation: v), - unit: '°', - wrapRotation: true, - ), - ), - ]), - section([ - heading(context.l10n.size), - axes( - context.l10n.size, - field( - 'W', - mask.width * 100, - ClipMask.minExtent * 100, - ClipMask.maxExtent * 100, - (v) => mask.copyWith(width: v / 100), - unit: '%', - ), - field( - 'H', - mask.height * 100, - ClipMask.minExtent * 100, - ClipMask.maxExtent * 100, - (v) => mask.copyWith(height: v / 100), - unit: '%', - ), - ), - ]), - section([ - singleField( - context.l10n.feather, - field( - context.l10n.feather, - mask.feather * 100, - 0, - 100, - (v) => mask.copyWith(feather: v / 100), - unit: '%', - ), - ), - ]), + ], + ); + Widget shapeReset() => IconButton( + tooltip: context.l10n.resetMask, + onPressed: enabled + ? () => _apply(preview, ClipMask(shape: mask!.shape)) + : null, + icon: const Icon(AppIcons.reset), + ); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ section([ Row( children: [ Expanded( child: Text( - context.l10n.invert, + context.l10n.mask, style: AppTheme.propertySectionTitleStyle(context), ), ), - AppSwitch( - value: mask.inverted, - onChanged: enabled - ? (v) => _apply(preview, mask.copyWith(inverted: v)) + IconButton( + tooltip: context.l10n.moveMaskUp, + icon: const Icon(AppIcons.arrowUp, size: 18), + onPressed: + enabled && + layers.indexWhere((e) => e.id == selectedId) > 0 + ? () { + final ids = layers.map((e) => e.id).toList(); + final i = ids.indexOf(selectedId!); + ids.insert(i - 1, ids.removeAt(i)); + preview.reorderMasks(ids); + } : null, ), + IconButton( + tooltip: context.l10n.moveMaskDown, + icon: const Icon(AppIcons.arrowDown, size: 18), + onPressed: + enabled && + selectedId != null && + layers.lastOrNull?.id != selectedId + ? () { + final ids = layers.map((e) => e.id).toList(); + final i = ids.indexOf(selectedId); + ids.insert(i + 1, ids.removeAt(i)); + preview.reorderMasks(ids); + } + : null, + ), + AppDropdownMenu( + enabled: enabled, + items: [ + AppMenuItem( + label: context.l10n.rectangle, + onPressed: () => + preview.addMask(ClipMaskShape.rectangle), + ), + AppMenuItem( + label: context.l10n.ellipse, + onPressed: () => + preview.addMask(ClipMaskShape.ellipse), + ), + ], + builder: (context, toggle, focusNode) => IconButton( + focusNode: focusNode, + tooltip: context.l10n.addMask, + icon: const Icon(AppIcons.add), + onPressed: toggle, + ), + ), ], ), ]), - ], - if (_error != null) section([ - Text( - _error!, - style: TextStyle(color: Theme.of(context).colorScheme.error), + AppItemGroup( + children: [ + for (var i = 0; i < layers.length; i++) + AppItem( + key: ValueKey('mask-row-${layers[i].id}'), + selected: layers[i].id == selectedId, + onPressed: () => preview.selectMask(layers[i].id), + leading: IconButton( + tooltip: layers[i].enabled + ? context.l10n.disableMask + : context.l10n.enableMask, + icon: Icon( + layers[i].enabled + ? AppIcons.visible + : AppIcons.hidden, + size: 18, + ), + onPressed: enabled + ? () => preview.configureMask( + layers[i].id, + enabled: !layers[i].enabled, + ) + : null, + ), + actions: [ + AppDropdownMenu( + enabled: enabled && layers[i].id != initialId, + items: [ + for (final mode in ClipMaskMode.values) + AppMenuItem( + label: [ + context.l10n.add, + context.l10n.intersect, + context.l10n.subtract, + ][mode.index], + selected: layers[i].mode == mode, + onPressed: () => preview.configureMask( + layers[i].id, + mode: mode, + ), + ), + ], + builder: (context, toggle, focusNode) => IconButton( + focusNode: focusNode, + tooltip: layers[i].id == initialId + ? context.l10n.initialRegion + : context.l10n.maskMode( + [ + context.l10n.add, + context.l10n.intersect, + context.l10n.subtract, + ][layers[i].mode.index], + ), + icon: Icon( + layers[i].id == initialId + ? AppIcons.maskRegion + : switch (layers[i].mode) { + ClipMaskMode.add => AppIcons.add, + ClipMaskMode.intersect => + AppIcons.maskIntersect, + ClipMaskMode.subtract => + AppIcons.remove, + }, + size: AppIconSize.standard, + ), + onPressed: toggle, + ), + ), + IconButton( + tooltip: context.l10n.deleteMask, + icon: const Icon(AppIcons.delete, size: 18), + onPressed: enabled + ? () => preview.removeMask(layers[i].id) + : null, + ), + ], + child: Text( + '${[context.l10n.rectangle, context.l10n.ellipse][layers[i].mask.shape.index]} ${i + 1}', + ), + ), + ], ), ]), - ], - ); - }, + if (mask != null && animation != null) ...[ + section([ + if (AppTheme.isDesktop(context)) + AppPropertyGroup( + label: context.l10n.type, + actions: [shapeReset()], + child: shapeSelector(), + ) + else + Row( + children: [ + Expanded(child: shapeSelector()), + SizedBox(width: AppTheme.propertyRowGap(context)), + shapeReset(), + ], + ), + ]), + section([ + heading(context.l10n.position), + axes( + context.l10n.position, + field( + 'X', + mask.x * 100, + ClipMask.minPosition * 100, + ClipMask.maxPosition * 100, + (v) => mask.copyWith(x: v / 100), + unit: '%', + inlineLabel: true, + ), + field( + 'Y', + mask.y * 100, + ClipMask.minPosition * 100, + ClipMask.maxPosition * 100, + (v) => mask.copyWith(y: v / 100), + unit: '%', + inlineLabel: true, + ), + ), + ]), + section([ + singleField( + context.l10n.rotation, + field( + context.l10n.rotation, + mask.rotation, + -180, + 180, + (v) => mask.copyWith(rotation: v), + unit: '°', + wrapRotation: true, + ), + ), + ]), + section([ + heading(context.l10n.size), + axes( + context.l10n.size, + field( + 'W', + mask.width * 100, + ClipMask.minExtent * 100, + ClipMask.maxExtent * 100, + (v) => mask.copyWith(width: v / 100), + unit: '%', + inlineLabel: true, + ), + field( + 'H', + mask.height * 100, + ClipMask.minExtent * 100, + ClipMask.maxExtent * 100, + (v) => mask.copyWith(height: v / 100), + unit: '%', + inlineLabel: true, + ), + ), + ]), + section([ + singleField( + context.l10n.feather, + field( + context.l10n.feather, + mask.feather * 100, + 0, + 100, + (v) => mask.copyWith(feather: v / 100), + unit: '%', + ), + ), + ]), + section([ + Row( + children: [ + Expanded( + child: Text( + context.l10n.invert, + style: AppTheme.propertySectionTitleStyle(context), + ), + ), + AppSwitch( + value: mask.inverted, + onChanged: enabled + ? (v) => _apply(preview, mask.copyWith(inverted: v)) + : null, + ), + ], + ), + ]), + ], + if (_error != null) + section([ + Text( + _error!, + style: TextStyle( + color: Theme.of(context).colorScheme.error, + ), + ), + ]), + ], + ); + }, + ), ); } } diff --git a/lib/features/properties/picture_properties.dart b/lib/features/properties/picture_properties.dart index 1d0b167..9287b4c 100644 --- a/lib/features/properties/picture_properties.dart +++ b/lib/features/properties/picture_properties.dart @@ -12,11 +12,13 @@ import 'package:cutdex_sdk/timeline/model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import '../../workspace/timeline_session.dart'; import '../../shared/widgets/listenable_selector.dart'; +import '../../shared/state/operation_scope.dart'; import '../preview/preview_panel.dart'; import 'property_number_input.dart'; import 'picture_edits.dart'; @@ -43,6 +45,17 @@ class PictureProperties extends ConsumerStatefulWidget { } class _PicturePropertiesState extends ConsumerState { + Object get _editIdentity => ( + widget.projectId, + widget.timelineId, + widget.session, + widget.sequence, + widget.clip.id, + ); + PreviewController? _boundPreview; + Object get _operationContext => (_editIdentity, _boundPreview); + late final _operations = OperationScope(_operationContext); + late final _seeks = OperationScope(_operationContext); bool _locked = true; bool _hasFocusedControl = false; PictureEditsProvider get _editProvider => @@ -50,17 +63,56 @@ class _PicturePropertiesState extends ConsumerState { PictureEdits get _edits => ref.read(_editProvider.notifier); bool get _saving => ref.read(_editProvider).isLoading; bool Function() _guard() { + final isCurrent = _operations.capture(); final session = widget.session; final sequence = widget.sequence; final clip = widget.clip.id; return () => mounted && + isCurrent() && _scrubBase == null && identical(widget.session, session) && widget.sequence == sequence && widget.clip.id == clip; } + @override + void didUpdateWidget(covariant PictureProperties oldWidget) { + super.didUpdateWidget(oldWidget); + final previousIdentity = ( + oldWidget.projectId, + oldWidget.timelineId, + oldWidget.session, + oldWidget.sequence, + oldWidget.clip.id, + ); + if (previousIdentity != _editIdentity) { + final edit = _clearScrub(); + if (edit != null) scheduleMicrotask(edit.cancel); + } + _operations.bind(_operationContext); + _seeks.bind(_operationContext); + } + + Future _seek(PreviewController? preview, int tick) async { + final isCurrent = _guard(); + final isLatest = _seeks.begin(); + final session = widget.session; + final sequence = widget.sequence; + final view = session.view(sequence); + final version = view.version.kernelVersion; + final position = view.playheadTick; + await preview?.pauseForCanvasInteraction(); + if (!isCurrent() || + !isLatest() || + session.activeSequenceId != sequence || + view.playheadTick != position || + !identical(view.version.kernelVersion, version)) { + return; + } + view.seekTo(tick); + } + String? get _error => switch (ref.read(_editProvider).error) { PictureEditException(:final failure) => switch (failure) { PictureEditFailure.keyframes => context.l10n.updateKeyframesFailed, @@ -78,6 +130,18 @@ class _PicturePropertiesState extends ConsumerState { String? _scrubField; ClipTransform Function(ClipTransform, double)? _scrubChange; + PreviewTransformEdit? _clearScrub() { + final edit = _scrubEdit; + _scrubEdit = null; + _scrubBase = null; + _scrubTimeline = null; + _scrubField = null; + _scrubChange = null; + _scrubVersion = null; + _scrubTick = null; + return edit; + } + bool _startScrub( PreviewController? preview, String field, @@ -144,13 +208,8 @@ class _PicturePropertiesState extends ConsumerState { _cancelScrub(); return; } - final edit = _scrubEdit; - _scrubEdit = null; - _scrubBase = null; - _scrubField = null; - _scrubChange = null; - _scrubVersion = null; - setState(() => _scrubTimeline = null); + final edit = _clearScrub(); + setState(() {}); if (edit != null) { unawaited(edit.end()); } else { @@ -159,20 +218,16 @@ class _PicturePropertiesState extends ConsumerState { } void _cancelScrub() { - final edit = _scrubEdit; - _scrubEdit = null; - _scrubBase = null; - _scrubField = null; - _scrubChange = null; - _scrubVersion = null; - if (mounted) setState(() => _scrubTimeline = null); + final edit = _clearScrub(); + if (mounted) setState(() {}); edit?.cancel(); } @override void dispose() { - final edit = _scrubEdit; - _scrubEdit = null; + _operations.dispose(); + _seeks.dispose(); + final edit = _clearScrub(); if (edit != null) scheduleMicrotask(edit.cancel); super.dispose(); } @@ -198,7 +253,12 @@ class _PicturePropertiesState extends ConsumerState { ); return ( widget.session.activeSequenceId, - view.version.kernelVersion, + animation?.record, + animation?.start, + animation?.frameTicks, + _hasFocusedControl || _scrubBase != null + ? view.version.kernelVersion + : null, widget.session.canvas, animation?.containsPlayhead, timeDependent || _hasFocusedControl ? animation?.playhead : null, @@ -247,6 +307,13 @@ class _PicturePropertiesState extends ConsumerState { .watch(editorPreviewProvider(widget.projectId, widget.timelineId)) .asData ?.value; + if (!identical(_boundPreview, preview)) { + final edit = _clearScrub(); + if (edit != null) scheduleMicrotask(edit.cancel); + _boundPreview = preview; + _operations.bind(_operationContext); + _seeks.bind(_operationContext); + } Widget contents() { final animation = _animation(); final live = preview?.activeSequence() == widget.sequence @@ -275,7 +342,10 @@ class _PicturePropertiesState extends ConsumerState { color: animated ? Theme.of(context).colorScheme.primary : null, icon: Transform.rotate( angle: math.pi / 4, - child: Icon(keyed ? Icons.square : Icons.crop_square, size: 12), + child: Icon( + keyed ? AppIcons.squareFilled : AppIcons.square, + size: 12, + ), ), onPressed: enabled && @@ -287,31 +357,37 @@ class _PicturePropertiesState extends ConsumerState { ); } + final desktop = AppTheme.isDesktop(context); + final gap = AppTheme.propertyRowGap(context); Widget axes(TransformChannel channel, Widget first, Widget second) => LayoutBuilder( - builder: (context, constraints) => Row( - children: [ - Expanded( - child: constraints.maxWidth < 240 - ? Column( - children: [ - first, - const SizedBox(height: AppSpacing.small), - second, - ], - ) - : Row( - children: [ - Expanded(child: first), - const SizedBox(width: AppSpacing.small), - Expanded(child: second), - ], - ), - ), - const SizedBox(width: AppSpacing.small), - keyButton(channel), - ], - ), + builder: (context, constraints) { + final pair = constraints.maxWidth < (desktop ? 180 : 240) + ? Column( + children: [ + first, + SizedBox(height: gap), + second, + ], + ) + : Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: first), + SizedBox(width: gap), + Expanded(child: second), + ], + ); + return desktop + ? pair + : Row( + children: [ + Expanded(child: pair), + SizedBox(width: gap), + keyButton(channel), + ], + ); + }, ); Widget keyTools(TransformChannel channel) { @@ -323,15 +399,12 @@ class _PicturePropertiesState extends ConsumerState { final previous = times.where((t) => t < tick).lastOrNull; final next = times.where((t) => t > tick).firstOrNull; final canEdit = enabled && _scrubBase == null && !canvasDragging; - Future seek(int target) async { - await preview?.pauseForCanvasInteraction(); - if (mounted && widget.session.activeSequenceId == widget.sequence) { - widget.session.view(widget.sequence).seekTo(target); - } - } + Future seek(int target) => _seek(preview, target); return SizedBox( - height: AppControlSize.standard, + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.action + : AppControlSize.standard, child: Row( children: [ Text( @@ -345,13 +418,13 @@ class _PicturePropertiesState extends ConsumerState { onPressed: canEdit && previous != null ? () => seek(previous) : null, - icon: const Icon(Icons.chevron_left, size: 16), + icon: const Icon(AppIcons.chevronLeft, size: 16), ), IconButton( key: ValueKey('picture-key-next-${channel.name}'), tooltip: context.l10n.nextKeyframe(channel.label(context)), onPressed: canEdit && next != null ? () => seek(next) : null, - icon: const Icon(Icons.chevron_right, size: 16), + icon: const Icon(AppIcons.chevronRight, size: 16), ), AppDropdownMenu( key: ValueKey('picture-key-menu-${channel.name}'), @@ -362,7 +435,7 @@ class _PicturePropertiesState extends ConsumerState { ), focusNode: focus, onPressed: toggle, - icon: const Icon(Icons.more_horiz, size: 16), + icon: const Icon(AppIcons.more, size: 16), ), items: [ for (final (mode, label) in [ @@ -412,9 +485,15 @@ class _PicturePropertiesState extends ConsumerState { double min = double.negativeInfinity, double max = double.infinity, bool wrapRotation = false, + bool inlineLabel = false, + String? prefix, + IconData? prefixIcon, }) => PropertyNumberInput( key: ValueKey(id), label: label, + inlineLabel: inlineLabel, + prefix: prefix, + prefixIcon: prefixIcon, unit: unit, value: value, enabled: !_saving, @@ -435,17 +514,170 @@ class _PicturePropertiesState extends ConsumerState { onScrubCancel: _cancelScrub, scrubbing: _scrubField == id, editContext: ( + _editIdentity, + preview, widget.session.view(widget.sequence).version.kernelVersion, widget.session.view(widget.sequence).playheadTick, ), ); Widget section(List children) => Padding( - padding: AppSpacing.panelSection, + padding: AppTheme.propertySectionPadding(context), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: children, ), ); + final position = axes( + TransformChannel.position, + number( + 'picture-x', + 'X', + value.x * canvas.width, + (c, v) => c.copyWith(x: v / canvas.width), + inlineLabel: true, + ), + number( + 'picture-y', + 'Y', + value.y * canvas.height, + (c, v) => c.copyWith(y: v / canvas.height), + inlineLabel: true, + ), + ); + final rotationInput = number( + 'picture-rotation', + context.l10n.rotation, + value.rotation, + (c, v) => c.copyWith(rotation: v), + unit: '°', + wrapRotation: true, + inlineLabel: desktop, + prefixIcon: desktop ? AppIcons.angle : null, + ); + final rotation = desktop + ? rotationInput + : Row( + children: [ + Expanded(child: rotationInput), + SizedBox(width: gap), + keyButton(TransformChannel.rotation), + ], + ); + final scale = axes( + TransformChannel.scale, + number( + 'picture-scale-x', + 'W', + value.scale * 100, + (c, v) => c.copyWith( + scale: v / 100, + scaleY: locked ? c.scaleY * v / 100 / c.scale : c.scaleY, + ), + unit: '%', + min: locked ? math.max(1.0, value.scale / value.scaleY) : 1, + max: locked + ? math.min(10000.0, 10000 * value.scale / value.scaleY) + : 10000, + inlineLabel: true, + ), + number( + 'picture-scale-y', + 'H', + value.scaleY * 100, + (c, v) => c.copyWith( + scaleY: v / 100, + scale: locked ? c.scale * v / 100 / c.scaleY : c.scale, + ), + unit: '%', + min: locked ? math.max(1.0, value.scaleY / value.scale) : 1, + max: locked + ? math.min(10000.0, 10000 * value.scaleY / value.scale) + : 10000, + inlineLabel: true, + ), + ); + final lock = IconButton( + key: const Key('picture-lock'), + tooltip: context.l10n.keepAspectRatio, + icon: const Icon(AppIcons.unlock), + selectedIcon: const Icon(AppIcons.lockFilled), + isSelected: locked, + onPressed: enabled + ? () { + if (preview?.transforms.hasPending == true) return; + preview?.setAspectRatioLocked(!locked); + setState(() => _locked = !locked); + } + : null, + ); + final alignmentControls = LayoutBuilder( + builder: (context, constraints) => Wrap( + spacing: AppSpacing.small, + runSpacing: AppSpacing.small, + children: [ + for (final group in [ + [ + ( + CanvasAlignment.left, + context.l10n.alignLeft, + AppIcons.alignLeft, + ), + ( + CanvasAlignment.horizontalCenter, + context.l10n.alignHorizontalCenter, + AppIcons.alignHorizontalCenter, + ), + ( + CanvasAlignment.right, + context.l10n.alignRight, + AppIcons.alignRight, + ), + ], + [ + (CanvasAlignment.top, context.l10n.alignTop, AppIcons.alignTop), + ( + CanvasAlignment.verticalCenter, + context.l10n.alignVerticalCenter, + AppIcons.alignVerticalCenter, + ), + ( + CanvasAlignment.bottom, + context.l10n.alignBottom, + AppIcons.alignBottom, + ), + ], + ]) + SizedBox( + width: constraints.maxWidth < 200 + ? constraints.maxWidth + : (constraints.maxWidth - AppSpacing.small) / 2, + child: AppButtonGroup( + expanded: true, + label: context.l10n.alignment, + children: [ + for (final (alignment, label, icon) in group) + IconButton( + key: ValueKey('picture-align-${alignment.name}'), + tooltip: label, + icon: Icon(icon, size: AppIconSize.standard), + onPressed: () { + if (!enabled || + canvasDragging || + preview == null || + preview.busy || + preview.visualForProperties(widget.clip.id) == + null) { + return; + } + unawaited(_align(preview, alignment)); + }, + ), + ], + ), + ), + ], + ), + ); final content = Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -454,202 +686,79 @@ class _PicturePropertiesState extends ConsumerState { _KeyframeTimeline( animation: animation, enabled: enabled && !canvasDragging && _scrubBase == null, - onSeek: (tick) async { - await preview?.pauseForCanvasInteraction(); - if (mounted && - widget.session.activeSequenceId == widget.sequence) { - widget.session.view(widget.sequence).seekTo(tick); - } - }, + onSeek: (tick) => _seek(preview, tick), ), ]), ], - if (!widget.animationView) ...[ + if (!widget.animationView) + section([ + if (desktop) + AppPropertyGroup( + label: context.l10n.alignment, + child: alignmentControls, + ) + else ...[ + Text( + context.l10n.alignment, + style: AppTheme.propertySectionTitleStyle(context), + ), + SizedBox(height: gap), + alignmentControls, + ], + ]), + if (desktop) ...[ + section([ + AppPropertyGroup( + label: context.l10n.position, + actions: [keyButton(TransformChannel.position)], + child: position, + ), + keyTools(TransformChannel.position), + ]), + section([ + AppPropertyGroup( + label: context.l10n.scale, + actions: [lock, keyButton(TransformChannel.scale)], + child: scale, + ), + keyTools(TransformChannel.scale), + ]), + section([ + AppPropertyGroup( + label: context.l10n.rotation, + actions: [keyButton(TransformChannel.rotation)], + child: rotation, + ), + keyTools(TransformChannel.rotation), + ]), + ] else ...[ section([ Text( - context.l10n.alignment, + context.l10n.position, style: AppTheme.propertySectionTitleStyle(context), ), - const SizedBox(height: AppSpacing.small), - LayoutBuilder( - builder: (context, constraints) => Wrap( - spacing: AppSpacing.small, - runSpacing: AppSpacing.small, - children: [ - for (final group in [ - [ - ( - CanvasAlignment.left, - context.l10n.alignLeft, - Icons.align_horizontal_left, - ), - ( - CanvasAlignment.horizontalCenter, - context.l10n.alignHorizontalCenter, - Icons.align_horizontal_center, - ), - ( - CanvasAlignment.right, - context.l10n.alignRight, - Icons.align_horizontal_right, - ), - ], - [ - ( - CanvasAlignment.top, - context.l10n.alignTop, - Icons.align_vertical_top, - ), - ( - CanvasAlignment.verticalCenter, - context.l10n.alignVerticalCenter, - Icons.align_vertical_center, - ), - ( - CanvasAlignment.bottom, - context.l10n.alignBottom, - Icons.align_vertical_bottom, - ), - ], - ]) - SizedBox( - width: constraints.maxWidth < 200 - ? constraints.maxWidth - : (constraints.maxWidth - AppSpacing.small) / 2, - child: AppButtonGroup( - expanded: true, - label: context.l10n.alignment, - children: [ - for (final (alignment, label, icon) in group) - IconButton( - key: ValueKey( - 'picture-align-${alignment.name}', - ), - tooltip: label, - icon: Icon(icon, size: AppIconSize.standard), - onPressed: () { - if (!enabled || - canvasDragging || - preview == null || - preview.busy || - preview.visualForProperties( - widget.clip.id, - ) == - null) { - return; - } - unawaited(_align(preview, alignment)); - }, - ), - ], - ), - ), - ], - ), + SizedBox(height: gap), + position, + keyTools(TransformChannel.position), + ]), + section([rotation, keyTools(TransformChannel.rotation)]), + section([ + Row( + children: [ + Expanded( + child: Text( + context.l10n.scale, + style: AppTheme.propertySectionTitleStyle(context), + ), + ), + lock, + ], ), + SizedBox(height: gap), + scale, + keyTools(TransformChannel.scale), ]), ], - section([ - Text( - context.l10n.position, - style: AppTheme.propertySectionTitleStyle(context), - ), - const SizedBox(height: AppSpacing.small), - axes( - TransformChannel.position, - number( - 'picture-x', - 'X', - value.x * canvas.width, - (c, v) => c.copyWith(x: v / canvas.width), - ), - number( - 'picture-y', - 'Y', - value.y * canvas.height, - (c, v) => c.copyWith(y: v / canvas.height), - ), - ), - keyTools(TransformChannel.position), - ]), - section([ - Row( - children: [ - Expanded( - child: number( - 'picture-rotation', - context.l10n.rotation, - value.rotation, - (c, v) => c.copyWith(rotation: v), - unit: '°', - wrapRotation: true, - ), - ), - const SizedBox(width: AppSpacing.small), - keyButton(TransformChannel.rotation), - ], - ), - keyTools(TransformChannel.rotation), - ]), - section([ - Row( - children: [ - Expanded( - child: Text( - context.l10n.scale, - style: AppTheme.propertySectionTitleStyle(context), - ), - ), - IconButton( - key: const Key('picture-lock'), - tooltip: context.l10n.keepAspectRatio, - icon: const Icon(Icons.lock_open_outlined), - selectedIcon: const Icon(Icons.lock_outline), - isSelected: locked, - onPressed: enabled - ? () { - if (preview?.transforms.hasPending == true) return; - preview?.setAspectRatioLocked(!locked); - setState(() => _locked = !locked); - } - : null, - ), - ], - ), - const SizedBox(height: AppSpacing.small), - axes( - TransformChannel.scale, - number( - 'picture-scale-x', - 'W', - value.scale * 100, - (c, v) => c.copyWith( - scale: v / 100, - scaleY: locked ? c.scaleY * v / 100 / c.scale : c.scaleY, - ), - unit: '%', - min: locked ? math.max(1.0, value.scale / value.scaleY) : 1, - max: locked - ? math.min(10000.0, 10000 * value.scale / value.scaleY) - : 10000, - ), - number( - 'picture-scale-y', - 'H', - value.scaleY * 100, - (c, v) => c.copyWith( - scaleY: v / 100, - scale: locked ? c.scale * v / 100 / c.scaleY : c.scale, - ), - unit: '%', - min: locked ? math.max(1.0, value.scaleY / value.scale) : 1, - max: locked - ? math.min(10000.0, 10000 * value.scaleY / value.scale) - : 10000, - ), - ), - keyTools(TransformChannel.scale), - ]), if (_error != null) section([ Text( @@ -793,7 +902,7 @@ class _KeyframeTimeline extends StatelessWidget { icon: Transform.rotate( angle: math.pi / 4, child: Icon( - Icons.square, + AppIcons.squareFilled, size: 9, color: tick == animation.playhead ? colors.primary diff --git a/lib/features/properties/project_properties.dart b/lib/features/properties/project_properties.dart index ef6df6d..a648400 100644 --- a/lib/features/properties/project_properties.dart +++ b/lib/features/properties/project_properties.dart @@ -1,14 +1,17 @@ import 'package:cutdex/l10n/l10n.dart'; import 'package:cutdex_sdk/runtime/contracts.dart'; import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:cutdex_sdk/timeline/engine.dart'; import 'package:flutter/material.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import '../../workspace/timeline_session.dart'; +import '../../shared/widgets/listenable_selector.dart'; import 'canvas_presets.dart'; import 'project_settings_dialog.dart'; +import 'project_property_row.dart'; /// Project information uses the live editing session, including unsaved edits. class ProjectProperties extends StatelessWidget { @@ -18,34 +21,41 @@ class ProjectProperties extends StatelessWidget { @override Widget build(BuildContext context) { - final sequence = session.activeSequenceId; - final timeline = sequence == null - ? null - : session.persistence.timeline(sequence); - final duration = sequence == null - ? 0 - : session.sequenceDurationTicks(sequence); - final frame = timeline?.format.frameDuration; - final fps = frame == null ? null : frame.denominator / frame.numerator; - final canvas = session.canvas; String number(double value) => value == value.roundToDouble() ? value.toStringAsFixed(0) : value.toStringAsFixed(3).replaceFirst(RegExp(r'0+$'), ''); + TimelineKernel? timeline() { + final sequence = session.activeSequenceId; + return sequence == null ? null : session.persistence.timeline(sequence); + } + + Widget info(String label, String Function() value) => + _Info(label, session, value); return WorkspacePanel( paintBackground: false, title: context.l10n.projectProperties, - trailing: TextButton( - key: const ValueKey('project-settings-edit'), - onPressed: () => showAppDialog( - context: context, - builder: (_) => ProjectSettingsDialog(session: session), + trailing: SizedBox( + height: AppTheme.isDesktop(context) ? AppInspectorMetrics.input : null, + child: TextButton( + key: const ValueKey('project-settings-edit'), + style: AppTheme.isDesktop(context) + ? AppTheme.toolbarButtonStyle(context) + : null, + onPressed: () => showAppDialog( + context: context, + builder: (_) => ProjectSettingsDialog(session: session), + ), + child: Text(context.l10n.modify), ), - child: Text(context.l10n.modify), ), - headerHeight: AppControlSize.panelToolbar, - headerPadding: const EdgeInsets.symmetric( - horizontal: AppSpacing.panelContentHorizontal, + headerHeight: AppTheme.isDesktop(context) + ? AppDesktopMetrics.panelHeader + : AppControlSize.panelToolbar, + headerPadding: EdgeInsets.symmetric( + horizontal: AppTheme.isDesktop(context) + ? AppInspectorMetrics.padding + : AppSpacing.panelContentHorizontal, ), showHeaderDivider: false, child: ScrollEdgeFadeBuilder( @@ -55,32 +65,40 @@ class ProjectProperties extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - _Info(context.l10n.timelineName, session.document.name), - _Info( - context.l10n.canvasSize, - '${number(canvas.width)} × ${number(canvas.height)} px', + info(context.l10n.timelineName, () => session.document.name), + info(context.l10n.canvasSize, () { + final canvas = session.canvas; + return '${number(canvas.width)} × ${number(canvas.height)} px'; + }), + info( + context.l10n.canvasRatio, + () => session.canvas.label(context), ), - _Info(context.l10n.canvasRatio, canvas.label(context)), - _Info( + info( context.l10n.projectColorSpace, - switch (session.projectColorSpace) { + () => switch (session.projectColorSpace) { RenderColorSpace.rec2020HLG => 'HDR · Rec.2020 HLG', RenderColorSpace.rec2020PQ => 'HDR · Rec.2020 PQ', _ => 'SDR · Rec.709', }, ), - _Info( + info( context.l10n.currentSequence, - timeline?.name ?? context.l10n.none, - ), - _Info( - context.l10n.frameRate, - fps == null ? '—' : '${number(fps)} fps', - ), - _Info( - context.l10n.totalDuration, - '${(duration / TimelineClock.ticksPerSecond).toStringAsFixed(2)} ${context.l10n.seconds}', + () => timeline()?.name ?? context.l10n.none, ), + info(context.l10n.frameRate, () { + final frame = timeline()?.format.frameDuration; + return frame == null + ? '—' + : '${number(frame.denominator / frame.numerator)} fps'; + }), + info(context.l10n.totalDuration, () { + final sequence = session.activeSequenceId; + final duration = sequence == null + ? 0 + : session.sequenceDurationTicks(sequence); + return '${(duration / TimelineClock.ticksPerSecond).toStringAsFixed(2)} ${context.l10n.seconds}'; + }), ], ), ), @@ -90,27 +108,41 @@ class ProjectProperties extends StatelessWidget { } class _Info extends StatelessWidget { - const _Info(this.label, this.value); + const _Info(this.label, this.session, this.select); final String label; - final String value; + final EditorTimelineSession session; + final String Function() select; @override - Widget build(BuildContext context) => Padding( - padding: AppSpacing.panelSection, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - spacing: AppSpacing.small, - children: [ - Text(label, style: Theme.of(context).textTheme.bodySmall), - Expanded( - child: Text( - value, - textAlign: TextAlign.right, - style: Theme.of(context).textTheme.bodyMedium, - ), - ), - ], - ), - ); + Widget build(BuildContext context) { + if (AppTheme.isDesktop(context)) { + return ListenableSelector( + listenable: session, + select: select, + builder: (context, value) => + ProjectPropertyRow(label: label, value: value), + ); + } + final value = ListenableSelector( + listenable: session, + select: select, + builder: (context, value) => Text( + value, + textAlign: TextAlign.right, + style: Theme.of(context).textTheme.bodyMedium, + ), + ); + return Padding( + padding: AppTheme.propertySectionPadding(context), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: AppSpacing.small, + children: [ + Text(label, style: Theme.of(context).textTheme.bodySmall), + Expanded(child: value), + ], + ), + ); + } } diff --git a/lib/features/properties/project_property_row.dart b/lib/features/properties/project_property_row.dart new file mode 100644 index 0000000..16bec49 --- /dev/null +++ b/lib/features/properties/project_property_row.dart @@ -0,0 +1,63 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; + +/// Read-only project metadata shares label and value columns in the inspector. +class ProjectPropertyRow extends StatelessWidget { + const ProjectPropertyRow({ + super.key, + required this.label, + required this.value, + }); + + final String label; + final String value; + + @override + Widget build(BuildContext context) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: AppInspectorMetrics.padding, + vertical: AppInspectorMetrics.rowGap, + ), + child: ConstrainedBox( + constraints: const BoxConstraints(minHeight: AppInspectorMetrics.input), + child: Align( + alignment: Alignment.center, + heightFactor: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Expanded( + flex: 2, + child: Tooltip( + message: label, + child: Text( + label, + maxLines: 3, + overflow: TextOverflow.ellipsis, + style: AppTheme.toolbarTextStyle(context).copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + ), + const SizedBox(width: AppInspectorMetrics.rowGap * 2), + Expanded( + flex: 3, + child: Tooltip( + message: value, + child: Text( + value, + maxLines: 3, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.right, + style: AppTheme.toolbarTextStyle(context), + ), + ), + ), + ], + ), + ), + ), + ); +} diff --git a/lib/features/properties/project_property_row_previews.dart b/lib/features/properties/project_property_row_previews.dart new file mode 100644 index 0000000..ae76368 --- /dev/null +++ b/lib/features/properties/project_property_row_previews.dart @@ -0,0 +1,41 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import 'project_property_row.dart'; + +@Preview( + name: 'Project summary — narrow', + group: 'Desktop properties', + size: Size(220, 300), +) +Widget narrowProjectSummaryPreview() => _preview(Brightness.dark); + +@Preview( + name: 'Project summary — light', + group: 'Desktop properties', + size: Size(320, 300), +) +Widget lightProjectSummaryPreview() => _preview(Brightness.light); + +Widget _preview(Brightness brightness) => MaterialApp( + debugShowCheckedModeBanner: false, + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(AppPalette.graphite, brightness), + ), + home: const Scaffold( + body: SingleChildScrollView( + child: Column( + children: [ + ProjectPropertyRow(label: '时间线名称', value: '旅行短片'), + ProjectPropertyRow(label: '画布大小', value: '1920 × 1080 px'), + ProjectPropertyRow(label: '画布比例', value: '16:9'), + ProjectPropertyRow(label: '项目色彩空间', value: 'HDR · Rec.2020 HLG'), + ProjectPropertyRow(label: '当前序列', value: '海边日落与城市漫游'), + ProjectPropertyRow(label: '帧率', value: '29.97 fps'), + ProjectPropertyRow(label: '总时长', value: '24.50 秒'), + ], + ), + ), + ), +); diff --git a/lib/features/properties/properties_content.dart b/lib/features/properties/properties_content.dart index 005a652..3769aea 100644 --- a/lib/features/properties/properties_content.dart +++ b/lib/features/properties/properties_content.dart @@ -247,8 +247,16 @@ class _ClipPropertiesState extends State<_ClipProperties> { _selectCategory, ), child: ScrollEdgeFadeBuilder( - key: PageStorageKey((clip.id, _selected)), + key: ValueKey((widget.sequence, clip.id, _selected)), builder: (controller) => SingleChildScrollView( + // Keep scroll offsets separate from nested expansion state and from + // the legacy inspector key, which may already contain a bool. + key: PageStorageKey(( + 'property-scroll', + widget.sequence, + clip.id, + _selected, + )), controller: controller, // Inspector controls stop at their bounds; macOS's default elastic // physics repeatedly displaces the content during edge scrolling. @@ -289,28 +297,42 @@ class _Property extends StatelessWidget { final String value; @override Widget build(BuildContext context) => Padding( - padding: AppSpacing.panelSection, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - spacing: AppSpacing.small, - children: [ - Expanded( - child: Text( - label, - style: AppTheme.propertySectionTitleStyle(context), - ), - ), - Expanded( - child: Text( - value, - textAlign: TextAlign.right, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Theme.of(context).colorScheme.onSurfaceVariant, + padding: AppTheme.isDesktop(context) + ? const EdgeInsets.symmetric( + horizontal: AppInspectorMetrics.padding, + vertical: 4, + ) + : AppSpacing.panelSection, + child: AppTheme.isDesktop(context) + ? AppPropertyGroup( + label: label, + child: Text( + value, + textAlign: TextAlign.right, + style: Theme.of(context).textTheme.bodyMedium, ), + ) + : Row( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: AppSpacing.small, + children: [ + Expanded( + child: Text( + label, + style: AppTheme.propertySectionTitleStyle(context), + ), + ), + Expanded( + child: Text( + value, + textAlign: TextAlign.right, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + ], ), - ), - ], - ), ); } @@ -320,7 +342,12 @@ class _Message extends StatelessWidget { @override Widget build(BuildContext context) => Center( child: Padding( - padding: AppSpacing.panelSection, + padding: AppTheme.isDesktop(context) + ? const EdgeInsets.symmetric( + horizontal: AppInspectorMetrics.padding, + vertical: 4, + ) + : AppSpacing.panelSection, child: Text( text, textAlign: TextAlign.center, diff --git a/lib/features/properties/properties_editor_page.dart b/lib/features/properties/properties_editor_page.dart index 7f54add..45aa463 100644 --- a/lib/features/properties/properties_editor_page.dart +++ b/lib/features/properties/properties_editor_page.dart @@ -1,3 +1,4 @@ +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import 'properties_content.dart'; @@ -20,6 +21,7 @@ class PropertiesEditorPage extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 16), child: DropdownButton( key: const Key('property-category-picker'), + icon: const Icon(AppIcons.expandMore), isExpanded: true, underline: const SizedBox.shrink(), value: selected, diff --git a/lib/features/properties/properties_inspector_controller.dart b/lib/features/properties/properties_inspector_controller.dart index 524ef9a..54ea935 100644 --- a/lib/features/properties/properties_inspector_controller.dart +++ b/lib/features/properties/properties_inspector_controller.dart @@ -31,6 +31,7 @@ class PropertiesInspectorController extends ChangeNotifier { SequenceId? _lastSequence; Object? _lastVersion; Set _lastSelection = {}; + List _lastShell = const []; SequenceId? get sequence => session.activeSequenceId; void _bindView() { @@ -42,20 +43,40 @@ class PropertiesInspectorController extends ChangeNotifier { _editingChanges?.addListener(_viewChanged); } - bool _captureSelection() { + bool _captureSelection({bool force = false}) { final id = sequence; final view = id == null ? null : session.view(id); final version = view?.version.kernelVersion; final selected = view?.selectedIdentities ?? const {}; - if (id == _lastSequence && + if (!force && + id == _lastSequence && identical(version, _lastVersion) && setEquals(selected, _lastSelection)) { return false; } + final shell = [ + for (final clip in selectedClips) + ( + clip.id, + clip.structure, + clip.enabled, + clip.payloadRef == null + ? null + : session.payloadFor(clip.payloadRef!)?.type, + clip.payloadRef == null + ? null + : session.mediaBinding(clip.payloadRef!)?.audioSelection, + clip.payloadRef == null + ? null + : session.mediaBinding(clip.payloadRef!)?.videoTrackIndex, + ), + ]; + final changed = id != _lastSequence || !listEquals(shell, _lastShell); _lastSequence = id; _lastVersion = version; _lastSelection = selected.toSet(); - return true; + _lastShell = shell; + return changed; } void _viewChanged() { @@ -66,8 +87,7 @@ class PropertiesInspectorController extends ChangeNotifier { void _sessionChanged() { _bindView(); - _captureSelection(); - notifyListeners(); + if (_captureSelection(force: true)) notifyListeners(); } List get selectedClips { diff --git a/lib/features/properties/properties_panel.dart b/lib/features/properties/properties_panel.dart index 37c93c3..9bbbec4 100644 --- a/lib/features/properties/properties_panel.dart +++ b/lib/features/properties/properties_panel.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:cutdex_ui/widgets.dart'; +import 'package:cutdex_ui/theme.dart'; import 'properties_content.dart'; export 'properties_presentation_state.dart'; @@ -18,7 +19,9 @@ class EditorPropertiesPanel extends StatelessWidget { Widget build(BuildContext context) => PropertiesContent( projectId: projectId, timelineId: timelineId, - categoryHeaderHeight: CompactPanelTabs.height, + categoryHeaderHeight: AppTheme.isDesktop(context) + ? AppDesktopMetrics.panelHeader + : CompactPanelTabs.height, categoryControls: (context, categories, selected, onSelected) => CompactPanelTabs( values: categories, diff --git a/lib/features/properties/property_number_input.dart b/lib/features/properties/property_number_input.dart index 0f800ca..8154290 100644 --- a/lib/features/properties/property_number_input.dart +++ b/lib/features/properties/property_number_input.dart @@ -2,7 +2,10 @@ import 'package:cutdex/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import '../../shared/state/operation_scope.dart'; + import 'package:cutdex_ui/widgets.dart'; +import 'package:cutdex_ui/theme.dart'; class PropertyNumberInput extends StatefulWidget { const PropertyNumberInput({ @@ -13,6 +16,10 @@ class PropertyNumberInput extends StatefulWidget { required this.readOnly, required this.submit, this.unit, + this.inlineLabel = false, + this.prefix, + this.prefixIcon, + this.labelActions = const [], this.decimalPlaces = 2, this.onScrubStart, required this.onScrubUpdate, @@ -23,6 +30,10 @@ class PropertyNumberInput extends StatefulWidget { }) : assert(decimalPlaces >= 0 && decimalPlaces <= 20); final String? label; final String? unit; + final bool inlineLabel; + final String? prefix; + final IconData? prefixIcon; + final List labelActions; final int decimalPlaces; final bool Function()? onScrubStart; final ValueChanged onScrubUpdate; @@ -42,6 +53,7 @@ class _PropertyNumberInputState extends State { late final _text = TextEditingController(text: _format(widget.value)); final _focus = FocusNode(); bool _dirty = false; + late final _operations = OperationScope(widget.editContext); String? _error; String _format(double value) { var text = value.toStringAsFixed(widget.decimalPlaces); @@ -67,8 +79,9 @@ class _PropertyNumberInputState extends State { return; } _dirty = false; + final isCurrent = _operations.begin(); final accepted = await widget.submit(value); - if (!mounted) return; + if (!mounted || !isCurrent()) return; setState(() { _error = accepted ? null : context.l10n.notApplied; _text.text = _format(widget.value); @@ -78,6 +91,7 @@ class _PropertyNumberInputState extends State { @override void didUpdateWidget(covariant PropertyNumberInput oldWidget) { super.didUpdateWidget(oldWidget); + _operations.bind(widget.editContext); if ((oldWidget.enabled && !widget.enabled) || oldWidget.editContext != widget.editContext || (!oldWidget.readOnly && widget.readOnly)) { @@ -92,6 +106,7 @@ class _PropertyNumberInputState extends State { @override void dispose() { + _operations.dispose(); _focus.removeListener(_blur); _focus.dispose(); _text.dispose(); @@ -99,21 +114,34 @@ class _PropertyNumberInputState extends State { } @override - Widget build(BuildContext context) => Focus( - onKeyEvent: (_, event) { - if (event is KeyDownEvent && - event.logicalKey == LogicalKeyboardKey.escape) { - setState(() { - _dirty = false; - _error = null; - _text.text = _format(widget.value); - }); - _focus.unfocus(); - return KeyEventResult.handled; - } - return KeyEventResult.ignored; - }, - child: AppTextField( + Widget build(BuildContext context) { + final labelAbove = + AppTheme.isCompactInspector(context) && !widget.inlineLabel; + final label = widget.onScrubStart == null + ? Text(widget.label ?? '', style: AppTheme.propertyLabelStyle(context)) + : AppScrubLabel( + label: widget.prefix ?? widget.label!, + icon: widget.prefixIcon, + style: labelAbove + ? AppTheme.propertySectionTitleStyle(context) + : null, + alignment: labelAbove ? Alignment.centerLeft : Alignment.center, + padding: labelAbove + ? EdgeInsets.zero + : const EdgeInsets.symmetric(horizontal: AppSpacing.small), + enabled: widget.enabled && (!widget.readOnly || widget.scrubbing), + onStart: () { + _operations.invalidate(); + _dirty = false; + _error = null; + _text.text = _format(widget.value); + return widget.onScrubStart!(); + }, + onUpdate: widget.onScrubUpdate, + onEnd: widget.onScrubEnd, + onCancel: widget.onScrubCancel, + ); + final input = AppTextField( controller: _text, focusNode: _focus, enabled: widget.enabled, @@ -124,29 +152,35 @@ class _PropertyNumberInputState extends State { signed: true, ), label: widget.label, - leading: widget.onScrubStart == null - ? null - : AppScrubLabel( - label: widget.label!, - enabled: widget.enabled && (!widget.readOnly || widget.scrubbing), - onStart: () { - _dirty = false; - _error = null; - _text.text = _format(widget.value); - return widget.onScrubStart!(); - }, - onUpdate: widget.onScrubUpdate, - onEnd: widget.onScrubEnd, - onCancel: widget.onScrubCancel, - ), + labelAbove: labelAbove, + labelActions: widget.labelActions, + leading: widget.onScrubStart == null ? null : label, unit: widget.unit, errorText: _error, onChanged: (_) { + _operations.invalidate(); _dirty = true; if (_error != null) setState(() => _error = null); }, onEditingComplete: () {}, onSubmitted: (_) => _submit(), - ), - ); + ); + return Focus( + onKeyEvent: (_, event) { + if (event is KeyDownEvent && + event.logicalKey == LogicalKeyboardKey.escape) { + setState(() { + _operations.invalidate(); + _dirty = false; + _error = null; + _text.text = _format(widget.value); + }); + _focus.unfocus(); + return KeyEventResult.handled; + } + return KeyEventResult.ignored; + }, + child: input, + ); + } } diff --git a/lib/features/properties/speed_properties.dart b/lib/features/properties/speed_properties.dart index 3f11bc6..8ca0484 100644 --- a/lib/features/properties/speed_properties.dart +++ b/lib/features/properties/speed_properties.dart @@ -1,3 +1,5 @@ +import '../../shared/widgets/listenable_selector.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import 'dart:math' as math; @@ -10,6 +12,7 @@ import 'package:flutter/material.dart'; import '../../l10n/l10n.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -139,8 +142,37 @@ class _SpeedPropertiesState extends State { @override Widget build(BuildContext context) { final view = widget.session.view(widget.sequence); - return ListenableBuilder( + return ListenableSelector( listenable: Listenable.merge([view, widget.session]), + select: () { + final query = view.version.kernelVersion.query(); + final handle = query.elementById(widget.clip); + final record = handle == null ? null : query.element(handle); + final segments = record == null + ? null + : widget.session.clipSpeedSegments(record); + final custom = widget.session.isCustomSpeedEnabled( + widget.sequence, + widget.clip, + ); + final tick = handle == null + ? 0 + : view.playheadTick - query.absoluteStart(handle); + final split = + custom && + segments != null && + tick > 0 && + tick < record!.duration && + !segments.any((segment) => segment.projectStart == tick); + return ( + record, + custom, + split, + widget.session.acceptsEdits, + view.isDragging, + _version == null || identical(_version, view.version.kernelVersion), + ); + }, builder: (context, _) { final query = view.version.kernelVersion.query(); final handle = query.elementById(widget.clip); @@ -173,41 +205,54 @@ class _SpeedPropertiesState extends State { ? _timeline ?? saved ?? 1 : saved ?? 1; return Padding( - padding: AppSpacing.panelSection, + padding: AppTheme.propertySectionPadding(context), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Row( - children: [ - Expanded( - child: Text( - context.l10n.speed, - style: AppTheme.propertySectionTitleStyle(context), + ConstrainedBox( + constraints: BoxConstraints( + minHeight: AppTheme.isDesktop(context) + ? AppInspectorMetrics.action + : AppControlSize.propertyControl, + ), + child: Row( + children: [ + Expanded( + child: Text( + context.l10n.speed, + style: AppTheme.propertySectionTitleStyle(context), + ), ), - ), - Text( - saved == null && segments != null - ? context.l10n.segmentedSpeed - : '${value.toStringAsFixed(2)}×', - key: const Key('clip-speed-value'), - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Theme.of(context).colorScheme.onSurfaceVariant, + Text( + saved == null && segments != null + ? context.l10n.segmentedSpeed + : '${value.toStringAsFixed(2)}×', + key: const Key('clip-speed-value'), + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), ), - ), - const SizedBox(width: AppSpacing.small), - TextButton( - onPressed: canReset - ? () { - _version = null; - _commit(1); - } - : null, - child: const Text('1×'), - ), - ], + SizedBox(width: AppTheme.propertyRowGap(context)), + TextButton( + style: AppTheme.isDesktop(context) + ? TextButton.styleFrom( + minimumSize: const Size(24, 24), + padding: EdgeInsets.zero, + ) + : null, + onPressed: canReset + ? () { + _version = null; + _commit(1); + } + : null, + child: const Text('1×'), + ), + ], + ), ), if (saved != null) ...[ - const SizedBox(height: AppSpacing.small), + SizedBox(height: AppTheme.propertyRowGap(context)), AppSlider( key: const Key('clip-speed-slider'), value: ((math.log(value.clamp(0.1, 100)) / math.ln10 + 1) / 3) @@ -252,64 +297,140 @@ class _SpeedPropertiesState extends State { context.l10n.speedSegmentCount(segments.length), style: Theme.of(context).textTheme.bodySmall, ), - const SizedBox(height: AppSpacing.small), - Row( - children: [ - Expanded( - child: Text( - context.l10n.custom, - style: AppTheme.propertySectionTitleStyle(context), + SizedBox( + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.groupGap + : AppSpacing.small, + ), + if (AppTheme.isDesktop(context)) + AppPropertyGroup( + label: context.l10n.custom, + actions: [ + AppSwitch( + key: const Key('clip-custom-speed-toggle'), + value: custom, + semanticLabel: context.l10n.custom, + onChanged: canReset + ? (value) { + _discardPreview(); + setState(() { + _timeline = null; + _version = null; + }); + widget.session.setCustomSpeedEnabled( + widget.sequence, + widget.clip, + value, + ); + } + : null, + ), + ], + child: SizedBox( + width: double.infinity, + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.input + : AppControlSize.propertyControl, + child: OutlinedButton.icon( + key: const Key('split-speed-segment'), + onPressed: canSplit + ? () { + try { + final current = view.version.kernelVersion + .query(); + final target = current.elementById(widget.clip); + if (target == null) return; + widget.session.splitClipSpeedAt( + widget.sequence, + widget.clip, + view.playheadTick - + current.absoluteStart(target), + ); + } catch (error) { + ErrorNotificationHost.of(context).show( + ErrorNotification( + content: Text( + context.l10n.errorMessage(error), + ), + details: error.toString(), + ), + ); + } + } + : null, + icon: const Icon(AppIcons.cut), + label: Text(context.l10n.splitSpeedAtPlayhead), ), ), - AppSwitch( - key: const Key('clip-custom-speed-toggle'), - value: custom, - semanticLabel: context.l10n.custom, - onChanged: canReset - ? (value) { - _discardPreview(); - setState(() { - _timeline = null; - _version = null; - }); - widget.session.setCustomSpeedEnabled( - widget.sequence, - widget.clip, - value, - ); + ) + else ...[ + Row( + children: [ + Expanded( + child: Text( + context.l10n.custom, + style: AppTheme.propertySectionTitleStyle(context), + ), + ), + AppSwitch( + key: const Key('clip-custom-speed-toggle'), + value: custom, + semanticLabel: context.l10n.custom, + onChanged: canReset + ? (value) { + _discardPreview(); + setState(() { + _timeline = null; + _version = null; + }); + widget.session.setCustomSpeedEnabled( + widget.sequence, + widget.clip, + value, + ); + } + : null, + ), + ], + ), + SizedBox(height: AppTheme.propertyRowGap(context)), + SizedBox( + width: double.infinity, + height: AppTheme.isDesktop(context) + ? AppInspectorMetrics.input + : AppControlSize.propertyControl, + child: OutlinedButton.icon( + key: const Key('split-speed-segment'), + onPressed: canSplit + ? () { + try { + final current = view.version.kernelVersion + .query(); + final target = current.elementById(widget.clip); + if (target == null) return; + widget.session.splitClipSpeedAt( + widget.sequence, + widget.clip, + view.playheadTick - + current.absoluteStart(target), + ); + } catch (error) { + ErrorNotificationHost.of(context).show( + ErrorNotification( + content: Text( + context.l10n.errorMessage(error), + ), + details: error.toString(), + ), + ); + } } : null, + icon: const Icon(AppIcons.cut), + label: Text(context.l10n.splitSpeedAtPlayhead), ), - ], - ), - const SizedBox(height: AppSpacing.small), - SizedBox( - width: double.infinity, - height: AppControlSize.propertyControl, - child: OutlinedButton.icon( - key: const Key('split-speed-segment'), - onPressed: canSplit - ? () { - try { - widget.session.splitClipSpeedAt( - widget.sequence, - widget.clip, - localPlayhead, - ); - } catch (error) { - ErrorNotificationHost.of(context).show( - ErrorNotification( - content: Text(context.l10n.errorMessage(error)), - details: error.toString(), - ), - ); - } - } - : null, - icon: const Icon(Icons.content_cut), - label: Text(context.l10n.splitSpeedAtPlayhead), ), - ), + ], if (segments == null) Text( context.l10n.speedNotAvailable, diff --git a/lib/features/settings/agent_settings_panel.dart b/lib/features/settings/agent_settings_panel.dart index ede5957..cdf0451 100644 --- a/lib/features/settings/agent_settings_panel.dart +++ b/lib/features/settings/agent_settings_panel.dart @@ -7,6 +7,7 @@ import '../../integrations/agent/agent_settings.dart'; import '../../integrations/agent/agent_models.dart'; import '../../l10n/l10n.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -115,7 +116,10 @@ class _AgentSettingsPanelState extends ConsumerState ); Widget _buildContent(BuildContext context) { - ref.watch(settingsOperationProvider('agent-save')); + ref.watch( + settingsOperationProvider('agent-save') + .select((value) => value.isLoading), + ); final settings = ref.watch(agentSettingsProvider); return ScrollConfiguration( behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false), @@ -144,12 +148,12 @@ class _AgentSettingsPanelState extends ConsumerState : SettingsPageSection( key: const Key('agent-provider-list'), title: context.l10n.agentSettings, - icon: Icons.auto_awesome_outlined, + icon: AppIcons.assistant, action: OutlinedButton.icon( onPressed: settings.asData == null ? null : () => _showProviderForm(true), - icon: const Icon(Icons.add), + icon: const Icon(AppIcons.add), label: Text(context.l10n.agentAddProvider), ), children: [ @@ -191,9 +195,9 @@ class _ProviderCard extends StatelessWidget { final theme = Theme.of(context); final colors = theme.colorScheme; final icon = switch (provider.apiType) { - 'anthropicMessages' => Icons.auto_awesome_outlined, - 'openAiResponses' => Icons.bolt_outlined, - _ => Icons.forum_outlined, + 'anthropicMessages' => AppIcons.assistant, + 'openAiResponses' => AppIcons.lightning, + _ => AppIcons.conversations, }; return Container( padding: EdgeInsets.zero, @@ -231,7 +235,7 @@ class _ProviderCard extends StatelessWidget { key: ValueKey('agent-provider-edit-${provider.id}'), tooltip: context.l10n.agentEditProvider, onPressed: onEdit, - icon: const Icon(Icons.edit_outlined, size: AppIconSize.header), + icon: const Icon(AppIcons.edit, size: AppIconSize.header), ), const SizedBox(width: 8), AppSwitch( @@ -247,7 +251,7 @@ class _ProviderCard extends StatelessWidget { } TextStyle _providerInputStyle(BuildContext context) => - Theme.of(context).textTheme.bodyMedium!; + AppTheme.inputTextStyle(context); InputDecoration _providerInputDecoration( BuildContext context, { @@ -341,7 +345,7 @@ class _ProviderEditorState extends State<_ProviderEditor> { TextButton.icon( key: const Key('agent-provider-back'), onPressed: widget.saving ? null : widget.onBack, - icon: const Icon(Icons.arrow_back, size: 16), + icon: const Icon(AppIcons.arrowBack, size: 16), label: Text(context.l10n.agentBackToProviders), ), ], @@ -363,10 +367,11 @@ class _ProviderEditorState extends State<_ProviderEditor> { child: TextFormField( style: _providerInputStyle(context), textAlignVertical: TextAlignVertical.center, - cursorHeight: 18, + cursorHeight: AppTheme.inputCursorHeight(context), cursorWidth: 1.5, strutStyle: StrutStyle.fromTextStyle( _providerInputStyle(context), + forceStrutHeight: true, ), key: const Key('agent-provider-name'), controller: _name, @@ -403,10 +408,11 @@ class _ProviderEditorState extends State<_ProviderEditor> { child: TextFormField( style: _providerInputStyle(context), textAlignVertical: TextAlignVertical.center, - cursorHeight: 18, + cursorHeight: AppTheme.inputCursorHeight(context), cursorWidth: 1.5, strutStyle: StrutStyle.fromTextStyle( _providerInputStyle(context), + forceStrutHeight: true, ), key: const Key('agent-provider-base-url'), controller: _baseUrl, @@ -434,10 +440,11 @@ class _ProviderEditorState extends State<_ProviderEditor> { child: TextFormField( style: _providerInputStyle(context), textAlignVertical: TextAlignVertical.center, - cursorHeight: 18, + cursorHeight: AppTheme.inputCursorHeight(context), cursorWidth: 1.5, strutStyle: StrutStyle.fromTextStyle( _providerInputStyle(context), + forceStrutHeight: true, ), key: const Key('agent-provider-api-key'), controller: _apiKey, @@ -495,7 +502,7 @@ class _ProviderEditorState extends State<_ProviderEditor> { onPressed: () => setState( () => _models = [..._models, _ModelControllers()], ), - icon: const Icon(Icons.add, size: AppIconSize.header), + icon: const Icon(AppIcons.add, size: AppIconSize.header), label: Text(context.l10n.agentAddModel), ), ), @@ -610,9 +617,12 @@ class _ModelFields extends StatelessWidget { child: TextFormField( style: _providerInputStyle(context), textAlignVertical: TextAlignVertical.center, - cursorHeight: 18, + cursorHeight: AppTheme.inputCursorHeight(context), cursorWidth: 1.5, - strutStyle: StrutStyle.fromTextStyle(_providerInputStyle(context)), + strutStyle: StrutStyle.fromTextStyle( + _providerInputStyle(context), + forceStrutHeight: true, + ), key: Key('agent-model-id-$index'), controller: controllers.id, decoration: _providerInputDecoration( @@ -627,9 +637,12 @@ class _ModelFields extends StatelessWidget { child: TextFormField( style: _providerInputStyle(context), textAlignVertical: TextAlignVertical.center, - cursorHeight: 18, + cursorHeight: AppTheme.inputCursorHeight(context), cursorWidth: 1.5, - strutStyle: StrutStyle.fromTextStyle(_providerInputStyle(context)), + strutStyle: StrutStyle.fromTextStyle( + _providerInputStyle(context), + forceStrutHeight: true, + ), key: Key('agent-model-context-$index'), controller: controllers.contextWindow, keyboardType: TextInputType.number, @@ -642,9 +655,12 @@ class _ModelFields extends StatelessWidget { child: TextFormField( style: _providerInputStyle(context), textAlignVertical: TextAlignVertical.center, - cursorHeight: 18, + cursorHeight: AppTheme.inputCursorHeight(context), cursorWidth: 1.5, - strutStyle: StrutStyle.fromTextStyle(_providerInputStyle(context)), + strutStyle: StrutStyle.fromTextStyle( + _providerInputStyle(context), + forceStrutHeight: true, + ), key: Key('agent-model-output-$index'), controller: controllers.maxOutputTokens, keyboardType: TextInputType.number, @@ -678,7 +694,7 @@ class _ModelFields extends StatelessWidget { ), tooltip: context.l10n.agentDeleteModel, onPressed: canDelete ? onDelete : null, - icon: const Icon(Icons.delete_outline, size: AppIconSize.header), + icon: const Icon(AppIcons.delete, size: AppIconSize.header), ), ); return LayoutBuilder( diff --git a/lib/features/settings/appearance_settings.dart b/lib/features/settings/appearance_settings.dart index 1c751a7..f6e2a2e 100644 --- a/lib/features/settings/appearance_settings.dart +++ b/lib/features/settings/appearance_settings.dart @@ -33,3 +33,20 @@ class AppearanceSettings extends _$AppearanceSettings { if (ref.mounted) state = AsyncData(appearance); }); } + +@Riverpod(keepAlive: true) +class PaletteSettings extends _$PaletteSettings { + final _writes = SettingsWriteQueue(); + + @override + Future build() => + ref.watch(paletteSettingsRepositoryProvider).load(); + + Future setPalette(AppPalette palette) => _writes.run(() async { + if (!ref.mounted) return; + await future; + if (!ref.mounted) return; + await ref.read(paletteSettingsRepositoryProvider).save(palette); + if (ref.mounted) state = AsyncData(palette); + }); +} diff --git a/lib/features/settings/appearance_settings.g.dart b/lib/features/settings/appearance_settings.g.dart index 6e5731b..0702913 100644 --- a/lib/features/settings/appearance_settings.g.dart +++ b/lib/features/settings/appearance_settings.g.dart @@ -53,3 +53,47 @@ abstract class _$AppearanceSettings extends $AsyncNotifier { return element.handleCreate(ref, build); } } + +@ProviderFor(PaletteSettings) +final paletteSettingsProvider = PaletteSettingsProvider._(); + +final class PaletteSettingsProvider + extends $AsyncNotifierProvider { + PaletteSettingsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'paletteSettingsProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$paletteSettingsHash(); + + @$internal + @override + PaletteSettings create() => PaletteSettings(); +} + +String _$paletteSettingsHash() => r'95eecd4a35c8de3afbf6c94b1e13f282acb0f4ff'; + +abstract class _$PaletteSettings extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + WhenComplete runBuild() { + final ref = this.ref as $Ref, AppPalette>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, AppPalette>, + AsyncValue, + Object?, + Object? + >; + return element.handleCreate(ref, build); + } +} diff --git a/lib/features/settings/mcp_settings_panel.dart b/lib/features/settings/mcp_settings_panel.dart index 266fb45..7b0f5ee 100644 --- a/lib/features/settings/mcp_settings_panel.dart +++ b/lib/features/settings/mcp_settings_panel.dart @@ -5,12 +5,14 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../integrations/editor_tools.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:cutdex_ui/theme.dart'; import '../../integrations/mcp/mcp_settings.dart'; import 'settings_layout.dart'; import '../../settings/settings_operation.dart'; +import '../../shared/widgets/error_notification_host.dart'; class McpSettingsPanel extends ConsumerStatefulWidget { const McpSettingsPanel({super.key, this.workspace}); @@ -53,38 +55,42 @@ class _McpSettingsPanelState extends ConsumerState { final settings = ref.watch(mcpSettingsProvider); final value = settings.asData?.value; final ids = widget.workspace; - final connection = ids == null - ? null - : ref.watch(editorMcpConnectionProvider(ids.$1, ids.$2)); - final status = value?.enabled != true - ? context.l10n.disabled - : ids == null - ? context.l10n.waitingForProject - : connection!.hasError - ? context.l10n.startFailed - : connection.isLoading - ? context.l10n.starting - : context.l10n.running; return SettingsPageSection( title: 'MCP', - icon: Icons.terminal_outlined, + icon: AppIcons.terminal, children: [ - AppField( - label: context.l10n.mcpService, - description: settings.isLoading - ? context.l10n.loadingSettings - : status, - orientation: AppFieldOrientation.horizontal, - child: Align( - alignment: AlignmentDirectional.centerEnd, - child: AppSwitch( - semanticLabel: context.l10n.mcpService, - value: value?.enabled ?? false, - onChanged: value == null || operation.isLoading - ? null - : (enabled) => _toggle(enabled, value), - ), - ), + Consumer( + builder: (context, ref, _) { + final connection = ids == null + ? null + : ref.watch(editorMcpConnectionProvider(ids.$1, ids.$2)); + final status = value?.enabled != true + ? context.l10n.disabled + : ids == null + ? context.l10n.waitingForProject + : connection!.hasError + ? context.l10n.startFailed + : connection.isLoading + ? context.l10n.starting + : context.l10n.running; + return AppField( + label: context.l10n.mcpService, + description: settings.isLoading + ? context.l10n.loadingSettings + : status, + orientation: AppFieldOrientation.horizontal, + child: Align( + alignment: AlignmentDirectional.centerEnd, + child: AppSwitch( + semanticLabel: context.l10n.mcpService, + value: value?.enabled ?? false, + onChanged: value == null || operation.isLoading + ? null + : (enabled) => _toggle(enabled, value), + ), + ), + ); + }, ), if (value != null) ...[ AppField( @@ -95,6 +101,7 @@ class _McpSettingsPanelState extends ConsumerState { child: TextFormField( style: AppTheme.inputTextStyle(context), cursorHeight: AppTheme.inputCursorHeight(context), + textAlignVertical: TextAlignVertical.center, initialValue: '${value.port}', enabled: !value.enabled && !operation.isLoading, keyboardType: TextInputType.number, @@ -111,13 +118,13 @@ class _McpSettingsPanelState extends ConsumerState { label: context.l10n.accessToken, child: IconButton( tooltip: context.l10n.copyAccessToken, - icon: const Icon(Icons.copy_outlined), + icon: const Icon(AppIcons.copy), onPressed: () async { await Clipboard.setData(ClipboardData(text: value.token)); if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text(context.l10n.accessTokenCopied)), - ); + ErrorNotificationHost.of( + context, + ).showMessage(content: Text(context.l10n.accessTokenCopied)); } }, ), @@ -128,22 +135,35 @@ class _McpSettingsPanelState extends ConsumerState { onPressed: () => ref.invalidate(mcpSettingsProvider), child: Text(context.l10n.loadMcpFailed), ), - if (value?.enabled == true && connection?.hasError == true) ...[ - Text( - context.l10n.mcpStartError( - context.l10n.errorMessage(connection!.error!), - ), - style: TextStyle(color: Theme.of(context).colorScheme.error), - ), - TextButton( - onPressed: operation.isLoading + Consumer( + builder: (context, ref, _) { + final connection = ids == null ? null - : () => ref.invalidate( - editorMcpConnectionProvider(ids!.$1, ids.$2), + : ref.watch(editorMcpConnectionProvider(ids.$1, ids.$2)); + if (value?.enabled != true || connection?.hasError != true) { + return const SizedBox.shrink(); + } + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + context.l10n.mcpStartError( + context.l10n.errorMessage(connection!.error!), ), - child: Text(context.l10n.retryStart), - ), - ], + style: TextStyle(color: Theme.of(context).colorScheme.error), + ), + TextButton( + onPressed: operation.isLoading + ? null + : () => ref.invalidate( + editorMcpConnectionProvider(ids!.$1, ids.$2), + ), + child: Text(context.l10n.retryStart), + ), + ], + ); + }, + ), if (error != null) Text( error, diff --git a/lib/features/settings/settings_content.dart b/lib/features/settings/settings_content.dart index c19888b..6d79f8b 100644 --- a/lib/features/settings/settings_content.dart +++ b/lib/features/settings/settings_content.dart @@ -9,10 +9,12 @@ import '../../shared/layout/workspace_layout_metrics.dart'; import '../../workspace/persistence/project_location_directory.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import 'appearance_settings.dart'; +import 'timeline_ruler_settings_field.dart'; import 'language_settings.dart'; import 'location_settings.dart'; import 'mcp_settings_panel.dart'; @@ -31,11 +33,13 @@ class SettingsContent extends ConsumerStatefulWidget { this.initialTab = 0, this.navigationRequest = 0, this.cardLayout = false, - }) : assert(initialTab >= 0 && initialTab <= 2); + this.onBack, + }) : assert(initialTab >= 0 && initialTab <= 3); final int initialTab; final int navigationRequest; final bool cardLayout; + final VoidCallback? onBack; final (String, String)? workspace; @@ -68,6 +72,14 @@ class _SettingsContentState extends ConsumerState { ); } + Future _setPalette(AppPalette palette) async { + await ref + .read(settingsOperationProvider('palette').notifier) + .run( + () => ref.read(paletteSettingsProvider.notifier).setPalette(palette), + ); + } + Future _setLanguage(AppLanguage language) async { await ref .read(settingsOperationProvider('language').notifier) @@ -84,10 +96,6 @@ class _SettingsContentState extends ConsumerState { ); Widget _buildContent(BuildContext context) { - final appearanceSave = ref.watch(settingsOperationProvider('appearance')); - final languageSave = ref.watch(settingsOperationProvider('language')); - final appearance = ref.watch(appearanceSettingsProvider); - final language = ref.watch(languageSettingsProvider); return LayoutBuilder( builder: (context, constraints) => Row( crossAxisAlignment: CrossAxisAlignment.stretch, @@ -103,6 +111,7 @@ class _SettingsContentState extends ConsumerState { _SettingsNavigation( value: _tab, compact: constraints.maxWidth < 600, + onBack: widget.onBack, onChanged: (value) => setState(() => _tab = value), ), ), @@ -113,11 +122,9 @@ class _SettingsContentState extends ConsumerState { width: WorkspaceLayoutMetrics.desktopSpacing, ) else - VerticalDivider( - key: const Key('settings-sidebar-divider'), + const VerticalDivider( + key: Key('settings-sidebar-divider'), width: 1, - thickness: 1, - color: Theme.of(context).colorScheme.outlineVariant, ), Expanded( child: _surface( @@ -136,86 +143,58 @@ class _SettingsContentState extends ConsumerState { padding: _settingsContentPadding, child: SettingsPageSection( title: context.l10n.general, - icon: Icons.settings_outlined, + icon: AppIcons.settings, children: [ - AppField( - label: context.l10n.appearance, - orientation: AppFieldOrientation.horizontal, - error: - (appearanceSave.hasError - ? context.l10n.saveAppearanceFailed - : null) ?? - (appearance.hasError - ? context.l10n.loadAppearanceFailed - : null), - child: SizedBox( - width: AppSettingsMetrics.controlWidth, - child: AppSelect( - emptyLabel: context.l10n.noMatchingOptions, - controlHeight: - AppSettingsMetrics.controlHeight, - value: - appearance.asData?.value ?? - AppAppearance.system, - label: context.l10n.theme, - options: [ - AppSelectOption( - AppAppearance.system, - context.l10n.system, - ), - AppSelectOption( - AppAppearance.penLight, - 'Pen · ${context.l10n.light}', - ), - AppSelectOption( - AppAppearance.penDark, - 'Pen · ${context.l10n.dark}', - ), - ], - onChanged: - appearanceSave.isLoading || - appearance.isLoading - ? null - : _setMode, - ), - ), - ), - AppField( - label: context.l10n.language, - orientation: AppFieldOrientation.horizontal, - error: - (languageSave.hasError - ? context.l10n.saveLanguageFailed - : null) ?? - (language.hasError - ? context.l10n.loadLanguageFailed - : null), - child: SizedBox( - width: AppSettingsMetrics.controlWidth, - child: AppSelect( - emptyLabel: context.l10n.noMatchingOptions, - controlHeight: - AppSettingsMetrics.controlHeight, - value: - language.asData?.value ?? - AppLanguage.system, + Consumer( + builder: (context, ref, _) { + final language = ref.watch( + languageSettingsProvider, + ); + final languageSave = ref.watch( + settingsOperationProvider('language'), + ); + return AppField( label: context.l10n.language, - options: [ - for (final option in AppLanguage.values) - AppSelectOption( - option, - option == AppLanguage.system - ? context.l10n.system - : option.nativeName, - ), - ], - onChanged: - languageSave.isLoading || - language.isLoading - ? null - : _setLanguage, - ), - ), + orientation: AppFieldOrientation.horizontal, + error: + (languageSave.hasError + ? context.l10n.saveLanguageFailed + : null) ?? + (language.hasError + ? context.l10n.loadLanguageFailed + : null), + child: SizedBox( + width: AppSettingsMetrics.controlWidth, + child: AppSelect( + emptyLabel: + context.l10n.noMatchingOptions, + controlHeight: + AppTheme.isDesktop(context) + ? AppDesktopMetrics.button + : AppSettingsMetrics.controlHeight, + value: + language.asData?.value ?? + AppLanguage.system, + label: context.l10n.language, + options: [ + for (final option + in AppLanguage.values) + AppSelectOption( + option, + option == AppLanguage.system + ? context.l10n.system + : option.nativeName, + ), + ], + onChanged: + languageSave.isLoading || + language.isLoading + ? null + : _setLanguage, + ), + ), + ); + }, ), const _ProjectLocationField(), const _ResourceLocationField(), @@ -246,6 +225,136 @@ class _SettingsContentState extends ConsumerState { ), ), ), + ExcludeFocus( + excluding: _tab != 3, + child: TickerMode( + enabled: _tab == 3, + child: SingleChildScrollView( + primary: false, + padding: _settingsContentPadding, + child: SettingsPageSection( + title: context.l10n.appearance, + icon: AppIcons.appearance, + children: [ + Consumer( + builder: (context, ref, _) { + final palette = ref.watch( + paletteSettingsProvider, + ); + final paletteSave = ref.watch( + settingsOperationProvider('palette'), + ); + return AppField( + label: context.l10n.colorPalette, + orientation: AppFieldOrientation.horizontal, + error: + (paletteSave.hasError + ? context.l10n.saveAppearanceFailed + : null) ?? + (palette.hasError + ? context.l10n.loadAppearanceFailed + : null), + child: SizedBox( + width: AppSettingsMetrics.controlWidth, + child: AppSelect( + key: const Key( + 'settings-color-palette', + ), + emptyLabel: + context.l10n.noMatchingOptions, + controlHeight: + AppTheme.isDesktop(context) + ? AppDesktopMetrics.button + : AppSettingsMetrics.controlHeight, + value: + palette.asData?.value ?? + AppPalette.graphite, + label: context.l10n.colorPalette, + options: [ + AppSelectOption( + AppPalette.graphite, + context.l10n.paletteGraphite, + ), + AppSelectOption( + AppPalette.violet, + context.l10n.paletteViolet, + ), + AppSelectOption( + AppPalette.teal, + context.l10n.paletteTeal, + ), + ], + onChanged: + paletteSave.isLoading || + palette.isLoading + ? null + : _setPalette, + ), + ), + ); + }, + ), + Consumer( + builder: (context, ref, _) { + final appearance = ref.watch( + appearanceSettingsProvider, + ); + final appearanceSave = ref.watch( + settingsOperationProvider('appearance'), + ); + return AppField( + label: context.l10n.theme, + orientation: AppFieldOrientation.horizontal, + error: + (appearanceSave.hasError + ? context.l10n.saveAppearanceFailed + : null) ?? + (appearance.hasError + ? context.l10n.loadAppearanceFailed + : null), + child: SizedBox( + width: AppSettingsMetrics.controlWidth, + child: AppSelect( + emptyLabel: + context.l10n.noMatchingOptions, + controlHeight: + AppTheme.isDesktop(context) + ? AppDesktopMetrics.button + : AppSettingsMetrics.controlHeight, + value: + appearance.asData?.value ?? + AppAppearance.system, + label: context.l10n.theme, + options: [ + AppSelectOption( + AppAppearance.system, + context.l10n.system, + ), + AppSelectOption( + AppAppearance.penLight, + context.l10n.light, + ), + AppSelectOption( + AppAppearance.penDark, + context.l10n.dark, + ), + ], + onChanged: + appearanceSave.isLoading || + appearance.isLoading + ? null + : _setMode, + ), + ), + ); + }, + ), + const TimelineRulerSettingsField(), + ], + ), + ), + ), + ), ], ), ), @@ -262,20 +371,36 @@ class _SettingsNavigation extends StatelessWidget { required this.value, required this.compact, required this.onChanged, + this.onBack, }); final int value; final bool compact; final ValueChanged onChanged; + final VoidCallback? onBack; @override Widget build(BuildContext context) { final theme = Theme.of(context); final entries = [ - (context.l10n.general, Icons.settings_outlined), - (context.l10n.agentSettings, Icons.auto_awesome_outlined), - ('MCP', Icons.terminal_outlined), + (0, context.l10n.general, AppIcons.settings), + (3, context.l10n.appearance, AppIcons.appearance), + (1, context.l10n.agentSettings, AppIcons.assistant), + (2, 'MCP', AppIcons.terminal), ]; + final title = Text( + context.l10n.settings, + style: theme.textTheme.titleSmall?.copyWith(fontSize: 16), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ); + final back = IconButton( + key: const Key('settings-sidebar-back'), + tooltip: MaterialLocalizations.of(context).backButtonTooltip, + onPressed: onBack, + style: AppTheme.projectTabActionStyle(context, size: 28), + icon: const Icon(AppIcons.arrowBack, size: 16), + ); return ColoredBox( key: const Key('settings-sidebar'), color: AppTheme.settingsSidebarBackground(context), @@ -284,26 +409,36 @@ class _SettingsNavigation extends StatelessWidget { children: [ Padding( padding: const EdgeInsets.fromLTRB(8, 0, 8, 20), - child: Text( - context.l10n.settings, - style: theme.textTheme.titleSmall?.copyWith(fontSize: 16), - ), + child: onBack == null + ? title + : compact + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [back, const SizedBox(height: 8), title], + ) + : Row( + children: [ + back, + const SizedBox(width: 8), + Expanded(child: title), + ], + ), ), for (var index = 0; index < entries.length; index++) Padding( padding: const EdgeInsets.only(bottom: 1), child: Semantics( - selected: value == index, + selected: value == entries[index].$1, child: Tooltip( - message: entries[index].$1, + message: entries[index].$2, child: TextButton( - key: ValueKey('settings-navigation-$index'), - onPressed: () => onChanged(index), + key: ValueKey('settings-navigation-${entries[index].$1}'), + onPressed: () => onChanged(entries[index].$1), style: TextButton.styleFrom( minimumSize: const Size(0, 30), padding: const EdgeInsets.symmetric(horizontal: 8), foregroundColor: theme.colorScheme.onSurface, - backgroundColor: value == index + backgroundColor: value == entries[index].$1 ? theme.colorScheme.onSurface.withValues(alpha: .078) : Colors.transparent, shape: RoundedRectangleBorder( @@ -314,12 +449,12 @@ class _SettingsNavigation extends StatelessWidget { child: Row( children: [ if (!compact) ...[ - Icon(entries[index].$2, size: 16), + Icon(entries[index].$3, size: 16), const SizedBox(width: 8), ], Expanded( child: Text( - entries[index].$1, + entries[index].$2, maxLines: 1, overflow: TextOverflow.ellipsis, ), diff --git a/lib/features/settings/settings_dialog.dart b/lib/features/settings/settings_dialog.dart index 0358e37..99b9108 100644 --- a/lib/features/settings/settings_dialog.dart +++ b/lib/features/settings/settings_dialog.dart @@ -24,7 +24,11 @@ class SettingsDialog extends StatelessWidget { height: math.min(704, math.max(520, viewport.height * .88)), contentOnly: true, scrollContent: false, - child: SettingsContent(workspace: workspace, initialTab: initialTab), + child: SettingsContent( + workspace: workspace, + initialTab: initialTab, + onBack: () => Navigator.of(context).pop(), + ), ), ); } diff --git a/lib/features/settings/settings_page.dart b/lib/features/settings/settings_page.dart index a73d337..117d894 100644 --- a/lib/features/settings/settings_page.dart +++ b/lib/features/settings/settings_page.dart @@ -49,6 +49,7 @@ class SettingsPage extends ConsumerWidget { final content = SettingsContent( workspace: workspace, initialTab: initialTab, + onBack: desktop ? back : null, ); if (!desktop) { return Scaffold( diff --git a/lib/features/settings/timeline_ruler_settings.dart b/lib/features/settings/timeline_ruler_settings.dart new file mode 100644 index 0000000..88a0807 --- /dev/null +++ b/lib/features/settings/timeline_ruler_settings.dart @@ -0,0 +1,27 @@ +import 'package:cutdex_sdk/timeline_ui.dart' show TimelineRulerTimecodeLayout; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +import '../../persistence/settings/timeline_ruler_settings_repository.dart'; +import '../../settings/settings_write_queue.dart'; + +export 'package:cutdex_sdk/timeline_ui.dart' show TimelineRulerTimecodeLayout; + +part 'timeline_ruler_settings.g.dart'; + +@Riverpod(keepAlive: true) +class TimelineRulerSettings extends _$TimelineRulerSettings { + final _writes = SettingsWriteQueue(); + + @override + Future build() => + ref.watch(timelineRulerSettingsRepositoryProvider).load(); + + Future setLayout(TimelineRulerTimecodeLayout layout) => + _writes.run(() async { + if (!ref.mounted) return; + await future; + if (!ref.mounted) return; + await ref.read(timelineRulerSettingsRepositoryProvider).save(layout); + if (ref.mounted) state = AsyncData(layout); + }); +} diff --git a/lib/features/settings/timeline_ruler_settings.g.dart b/lib/features/settings/timeline_ruler_settings.g.dart new file mode 100644 index 0000000..af9b110 --- /dev/null +++ b/lib/features/settings/timeline_ruler_settings.g.dart @@ -0,0 +1,68 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'timeline_ruler_settings.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(TimelineRulerSettings) +final timelineRulerSettingsProvider = TimelineRulerSettingsProvider._(); + +final class TimelineRulerSettingsProvider + extends + $AsyncNotifierProvider< + TimelineRulerSettings, + TimelineRulerTimecodeLayout + > { + TimelineRulerSettingsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'timelineRulerSettingsProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$timelineRulerSettingsHash(); + + @$internal + @override + TimelineRulerSettings create() => TimelineRulerSettings(); +} + +String _$timelineRulerSettingsHash() => + r'26aef397f2aee8114b1d1229bb1c0b3f7a377f73'; + +abstract class _$TimelineRulerSettings + extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + WhenComplete runBuild() { + final ref = + this.ref + as $Ref< + AsyncValue, + TimelineRulerTimecodeLayout + >; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + AsyncValue, + TimelineRulerTimecodeLayout + >, + AsyncValue, + Object?, + Object? + >; + return element.handleCreate(ref, build); + } +} diff --git a/lib/features/settings/timeline_ruler_settings_field.dart b/lib/features/settings/timeline_ruler_settings_field.dart new file mode 100644 index 0000000..4a827ad --- /dev/null +++ b/lib/features/settings/timeline_ruler_settings_field.dart @@ -0,0 +1,59 @@ +import 'package:cutdex/l10n/l10n.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../settings/settings_operation.dart'; +import 'timeline_ruler_settings.dart'; + +class TimelineRulerSettingsField extends ConsumerWidget { + const TimelineRulerSettingsField({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + if (!AppTheme.isDesktop(context)) return const SizedBox.shrink(); + final layout = ref.watch(timelineRulerSettingsProvider); + final save = ref.watch(settingsOperationProvider('timeline-ruler')); + return AppField( + label: context.l10n.timelineRulerStyle, + orientation: AppFieldOrientation.horizontal, + error: + (save.hasError ? context.l10n.saveAppearanceFailed : null) ?? + (layout.hasError ? context.l10n.loadAppearanceFailed : null), + child: SizedBox( + width: AppSettingsMetrics.controlWidth, + child: AppSelect( + key: const Key('settings-timeline-ruler-style'), + emptyLabel: context.l10n.noMatchingOptions, + controlHeight: AppDesktopMetrics.button, + value: layout.asData?.value ?? TimelineRulerTimecodeLayout.inline, + label: context.l10n.timelineRulerStyle, + options: [ + AppSelectOption( + TimelineRulerTimecodeLayout.inline, + context.l10n.timelineRulerInline, + ), + AppSelectOption( + TimelineRulerTimecodeLayout.centered, + context.l10n.timelineRulerCentered, + ), + AppSelectOption( + TimelineRulerTimecodeLayout.overlay, + context.l10n.timelineRulerOverlay, + ), + ], + onChanged: layout.isLoading || save.isLoading + ? null + : (value) => ref + .read(settingsOperationProvider('timeline-ruler').notifier) + .run( + () => ref + .read(timelineRulerSettingsProvider.notifier) + .setLayout(value), + ), + ), + ), + ); + } +} diff --git a/lib/features/timeline/editor_timeline_viewport.dart b/lib/features/timeline/editor_timeline_viewport.dart new file mode 100644 index 0000000..f98a55e --- /dev/null +++ b/lib/features/timeline/editor_timeline_viewport.dart @@ -0,0 +1,43 @@ +import 'package:cutdex_sdk/timeline_ui.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../settings/timeline_ruler_settings.dart'; + +class EditorTimelineViewport extends ConsumerWidget { + const EditorTimelineViewport({ + required this.controller, + required this.child, + this.leadingPadding = 0, + this.rulerTimecodeLayout, + super.key, + }); + + final TimelineViewController controller; + final Widget child; + final double leadingPadding; + final TimelineRulerTimecodeLayout? rulerTimecodeLayout; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final desktop = AppTheme.isDesktop(context); + var layout = rulerTimecodeLayout ?? TimelineRulerTimecodeLayout.inline; + if (desktop && rulerTimecodeLayout == null) { + layout = ref.watch( + timelineRulerSettingsProvider.select( + (value) => value.asData?.value ?? TimelineRulerTimecodeLayout.inline, + ), + ); + } + return TimelineViewport( + controller: controller, + leadingPadding: leadingPadding, + rulerStyle: desktop + ? TimelineRulerStyle.timecode + : TimelineRulerStyle.elapsed, + rulerTimecodeLayout: layout, + child: child, + ); + } +} diff --git a/lib/features/timeline/timeline_external_drop_target.dart b/lib/features/timeline/timeline_external_drop_target.dart index 4ed5763..990ed99 100644 --- a/lib/features/timeline/timeline_external_drop_target.dart +++ b/lib/features/timeline/timeline_external_drop_target.dart @@ -381,7 +381,15 @@ class TimelineExternalDropTargetState @override Widget build(BuildContext context) { TickerMode.valuesOf(context); - ref.watch(projectsProvider); + ref.watch( + projectsProvider.select( + (value) => ( + value.value?.activeProject?.id, + value.value?.projectBusy, + value.value?.timeline?.id, + ), + ), + ); ref.watch(_preparationProvider); ref.listen(_preparationProvider.select((state) => state.preparation), ( _, diff --git a/lib/features/timeline/timeline_panel.dart b/lib/features/timeline/timeline_panel.dart index fc30d0a..1fb0bfa 100644 --- a/lib/features/timeline/timeline_panel.dart +++ b/lib/features/timeline/timeline_panel.dart @@ -1,3 +1,5 @@ +import '../../shared/widgets/presentation_list.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import 'package:cutdex/l10n/l10n.dart'; import 'package:cutdex_sdk/timeline/engine.dart'; @@ -11,24 +13,30 @@ import 'package:cutdex_sdk/timeline_ui.dart'; import '../../shared/widgets/listenable_selector.dart'; import '../../workspace/timeline_provider.dart'; import '../../workspace/projects.dart'; +import '../../workspace/project_state.dart'; import '../../integrations/runtime/timeline_thumbnails.dart'; import '../../integrations/runtime/timeline_waveforms.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import '../editor/editor_panel_defaults.dart'; +import '../editor/timeline_operation_region.dart'; import '../media/transcription_dialog.dart'; +import '../media/media_browser_controller.dart'; import '../media/background_removal_dialog.dart'; import '../projects/widgets/name_dialog.dart'; import '../../workspace/timeline_session.dart'; import '../../workspace/preview_target.dart'; import 'timeline_asset_drop_target.dart'; +import 'editor_timeline_viewport.dart'; import 'timeline_speed_editor.dart'; class EditorTimelinePanel extends StatelessWidget { @@ -38,12 +46,18 @@ class EditorTimelinePanel extends StatelessWidget { required this.timelineId, this.pending = false, this.timelineLoading = false, + this.rulerTimecodeLayout, }); final String projectId; final String timelineId; final bool pending; + + /// Keeps the active surface visible while disabling edits during navigation. final bool timelineLoading; + /// An override of the desktop ruler layout selected in settings. + final TimelineRulerTimecodeLayout? rulerTimecodeLayout; + @override Widget build(BuildContext context) => Theme( data: AppTheme.timelinePanelTheme(Theme.of(context)), @@ -58,15 +72,15 @@ class EditorTimelinePanel extends StatelessWidget { ), const Divider(height: 1), Expanded( - child: timelineLoading - ? const EditorTimelineDefaults( - key: Key('timeline-pending'), - showTabs: false, - ) - : _TimelineSessionContent( - projectId: projectId, - timelineId: timelineId, - ), + child: TimelineOperationRegion( + projectId: projectId, + loading: timelineLoading, + child: _TimelineSessionContent( + projectId: projectId, + timelineId: timelineId, + rulerTimecodeLayout: rulerTimecodeLayout, + ), + ), ), ], ), @@ -82,16 +96,34 @@ class _TimelineTabsContent extends ConsumerWidget { final String timelineId; @override Widget build(BuildContext context, WidgetRef ref) { - final projectState = ref.watch(projectsProvider).asData?.value; - final timelines = projectState?.activeProject?.id == projectId - ? projectState!.timelines - : const []; + final tabs = ref.watch( + projectsProvider.select((value) { + final state = value.asData?.value; + final active = state?.activeProject?.id == projectId; + return ( + active + ? PresentationList( + state!.timelines.map( + (timeline) => (timeline.id, timeline.name, timeline.pinned), + ), + ) + : PresentationList<(String, String, bool)>(const []), + active ? state?.visibleTimelineId : null, + active && state?.creatingTimeline == true, + active ? state?.openingTimelineId : null, + ); + }), + ); return _TimelineTabsBar( projectId: projectId, - timelineId: timelineId, - timelines: timelines, - creating: projectState?.creatingTimeline ?? false, - openingTimelineId: projectState?.openingTimelineId, + timelineId: tabs.$2 ?? timelineId, + timelines: + ref.read(projectsProvider).asData?.value.activeProject?.id == + projectId + ? ref.read(projectsProvider).asData!.value.timelines + : const [], + creating: tabs.$3, + openingTimelineId: tabs.$4, ); } } @@ -100,9 +132,19 @@ class _TimelineSessionContent extends ConsumerWidget { const _TimelineSessionContent({ required this.projectId, required this.timelineId, + required this.rulerTimecodeLayout, }); final String projectId; final String timelineId; + final TimelineRulerTimecodeLayout? rulerTimecodeLayout; + + void _activateTimeline(WidgetRef ref) { + ref.read(mediaBrowserProvider(projectId)).selectedAssetId = null; + ref + .read(previewNavigationProvider(projectId, timelineId).notifier) + .showTimeline(); + } + @override Widget build(BuildContext context, WidgetRef ref) { final provider = editorTimelineProvider(projectId, timelineId); @@ -148,11 +190,14 @@ class _TimelineSessionContent extends ConsumerWidget { 'dart pointer-down', ); } - ref - .read(previewNavigationProvider(projectId, timelineId).notifier) - .showTimeline(); + _activateTimeline(ref); }, - child: _TimelineEditor(session: session, projectId: projectId), + child: _TimelineEditor( + session: session, + projectId: projectId, + rulerTimecodeLayout: rulerTimecodeLayout, + onSelectionActivated: () => _activateTimeline(ref), + ), ), ); } @@ -178,7 +223,10 @@ class _TimelineTabsBar extends ConsumerStatefulWidget { } class _TimelineTabsBarState extends ConsumerState<_TimelineTabsBar> { - static const _barHeight = 26.0; + double get _barHeight => + AppTheme.isDesktop(context) ? AppDesktopMetrics.timelineTabs : 26.0; + double get _tabHeight => + AppTheme.isDesktop(context) ? AppDesktopMetrics.timelineTabControl : 20; static const _menuWidth = 220.0; final _scrollController = ScrollController(); final _selectedMenuItemKey = GlobalKey(); @@ -320,117 +368,138 @@ class _TimelineTabsBarState extends ConsumerState<_TimelineTabsBar> { @override Widget build(BuildContext context) { + final desktop = AppTheme.isDesktop(context); + final actionHeight = desktop ? _tabHeight : _barHeight; + final actionStyle = desktop ? AppTheme.timelineTabActionStyle : null; + final addButton = SizedBox.square( + dimension: actionHeight, + child: IconButton( + key: const Key('timeline-add-button'), + tooltip: context.l10n.createTimelineHint, + onPressed: _createTimeline, + style: actionStyle, + padding: EdgeInsets.zero, + constraints: BoxConstraints.tightFor( + width: actionHeight, + height: actionHeight, + ), + icon: const Icon(AppIcons.add, size: AppIconSize.small), + ), + ); + final tabList = ScrollEdgeFade( + controller: _scrollController, + axis: Axis.horizontal, + child: Listener( + onPointerSignal: (event) { + if (event is! PointerScrollEvent || !_scrollController.hasClients) { + return; + } + final delta = event.scrollDelta.dy != 0 + ? event.scrollDelta.dy + : event.scrollDelta.dx; + if (delta == 0) return; + final position = _scrollController.position; + _scrollController.jumpTo( + (position.pixels + delta).clamp( + position.minScrollExtent, + position.maxScrollExtent, + ), + ); + }, + child: SingleChildScrollView( + key: const Key('timeline-tabs-list'), + controller: _scrollController, + scrollDirection: Axis.horizontal, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSpacing.tiny), + child: Row( + children: [ + for ( + var index = 0; + index < widget.timelines.length; + index++ + ) ...[ + if (index > 0) const SizedBox(width: AppSpacing.hairline), + _buildTab(context, widget.timelines[index]), + ], + ], + ), + ), + ), + ), + ); + final listButton = SizedBox.square( + dimension: actionHeight, + child: AppPopover( + width: _menuWidth, + maxHeight: 320, + alignment: AlignmentDirectional.bottomEnd, + child: SingleChildScrollView( + primary: false, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + for (final timeline in widget.timelines) + KeyedSubtree( + key: timeline.id == widget.timelineId + ? _selectedMenuItemKey + : null, + child: AppMenuItem( + key: ValueKey('timeline-menu-${timeline.id}'), + label: timeline.name, + selected: timeline.id == widget.timelineId, + selectOption: true, + onPressed: () => _openTimeline(timeline), + ), + ), + ], + ), + ), + builder: (context, toggle) => IconButton( + key: const Key('timeline-list-button'), + tooltip: context.l10n.timelines, + onPressed: () { + toggle(); + _showSelectedMenuItem(); + }, + padding: EdgeInsets.zero, + style: actionStyle, + constraints: BoxConstraints.tightFor( + width: actionHeight, + height: actionHeight, + ), + icon: const Icon(AppIcons.more, size: AppIconSize.small), + ), + ), + ); return ColoredBox( - color: Theme.of(context).colorScheme.surface, + key: const Key('timeline-tabs-background'), + color: AppTheme.timelineTabsBackground(context), child: SizedBox( key: const Key('timeline-tabs-bar'), height: _barHeight, child: Row( children: [ - SizedBox.square( - dimension: _barHeight, - child: IconButton( - key: const Key('timeline-add-button'), - tooltip: context.l10n.createTimelineHint, - onPressed: _createTimeline, - padding: EdgeInsets.zero, - constraints: const BoxConstraints.tightFor( - width: _barHeight, - height: _barHeight, - ), - icon: const Icon(Icons.add, size: AppIconSize.small), - ), - ), + if (!desktop) addButton, Expanded( - child: ScrollEdgeFade( - controller: _scrollController, - axis: Axis.horizontal, - child: Listener( - onPointerSignal: (event) { - if (event is! PointerScrollEvent || - !_scrollController.hasClients) { - return; - } - final delta = event.scrollDelta.dy != 0 - ? event.scrollDelta.dy - : event.scrollDelta.dx; - if (delta == 0) return; - final position = _scrollController.position; - _scrollController.jumpTo( - (position.pixels + delta).clamp( - position.minScrollExtent, - position.maxScrollExtent, - ), - ); - }, - child: SingleChildScrollView( - key: const Key('timeline-tabs-list'), - controller: _scrollController, - scrollDirection: Axis.horizontal, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: AppSpacing.tiny, - ), + child: desktop + ? Align( + alignment: AlignmentDirectional.centerStart, child: Row( + mainAxisSize: MainAxisSize.min, children: [ - for ( - var index = 0; - index < widget.timelines.length; - index++ - ) ...[ - if (index > 0) - const SizedBox(width: AppSpacing.hairline), - _buildTab(context, widget.timelines[index]), - ], + Flexible(child: tabList), + addButton, ], ), - ), - ), - ), - ), + ) + : tabList, ), - SizedBox.square( - dimension: _barHeight, - child: AppPopover( - width: _menuWidth, - maxHeight: 320, - alignment: AlignmentDirectional.bottomEnd, - child: SingleChildScrollView( - primary: false, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - for (final timeline in widget.timelines) - KeyedSubtree( - key: timeline.id == widget.timelineId - ? _selectedMenuItemKey - : null, - child: AppMenuItem( - key: ValueKey('timeline-menu-${timeline.id}'), - label: timeline.name, - selected: timeline.id == widget.timelineId, - selectOption: true, - onPressed: () => _openTimeline(timeline), - ), - ), - ], - ), - ), - builder: (context, toggle) => IconButton( - key: const Key('timeline-list-button'), - tooltip: context.l10n.timelines, - onPressed: () { - toggle(); - _showSelectedMenuItem(); - }, - padding: EdgeInsets.zero, - constraints: const BoxConstraints.tightFor( - width: _barHeight, - height: _barHeight, - ), - icon: const Icon(Icons.more_horiz, size: AppIconSize.small), - ), + Padding( + padding: EdgeInsetsDirectional.only( + end: desktop ? AppSpacing.tiny : 0, ), + child: listButton, ), ], ), @@ -449,19 +518,19 @@ class _TimelineTabsBarState extends ConsumerState<_TimelineTabsBar> { label: timeline.pinned ? context.l10n.unpinTimeline : context.l10n.pinTimeline, - icon: Icons.push_pin_outlined, + icon: AppIcons.pin, onPressed: () => _setTimelinePinned(timeline), ), AppMenuItem( key: ValueKey('timeline-rename-${timeline.id}'), label: context.l10n.rename, - icon: Icons.drive_file_rename_outline, + icon: AppIcons.rename, onPressed: () => _renameTimeline(timeline), ), AppMenuItem( key: ValueKey('timeline-delete-${timeline.id}'), label: context.l10n.delete, - icon: Icons.delete_outline, + icon: AppIcons.delete, destructive: true, onPressed: widget.timelines.length <= 1 ? null @@ -470,59 +539,33 @@ class _TimelineTabsBarState extends ConsumerState<_TimelineTabsBar> { ], child: Padding( padding: const EdgeInsets.symmetric(vertical: 3), - child: TextButton( - key: ValueKey('timeline-tab-${timeline.id}'), - onPressed: () => _openTimeline(timeline), - style: ButtonStyle( - minimumSize: const WidgetStatePropertyAll(Size(0, 20)), - maximumSize: const WidgetStatePropertyAll( - Size(double.infinity, 20), + child: Semantics( + selected: selected, + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: AppTheme.isDesktop(context) ? 180 : double.infinity, ), - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - textStyle: WidgetStatePropertyAll( - Theme.of(context).textTheme.labelLarge?.copyWith( - fontSize: 12, - height: 1.3, - fontWeight: FontWeight.w400, + child: TextButton( + key: ValueKey('timeline-tab-${timeline.id}'), + onPressed: () => _openTimeline(timeline), + style: AppTheme.timelineTabStyle(context, selected: selected), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (timeline.pinned) ...[ + const Icon(AppIcons.pinFilled, size: 10), + const SizedBox(width: AppSpacing.tiny), + ], + Flexible( + child: Text( + timeline.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], ), ), - padding: const WidgetStatePropertyAll( - EdgeInsets.symmetric(horizontal: AppSpacing.small), - ), - foregroundColor: WidgetStatePropertyAll( - selected - ? Theme.of(context).colorScheme.onSurface - : Theme.of(context).colorScheme.onSurfaceVariant, - ), - backgroundColor: WidgetStatePropertyAll( - selected - ? Theme.of(context).colorScheme.onSurface - .withValues(alpha: .05) - : Colors.transparent, - ), - overlayColor: WidgetStateProperty.resolveWith((states) { - if (states.contains(WidgetState.hovered) || - states.contains(WidgetState.focused) || - states.contains(WidgetState.pressed)) { - return Theme.of(context).colorScheme.onSurface - .withValues(alpha: .078); - } - return Colors.transparent; - }), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (timeline.pinned) ...[ - const Icon(Icons.push_pin, size: 10), - const SizedBox(width: AppSpacing.tiny), - ], - Text( - timeline.name, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ], ), ), ), @@ -532,9 +575,16 @@ class _TimelineTabsBarState extends ConsumerState<_TimelineTabsBar> { } class _TimelineEditor extends StatefulWidget { - const _TimelineEditor({required this.session, required this.projectId}); + const _TimelineEditor({ + required this.session, + required this.projectId, + required this.onSelectionActivated, + required this.rulerTimecodeLayout, + }); final String projectId; final EditorTimelineSession session; + final VoidCallback onSelectionActivated; + final TimelineRulerTimecodeLayout? rulerTimecodeLayout; @override State<_TimelineEditor> createState() => _TimelineEditorState(); @@ -545,6 +595,49 @@ class _TimelineEditorState extends State<_TimelineEditor> { String get projectId => widget.projectId; RuntimeTimelineThumbnails get _thumbnails => session.thumbnails; RuntimeTimelineWaveforms get _waveforms => session.waveforms; + TimelineViewController? _selectionView; + Set _lastSelection = {}; + + @override + void initState() { + super.initState(); + session.addListener(_bindSelectionView); + _bindSelectionView(); + } + + @override + void didUpdateWidget(covariant _TimelineEditor oldWidget) { + super.didUpdateWidget(oldWidget); + if (!identical(oldWidget.session, session)) { + oldWidget.session.removeListener(_bindSelectionView); + session.addListener(_bindSelectionView); + _bindSelectionView(); + } + } + + void _bindSelectionView() { + final sequence = session.activeSequenceId; + final next = sequence == null ? null : session.view(sequence); + if (identical(next, _selectionView)) return; + _selectionView?.editingChanges.removeListener(_selectionChanged); + _selectionView = next; + _lastSelection = next?.selectedIdentities.toSet() ?? {}; + next?.editingChanges.addListener(_selectionChanged); + } + + void _selectionChanged() { + final selected = _selectionView?.selectedIdentities.toSet() ?? {}; + if (setEquals(selected, _lastSelection)) return; + _lastSelection = selected; + if (selected.isNotEmpty) widget.onSelectionActivated(); + } + + @override + void dispose() { + session.removeListener(_bindSelectionView); + _selectionView?.editingChanges.removeListener(_selectionChanged); + super.dispose(); + } @override Widget build(BuildContext context) => ListenableSelector( @@ -709,7 +802,9 @@ class _TimelineEditorState extends State<_TimelineEditor> { } final controller = session.view(sequenceId); return WorkspacePanel( - headerHeight: 32, + headerHeight: AppTheme.isDesktop(context) + ? AppDesktopMetrics.timelineToolbar + : 32, headerPadding: EdgeInsets.zero, controls: ListenableSelector( listenable: Listenable.merge([ @@ -730,103 +825,191 @@ class _TimelineEditorState extends State<_TimelineEditor> { builder: (context, _) { final captionCues = _selectedCaptionCues(controller); final canSplitCaption = _canSplitCaption(controller, captionCues); - return SizedBox( - key: const Key('timeline-toolbar'), - height: 32, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: AppSpacing.gap), - child: LayoutBuilder( - builder: (context, constraints) => SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: ConstrainedBox( - constraints: BoxConstraints(minWidth: constraints.maxWidth), - child: IntrinsicWidth( - child: Row( - children: [ - Row( - mainAxisSize: MainAxisSize.min, - spacing: AppSpacing.tiny, - children: [ - _toolbarButton( - tooltip: context.l10n.undo, - onPressed: controller.canUndo - ? controller.undo - : null, - icon: Icons.undo, - ), - _toolbarButton( - tooltip: context.l10n.redo, - onPressed: controller.canRedo - ? controller.redo - : null, - icon: Icons.redo, - ), - _toolbarButton( - tooltip: context.l10n.splitAtPlayhead, - onPressed: canSplitCaption - ? () => _runCaptionEdit( - context, - () => _splitCaption( - sequenceId, - controller, - captionCues.single, - ), - ) - : controller.canCutSelection - ? controller.cutSelectionAtPlayhead - : null, - icon: Icons.content_cut, - ), - _toolbarButton( - key: const ValueKey('timeline-trim-left'), - tooltip: context.l10n.trimLeftTooltip, - onPressed: controller.canCutSelection - ? controller.trimLeftAtPlayhead - : null, - icon: Icons.align_horizontal_left, - semanticLabel: context.l10n.trimLeft, - ), - _toolbarButton( - key: const ValueKey('timeline-trim-right'), - tooltip: context.l10n.trimRightTooltip, - onPressed: controller.canCutSelection - ? controller.trimRightAtPlayhead - : null, - icon: Icons.align_horizontal_right, - semanticLabel: context.l10n.trimRight, - ), - _toolbarButton( - key: const ValueKey( - 'timeline-delete-selection', + if (!AppTheme.isDesktop(context)) { + return SizedBox( + key: const Key('timeline-toolbar'), + height: 32, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSpacing.gap), + child: LayoutBuilder( + builder: (context, constraints) => SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: ConstrainedBox( + constraints: BoxConstraints( + minWidth: constraints.maxWidth, + ), + child: IntrinsicWidth( + child: Row( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + spacing: AppSpacing.tiny, + children: [ + _toolbarButton( + tooltip: context.l10n.undo, + onPressed: controller.canUndo + ? controller.undo + : null, + icon: AppIcons.undo, ), - tooltip: context.l10n.deleteSelectedClips, - onPressed: () { - if (!controller.canDeleteSelection) return; - controller.deleteSelection(); - }, - icon: Icons.delete_outline, - ), - ], - ), - const Spacer(), - _toolbarButton( - key: const ValueKey('timeline-fit'), - tooltip: context.l10n.fitTimeline, - semanticLabel: context.l10n.fitTimeline, - onPressed: controller.fitTimeline, - icon: Icons.fit_screen, - ), - if (controller.commandRejection != null) - Tooltip( - message: controller.commandRejection!, - child: const Icon(Icons.info_outline), + _toolbarButton( + tooltip: context.l10n.redo, + onPressed: controller.canRedo + ? controller.redo + : null, + icon: AppIcons.redo, + ), + _toolbarButton( + tooltip: context.l10n.splitAtPlayhead, + onPressed: canSplitCaption + ? () => _runCaptionEdit( + context, + () => _splitCaption( + sequenceId, + controller, + captionCues.single, + ), + ) + : controller.canCutSelection + ? controller.cutSelectionAtPlayhead + : null, + icon: AppIcons.cut, + ), + _toolbarButton( + key: const ValueKey('timeline-trim-left'), + tooltip: context.l10n.trimLeftTooltip, + onPressed: controller.canCutSelection + ? controller.trimLeftAtPlayhead + : null, + icon: AppIcons.alignLeft, + semanticLabel: context.l10n.trimLeft, + ), + _toolbarButton( + key: const ValueKey('timeline-trim-right'), + tooltip: context.l10n.trimRightTooltip, + onPressed: controller.canCutSelection + ? controller.trimRightAtPlayhead + : null, + icon: AppIcons.alignRight, + semanticLabel: context.l10n.trimRight, + ), + _toolbarButton( + key: const ValueKey( + 'timeline-delete-selection', + ), + tooltip: context.l10n.deleteSelectedClips, + onPressed: () { + if (!controller.canDeleteSelection) return; + controller.deleteSelection(); + }, + icon: AppIcons.delete, + ), + ], ), - ], + const Spacer(), + _toolbarButton( + key: const ValueKey('timeline-fit'), + tooltip: context.l10n.fitTimeline, + semanticLabel: context.l10n.fitTimeline, + onPressed: controller.fitTimeline, + icon: AppIcons.fitContent, + ), + if (controller.commandRejection != null) + Tooltip( + message: controller.commandRejection!, + child: const Icon(AppIcons.info), + ), + ], + ), ), ), ), ), ), + ); + } + return SizedBox( + key: const Key('timeline-toolbar'), + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.timelineToolbar + : 32, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: AppCommandToolbar( + groups: [ + [ + AppToolbarCommand( + label: context.l10n.undo, + onPressed: controller.canUndo ? controller.undo : null, + icon: AppIcons.undo, + ), + AppToolbarCommand( + label: context.l10n.redo, + onPressed: controller.canRedo ? controller.redo : null, + icon: AppIcons.redo, + ), + ], + [ + AppToolbarCommand( + label: context.l10n.splitAtPlayhead, + onPressed: canSplitCaption + ? () => _runCaptionEdit( + context, + () => _splitCaption( + sequenceId, + controller, + captionCues.single, + ), + ) + : controller.canCutSelection + ? controller.cutSelectionAtPlayhead + : null, + icon: AppIcons.cut, + ), + AppToolbarCommand( + key: const ValueKey('timeline-trim-left'), + label: context.l10n.trimLeftTooltip, + semanticLabel: context.l10n.trimLeft, + onPressed: controller.canCutSelection + ? controller.trimLeftAtPlayhead + : null, + icon: AppIcons.alignLeft, + ), + AppToolbarCommand( + key: const ValueKey('timeline-trim-right'), + label: context.l10n.trimRightTooltip, + semanticLabel: context.l10n.trimRight, + onPressed: controller.canCutSelection + ? controller.trimRightAtPlayhead + : null, + icon: AppIcons.alignRight, + ), + AppToolbarCommand( + key: const ValueKey('timeline-delete-selection'), + label: context.l10n.deleteSelectedClips, + onPressed: controller.canDeleteSelection + ? controller.deleteSelection + : null, + icon: AppIcons.delete, + ), + ], + ], + trailing: [ + AppToolbarCommand( + key: const ValueKey('timeline-fit'), + label: context.l10n.fitTimeline, + semanticLabel: context.l10n.fitTimeline, + onPressed: controller.fitTimeline, + icon: AppIcons.fitContent, + ), + ], + status: controller.commandRejection == null + ? null + : Tooltip( + message: controller.commandRejection!, + child: const Icon(AppIcons.info, size: 16), + ), + ), ), ); }, @@ -863,9 +1046,7 @@ class _TimelineEditorState extends State<_TimelineEditor> { label: restoreAudio ? context.l10n.restoreAudio : context.l10n.detachAudio, - icon: restoreAudio - ? Icons.volume_up_outlined - : Icons.audio_file_outlined, + icon: restoreAudio ? AppIcons.volume : AppIcons.audioFile, onPressed: session.acceptsEdits && detachTarget != null && @@ -895,12 +1076,12 @@ class _TimelineEditorState extends State<_TimelineEditor> { ), AppMenuItem( label: context.l10n.separateVocals, - icon: Icons.graphic_eq, + icon: AppIcons.audioWaveform, onPressed: null, ), AppMenuItem( label: context.l10n.removeBackground, - icon: Icons.person_remove_outlined, + icon: AppIcons.removeBackground, onPressed: backgroundRemovalTarget == null ? null : () => showAppDialog( @@ -913,7 +1094,7 @@ class _TimelineEditorState extends State<_TimelineEditor> { ), AppMenuItem( label: context.l10n.generateCaptions, - icon: Icons.subtitles_outlined, + icon: AppIcons.subtitles, onPressed: target == null ? null : () => showAppDialog( @@ -926,7 +1107,7 @@ class _TimelineEditorState extends State<_TimelineEditor> { ), AppMenuItem( label: context.l10n.deleteSelectedClips, - icon: Icons.delete_outline, + icon: AppIcons.delete, destructive: true, onPressed: controller.canDeleteSelection ? controller.deleteSelection @@ -941,9 +1122,10 @@ class _TimelineEditorState extends State<_TimelineEditor> { Expanded( child: Directionality( textDirection: TextDirection.ltr, - child: TimelineViewport( + child: EditorTimelineViewport( leadingPadding: AppSpacing.medium, controller: controller, + rulerTimecodeLayout: widget.rulerTimecodeLayout, child: TimelineAssetDropTarget( projectId: projectId, session: session, @@ -975,8 +1157,15 @@ class _TimelineEditorState extends State<_TimelineEditor> { controller: controller, ), ), - ListenableBuilder( + ListenableSelector( listenable: controller.contentChanges, + select: () => ( + controller.contentEndTick == 0, + controller.isDragging, + controller.geometry.primaryTop, + controller.geometry.primaryHeight, + controller.camera.verticalOffset, + ), builder: (context, _) => controller.contentEndTick == 0 && !controller.isDragging diff --git a/lib/features/timeline/timeline_ruler_previews.dart b/lib/features/timeline/timeline_ruler_previews.dart new file mode 100644 index 0000000..fe8bfdf --- /dev/null +++ b/lib/features/timeline/timeline_ruler_previews.dart @@ -0,0 +1,285 @@ +import 'package:cutdex_sdk/timeline/engine.dart'; +import 'package:cutdex_sdk/timeline/layout.dart'; +import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:cutdex_sdk/timeline_ui.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../../app/editor_theme.dart'; + +@Preview( + name: 'Full timecode — light', + group: 'Desktop timeline', + size: Size(640, 152), +) +Widget timecodeRulerLightPreview() => _preview(Brightness.light); + +@Preview( + name: 'Full timecode — dark', + group: 'Desktop timeline', + size: Size(640, 152), +) +@Preview( + name: 'Full timecode — narrow', + group: 'Desktop timeline', + size: Size(320, 152), +) +Widget timecodeRulerDarkPreview() => _preview(Brightness.dark); + +@Preview( + name: 'Full timecode — frame detail', + group: 'Desktop timeline', + size: Size(640, 152), +) +Widget timecodeRulerFramePreview() => + _preview(Brightness.dark, frameDetail: true); + +@Preview( + name: 'Full timecode — 29.97 drop frame', + group: 'Desktop timeline', + size: Size(640, 152), +) +Widget timecodeRulerDropFramePreview() => _preview( + Brightness.dark, + frameDetail: true, + format: TimelineFormat( + frameDuration: RationalTime(1001, 30000), + timecodeFormat: TimelineTimecodeFormat.dropFrame, + ), +); + +@Preview( + name: 'Centered timecode — light', + group: 'Desktop timeline', + size: Size(640, 152), +) +Widget centeredTimecodeRulerLightPreview() => _preview( + Brightness.light, + timecodeLayout: TimelineRulerTimecodeLayout.centered, +); + +@Preview( + name: 'Centered timecode — dark', + group: 'Desktop timeline', + size: Size(640, 152), +) +@Preview( + name: 'Centered timecode — narrow', + group: 'Desktop timeline', + size: Size(320, 152), +) +Widget centeredTimecodeRulerDarkPreview() => _preview( + Brightness.dark, + timecodeLayout: TimelineRulerTimecodeLayout.centered, +); + +@Preview( + name: 'Centered timecode — frame detail', + group: 'Desktop timeline', + size: Size(640, 152), +) +Widget centeredTimecodeRulerFramePreview() => _preview( + Brightness.dark, + frameDetail: true, + timecodeLayout: TimelineRulerTimecodeLayout.centered, +); + +@Preview( + name: 'Overlay timecode — light', + group: 'Desktop timeline', + size: Size(640, 152), +) +Widget overlayTimecodeRulerLightPreview() => _preview( + Brightness.light, + timecodeLayout: TimelineRulerTimecodeLayout.overlay, +); + +@Preview( + name: 'Overlay timecode — dark', + group: 'Desktop timeline', + size: Size(640, 152), +) +@Preview( + name: 'Overlay timecode — narrow', + group: 'Desktop timeline', + size: Size(320, 152), +) +Widget overlayTimecodeRulerDarkPreview() => _preview( + Brightness.dark, + timecodeLayout: TimelineRulerTimecodeLayout.overlay, +); + +@Preview( + name: 'Overlay timecode — frame detail', + group: 'Desktop timeline', + size: Size(640, 152), +) +Widget overlayTimecodeRulerFramePreview() => _preview( + Brightness.dark, + frameDetail: true, + timecodeLayout: TimelineRulerTimecodeLayout.overlay, +); + +Widget _preview( + Brightness brightness, { + bool frameDetail = false, + TimelineFormat? format, + TimelineRulerTimecodeLayout timecodeLayout = + TimelineRulerTimecodeLayout.inline, +}) => MaterialApp( + debugShowCheckedModeBanner: false, + theme: EditorTheme.desktop( + EditorTheme.forPalette(AppPalette.graphite, brightness), + ), + home: Scaffold( + body: _RulerPreview( + format: format ?? TimelineFormat.fps30, + frameDetail: frameDetail, + timecodeLayout: timecodeLayout, + ), + ), +); + +class _RulerPreview extends StatefulWidget { + const _RulerPreview({ + required this.format, + required this.frameDetail, + required this.timecodeLayout, + }); + + final TimelineFormat format; + final bool frameDetail; + final TimelineRulerTimecodeLayout timecodeLayout; + + @override + State<_RulerPreview> createState() => _RulerPreviewState(); +} + +class _RulerPreviewState extends State<_RulerPreview> { + late final TimelineViewController _controller; + static const _width = 640.0; + + @override + void initState() { + super.initState(); + final duration = RationalTime.seconds(widget.frameDetail ? 60 : 15); + final kernel = TimelineKernel.importDto( + TimelineDto( + id: SequenceId('ruler-preview'), + format: widget.format, + primaryStorylineId: StorylineId('primary'), + storylines: [ + StorylineDto( + id: StorylineId('primary'), + elementIds: [ElementId('intro'), ElementId('main')], + ), + ], + elements: [ + for (final (id, name) in [('intro', 'Intro'), ('main', 'Main shot')]) + ElementDto( + id: ElementId(id), + name: name, + structure: ElementStructure.content, + sourceRange: TimeRange( + start: RationalTime.zero, + duration: duration, + ), + duration: duration, + ), + ], + ), + ); + final projection = const TimelineLayoutSceneBuilder().project( + version: kernel.current, + stacks: const [], + appearance: (_, _, _) => throw StateError('no connections'), + ); + final layout = TimelineLayoutEngine(kernel: kernel).initializeProjection( + kernel: kernel, + projection: projection, + policy: LayoutPolicy(version: 1, stacks: const []), + ); + final camera = TimelineCamera( + baseTick: widget.frameDetail ? 59 * TimelineClock.ticksPerSecond : 0, + pixelsPerTick: widget.frameDetail + ? 12 / widget.format.frameGrid.quantumTicks + : 30 / TimelineClock.ticksPerSecond, + ); + _controller = + TimelineViewController( + version: layout.version, + storyline: kernel.current.query().primaryStoryline, + geometry: TimelineViewportGeometry(primaryTop: 0, primaryHeight: 48), + format: widget.format, + camera: camera, + )..restoreViewState( + playheadTick: widget.frameDetail + ? (widget.format.frameDuration.denominator / + widget.format.frameDuration.numerator) + .round() * + 60 * + widget.format.frameGrid.quantumTicks + : 10 * TimelineClock.ticksPerSecond, + camera: camera, + ); + } + + void _zoom(double scale, double width) => _controller.zoomBy( + scale: scale, + viewport: TimelineViewportRect(width: width, height: 88), + ); + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) => LayoutBuilder( + builder: (context, constraints) { + final width = constraints.hasBoundedWidth ? constraints.maxWidth : _width; + return Column( + children: [ + SizedBox( + height: AppDesktopMetrics.timelineToolbar, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Row( + children: [ + const Text('Timeline ruler'), + const Spacer(), + IconButton( + tooltip: 'Zoom out', + onPressed: () => _zoom(1 / 1.4, width), + icon: const Icon(AppIcons.remove, size: 16), + ), + IconButton( + tooltip: 'Zoom in', + onPressed: () => _zoom(1.4, width), + icon: const Icon(AppIcons.add, size: 16), + ), + IconButton( + tooltip: 'Fit timeline', + onPressed: _controller.fitTimeline, + icon: const Icon(AppIcons.fitContent, size: 16), + ), + ], + ), + ), + ), + Expanded( + child: TimelineViewport( + controller: _controller, + rulerStyle: TimelineRulerStyle.timecode, + rulerTimecodeLayout: widget.timecodeLayout, + child: TimelineView(controller: _controller), + ), + ), + ], + ); + }, + ); +} diff --git a/lib/features/timeline/timeline_speed_editor.dart b/lib/features/timeline/timeline_speed_editor.dart index 21cf9f2..2f47387 100644 --- a/lib/features/timeline/timeline_speed_editor.dart +++ b/lib/features/timeline/timeline_speed_editor.dart @@ -1,3 +1,5 @@ +import '../../shared/widgets/listenable_selector.dart'; + import 'package:cutdex/shared/widgets/error_notification_host.dart'; import 'dart:math' as math; @@ -89,87 +91,91 @@ class TimelineSpeedEditor extends StatelessWidget { } @override - Widget build(BuildContext context) => ListenableBuilder( - listenable: Listenable.merge([session, controller.contentChanges]), - builder: (context, _) => LayoutBuilder( - builder: (context, constraints) { - final frame = controller.project( - TimelineViewportRect( - width: constraints.maxWidth, - height: constraints.maxHeight, - ), - ); - final query = frame.version.kernelVersion.query(); - final viewportBounds = - Offset.zero & Size(constraints.maxWidth, constraints.maxHeight); - final bars = []; - void addHeader( - ElementHandle handle, - TimelineClipLayout clipLayout, { - bool ghost = false, - }) { - final record = query.element(handle); - if (!session.isCustomSpeedEnabled(sequence, record.id)) return; - final segments = session.clipSpeedSegments(record); - if (segments == null) return; - final layout = TimelineSpeedLayout( - clip: clipLayout, - segments: segments, - pixelsPerTick: controller.camera.pixelsPerTick, + Widget build(BuildContext context) => ListenableSelector( + listenable: session, + select: () => (session.version, session.acceptsEdits), + builder: (context, _) => ListenableBuilder( + listenable: controller.contentChanges, + builder: (context, _) => LayoutBuilder( + builder: (context, constraints) { + final frame = controller.project( + TimelineViewportRect( + width: constraints.maxWidth, + height: constraints.maxHeight, + ), ); - final bounds = clipLayout.toViewport(layout.bounds); - if (bounds.isEmpty || !bounds.overlaps(viewportBounds)) { - return; - } - bars.add( - Positioned( - key: ValueKey((sequence, record.id)), - left: bounds.left, - top: bounds.top, - width: bounds.width, - height: bounds.height, - child: IgnorePointer( - ignoring: ghost, - child: _ClipSpeedEditor( - session: session, - sequence: sequence, - clip: record.id, - controller: controller, - layout: layout, + final query = frame.version.kernelVersion.query(); + final viewportBounds = + Offset.zero & Size(constraints.maxWidth, constraints.maxHeight); + final bars = []; + void addHeader( + ElementHandle handle, + TimelineClipLayout clipLayout, { + bool ghost = false, + }) { + final record = query.element(handle); + if (!session.isCustomSpeedEnabled(sequence, record.id)) return; + final segments = session.clipSpeedSegments(record); + if (segments == null) return; + final layout = TimelineSpeedLayout( + clip: clipLayout, + segments: segments, + pixelsPerTick: controller.camera.pixelsPerTick, + ); + final bounds = clipLayout.toViewport(layout.bounds); + if (bounds.isEmpty || !bounds.overlaps(viewportBounds)) { + return; + } + bars.add( + Positioned( + key: ValueKey((sequence, record.id)), + left: bounds.left, + top: bounds.top, + width: bounds.width, + height: bounds.height, + child: IgnorePointer( + ignoring: ghost, + child: _ClipSpeedEditor( + session: session, + sequence: sequence, + clip: record.id, + controller: controller, + layout: layout, + ), ), ), - ), - ); - } - - for (var index = 0; index < frame.length; index++) { - if (frame.kindAt(index) == TimelineViewportItemKind.transition) { - continue; + ); } - final identity = frame.identityAt(index); - final handle = controller.elementForIdentity(identity); - if (handle == null) continue; - final bodyId = identity is LayoutBodyId - ? identity - : LayoutBodyId.element(handle); - // The resident item is a landing reservation while the moving clip - // is painted separately at its pointer-following ghost coordinates. - if (controller.dragGhostFor(bodyId) != null) continue; - addHeader(handle, controller.clipLayoutAt(frame, index)); - } - for (final ghost in controller.dragGhosts) { - final body = ghost.body; - addHeader( - body.id.owner, - controller.clipLayout( - controller.dragGhostBounds(ghost, frame.viewport), - owner: body.id.owner, - ), - ghost: true, - ); - } - return Stack(clipBehavior: Clip.none, children: bars); - }, + + for (var index = 0; index < frame.length; index++) { + if (frame.kindAt(index) == TimelineViewportItemKind.transition) { + continue; + } + final identity = frame.identityAt(index); + final handle = controller.elementForIdentity(identity); + if (handle == null) continue; + final bodyId = identity is LayoutBodyId + ? identity + : LayoutBodyId.element(handle); + // The resident item is a landing reservation while the moving clip + // is painted separately at its pointer-following ghost coordinates. + if (controller.dragGhostFor(bodyId) != null) continue; + addHeader(handle, controller.clipLayoutAt(frame, index)); + } + for (final ghost in controller.dragGhosts) { + final body = ghost.body; + addHeader( + body.id.owner, + controller.clipLayout( + controller.dragGhostBounds(ghost, frame.viewport), + owner: body.id.owner, + ), + ghost: true, + ); + } + return Stack(clipBehavior: Clip.none, children: bars); + }, + ), ), ); } diff --git a/lib/integrations/platform/editor_window_chrome.dart b/lib/integrations/platform/editor_window_chrome.dart index bc6b91e..04514be 100644 --- a/lib/integrations/platform/editor_window_chrome.dart +++ b/lib/integrations/platform/editor_window_chrome.dart @@ -13,7 +13,8 @@ class EditorWindowChrome extends StatefulWidget { required this.builder, }); - static const trafficLightWidth = 88.0; + // Native button centers are 19, 39 and 59; their frames end around x=66. + static const trafficLightWidth = 68.0; static bool get isWindows => WindowChromeSession.isWindows; static double get leadingWidth => isWindows ? 0 : trafficLightWidth; final double headerHeight; diff --git a/lib/integrations/platform/file_picker.dart b/lib/integrations/platform/file_picker.dart index f4dc8c7..71c0798 100644 --- a/lib/integrations/platform/file_picker.dart +++ b/lib/integrations/platform/file_picker.dart @@ -1,4 +1,6 @@ +import 'package:cutdex_native/cutdex_native.dart'; import 'package:filegate/filegate.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -26,6 +28,22 @@ class AppFilePicker { Future> pickFiles({ required List allowedExtensions, }) async { + if (!kIsWeb && defaultTargetPlatform == TargetPlatform.macOS) { + final paths = await NativeFilePicker.pickFiles( + allowedExtensions: [ + ...allowedExtensions + .map( + (value) => value + .trim() + .replaceFirst(RegExp(r'^\.+'), '') + .toLowerCase(), + ) + .where((value) => value.isNotEmpty) + .toSet(), + ], + ); + return [for (final path in paths) ExternalMediaFile(path: path)]; + } final entries = await const Filegate().pickFiles( allowMultiple: true, allowedExtensions: allowedExtensions, diff --git a/lib/integrations/platform/window_caption_controls.dart b/lib/integrations/platform/window_caption_controls.dart index d6f5feb..6b81dbc 100644 --- a/lib/integrations/platform/window_caption_controls.dart +++ b/lib/integrations/platform/window_caption_controls.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import '../../l10n/l10n.dart'; @@ -29,13 +30,13 @@ class WindowCaptionControls extends StatelessWidget { _button( context, WindowCaptionCommand.minimize, - Icons.remove, + AppIcons.remove, context.l10n.windowMinimize, ), _button( context, WindowCaptionCommand.toggleMaximize, - session.maximized ? Icons.filter_none : Icons.crop_square, + session.maximized ? AppIcons.windowRestore : AppIcons.square, session.maximized ? context.l10n.windowRestore : context.l10n.windowMaximize, @@ -45,7 +46,7 @@ class WindowCaptionControls extends StatelessWidget { _button( context, WindowCaptionCommand.close, - Icons.close, + AppIcons.close, MaterialLocalizations.of(context).closeButtonTooltip, ), ], diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 945b960..74896a1 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "Zeitleisten-Skalenstil", + "timelineRulerInline": "Markierungen neben Zeitcodes", + "timelineRulerCentered": "Zentrierte Zeitcodes", + "timelineRulerOverlay": "Überlagerte Markierungen", + "preview": "Vorschau", "projectsNone": "Keine Projekte", "agentConversations": "Unterhaltungen", "renameConversationTitle": "Chat umbenennen", @@ -6,6 +11,8 @@ "showMoreConversations": "Mehr anzeigen", "showFewerConversations": "Weniger anzeigen", "agentNewConversation": "Neue Unterhaltung", + "agentUntitledConversation": "Neuer Chat", + "agentConversationActions": "Chat-Aktionen", "agentElapsedTime": "Dauer {duration}", "agentConversationActions": "Unterhaltungsaktionen", "agentMoveToTrash": "In den Papierkorb verschieben", @@ -583,6 +590,7 @@ "revealMediaFailed": "Medien konnten im Dateimanager nicht angezeigt werden", "openMatchingProject": "Öffnen Sie zunächst das entsprechende Projekt", "projectMismatch": "Die Bibliothek an diesem Standort stimmt nicht mit dem Datensatz überein. Wählen Sie es erneut mit Bibliothek öffnen aus.", + "projectAlreadyExists": "Dieser Projektname wird bereits verwendet. Wählen Sie einen anderen Namen oder öffnen Sie das bestehende Projekt über „Projekt öffnen“.", "openProjectFirst": "Öffnen Sie zunächst eine Bibliothek", "localFilesOnly": "Ziehen Sie lokale Dateien aus dem Dateimanager", "foldersUnsupported": "Wählen Sie Dateien aus. Das Ziehen von Ordnern wird noch nicht unterstützt.", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "Der Projektspeicherort ist nicht verfügbar. Verbinden Sie das Laufwerk oder prüfen Sie das Netzwerk und versuchen Sie es erneut, oder ändern Sie den Speicherort.", "projectLocationNotWritable": "Der Projektspeicherort ist nicht beschreibbar. Prüfen Sie die Berechtigungen oder ändern Sie den Speicherort.", "projectLocationCreateFailed": "Der Projektordner konnte nicht erstellt oder beschrieben werden. Prüfen Sie die Berechtigungen oder ändern Sie den Speicherort.", + "removeProjectFromRecent": "Aus zuletzt verwendeten Projekten entfernen", "removeProjectFromSidebar": "Aus der Seitenleiste entfernen", "projectRemoved": "Projekt entfernt. Lokale Dateien und Unterhaltungen bleiben erhalten.", "agentNoConversations": "Noch keine Unterhaltungen", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "Diagnosepaket gespeichert.", "navigationChat": "Chat", "navigationLibrary": "Mediathek", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "Farbpalette", + "paletteGraphite": "Graphit · Blau", + "paletteViolet": "Sanftes Grau · Violett", + "paletteTeal": "Warmes Grau · Türkis", + "agentMinimize": "Agent minimieren", + "agentDock": "Agent andocken", + "agentExpandConversation": "Unterhaltung erweitern", + "agentCollapseConversation": "Unterhaltung einklappen", + "noMatchingMedia": "Keine passenden Medien", + "sortMedia": "Medien sortieren", + "mediaSortImportOrder": "Importreihenfolge", + "mediaSortNameAscending": "Name: A bis Z", + "mediaSortNameDescending": "Name: Z bis A", + "mediaSelectedCount": "{count} ausgewählt", + "navigationHome": "Startseite", + "mediaThumbnailSize": "Vorschaubildgröße", + "mediaThumbnailSmall": "Kleine Vorschaubilder", + "mediaThumbnailMedium": "Mittlere Vorschaubilder", + "mediaThumbnailLarge": "Große Vorschaubilder", + "mediaSpecification": "Eigenschaften", + "resourceMyMedia": "Meine Medien", + "resourceStickers": "Sticker", + "resourceEffects": "Effekte", + "resourceTransitions": "Übergänge", + "resourceMore": "Mehr", + "resourceLibraryEmpty": "Keine Ressourcen für {category} verfügbar", + "resourceImportedAudioHint": "Importiertes Audio befindet sich in Meine Medien.", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index e1f74cf..c3383d9 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "Timeline ruler style", + "timelineRulerInline": "Inline marks", + "timelineRulerCentered": "Centered labels", + "timelineRulerOverlay": "Overlay marks", + "preview": "Preview", "selectProject": "Select project", "searchProjects": "Search projects", "noMatchingProjects": "No matching projects", @@ -7,6 +12,7 @@ "projectLocationUnavailable": "The project save location is unavailable. Connect the disk or check the network and retry, or change the location.", "projectLocationNotWritable": "The project save location is not writable. Check permissions or change the location.", "projectLocationCreateFailed": "Could not create or write to the project save folder. Check permissions or change the location.", + "removeProjectFromRecent": "Remove from recent projects", "removeProjectFromSidebar": "Remove from sidebar", "projectRemoved": "Project removed. Local files and conversations are preserved.", "agentNoConversations": "No conversations yet", @@ -27,6 +33,8 @@ "showMoreConversations": "Show more", "showFewerConversations": "Show fewer", "agentNewConversation": "New conversation", + "agentUntitledConversation": "New chat", + "agentConversationActions": "Conversation actions", "agentElapsedTime": "Took {duration}", "@agentElapsedTime": {"placeholders": {"duration": {"type": "String"}}}, "agentConversationActions": "Conversation actions", @@ -641,6 +649,7 @@ "revealMediaFailed": "Could not show media in the file manager", "openMatchingProject": "Open the corresponding project first", "projectMismatch": "The project at this location does not match the record. Select it again with Open project.", + "projectAlreadyExists": "This project name is already in use. Choose another name, or use Open project to open the existing project.", "openProjectFirst": "Open a project first", "localFilesOnly": "Drag local files from the file manager", "foldersUnsupported": "Select files. Dragging folders is not supported yet.", @@ -1341,5 +1350,46 @@ "exportDiagnosticsSucceeded": "Diagnostic package saved.", "navigationChat": "Chat", "navigationLibrary": "Library", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "agentMinimize": "Minimize Agent", + "agentDock": "Dock Agent", + "agentExpandConversation": "Expand conversation", + "agentCollapseConversation": "Collapse conversation", + "colorPalette": "Color palette", + "paletteGraphite": "Graphite · Blue", + "paletteViolet": "Soft gray · Violet", + "paletteTeal": "Warm gray · Teal", + "noMatchingMedia": "No matching media", + "sortMedia": "Sort media", + "mediaSortImportOrder": "Import order", + "mediaSortNameAscending": "Name: A to Z", + "mediaSortNameDescending": "Name: Z to A", + "mediaSelectedCount": "{count} selected", + "@mediaSelectedCount": { + "placeholders": { + "count": { + "type": "int" + } + } + }, + "navigationHome": "Home", + "mediaThumbnailSize": "Thumbnail size", + "mediaThumbnailSmall": "Small thumbnails", + "mediaThumbnailMedium": "Medium thumbnails", + "mediaThumbnailLarge": "Large thumbnails", + "mediaSpecification": "Specifications", + "resourceMyMedia": "My media", + "resourceStickers": "Stickers", + "resourceEffects": "Effects", + "resourceTransitions": "Transitions", + "resourceMore": "More", + "resourceLibraryEmpty": "No {category} resources available", + "resourceImportedAudioHint": "Imported audio is in My media.", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index 0cf3dc7..69efc7f 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "Estilo de regla de tiempo", + "timelineRulerInline": "Marcas en línea", + "timelineRulerCentered": "Etiquetas centradas", + "timelineRulerOverlay": "Marcas superpuestas", + "preview": "Vista previa", "projectsNone": "No hay proyectos", "agentConversations": "Conversaciones", "renameConversationTitle": "Renombrar chat", @@ -6,6 +11,8 @@ "showMoreConversations": "Mostrar más", "showFewerConversations": "Mostrar menos", "agentNewConversation": "Nueva conversación", + "agentUntitledConversation": "Nuevo chat", + "agentConversationActions": "Acciones de conversación", "agentElapsedTime": "Duración {duration}", "agentConversationActions": "Acciones de conversación", "agentMoveToTrash": "Mover a la papelera", @@ -583,6 +590,7 @@ "revealMediaFailed": "No se pudieron mostrar los medios en el administrador de archivos", "openMatchingProject": "Abra primero el proyecto correspondiente", "projectMismatch": "La biblioteca en esta ubicación no coincide con el registro. Selecciónelo nuevamente con Abrir biblioteca.", + "projectAlreadyExists": "Este nombre de proyecto ya está en uso. Elija otro nombre o use Abrir proyecto para abrir el proyecto existente.", "openProjectFirst": "Abra una biblioteca primero", "localFilesOnly": "Arrastre archivos locales desde el administrador de archivos", "foldersUnsupported": "Seleccionar archivos. Aún no se admite arrastrar carpetas.", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "La ubicación de guardado no está disponible. Conecta el disco o comprueba la red y vuelve a intentarlo, o cambia la ubicación.", "projectLocationNotWritable": "No se puede escribir en la ubicación de guardado. Comprueba los permisos o cambia la ubicación.", "projectLocationCreateFailed": "No se pudo crear la carpeta del proyecto o escribir en ella. Comprueba los permisos o cambia la ubicación.", + "removeProjectFromRecent": "Quitar de proyectos recientes", "removeProjectFromSidebar": "Quitar de la barra lateral", "projectRemoved": "Proyecto eliminado de la lista. Se conservan los archivos locales y las conversaciones.", "agentNoConversations": "Aún no hay conversaciones", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "Paquete de diagnóstico guardado.", "navigationChat": "Chat", "navigationLibrary": "Biblioteca", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "Paleta de colores", + "paletteGraphite": "Grafito · Azul", + "paletteViolet": "Gris suave · Violeta", + "paletteTeal": "Gris cálido · Verde azulado", + "agentMinimize": "Minimizar agente", + "agentDock": "Acoplar agente", + "agentExpandConversation": "Expandir conversación", + "agentCollapseConversation": "Contraer conversación", + "noMatchingMedia": "No hay medios coincidentes", + "sortMedia": "Ordenar medios", + "mediaSortImportOrder": "Orden de importación", + "mediaSortNameAscending": "Nombre: A a Z", + "mediaSortNameDescending": "Nombre: Z a A", + "mediaSelectedCount": "{count} seleccionados", + "navigationHome": "Inicio", + "mediaThumbnailSize": "Tamaño de miniatura", + "mediaThumbnailSmall": "Miniaturas pequeñas", + "mediaThumbnailMedium": "Miniaturas medianas", + "mediaThumbnailLarge": "Miniaturas grandes", + "mediaSpecification": "Especificaciones", + "resourceMyMedia": "Mis medios", + "resourceStickers": "Adhesivos", + "resourceEffects": "Efectos", + "resourceTransitions": "Transiciones", + "resourceMore": "Más", + "resourceLibraryEmpty": "No hay recursos de {category} disponibles", + "resourceImportedAudioHint": "El audio importado está en Mis medios.", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index bc0c228..fb747de 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "Style de règle de montage", + "timelineRulerInline": "Graduations en ligne", + "timelineRulerCentered": "Libellés centrés", + "timelineRulerOverlay": "Graduations superposées", + "preview": "Aperçu", "projectsNone": "Aucun projet", "agentConversations": "Conversations", "renameConversationTitle": "Renommer la discussion", @@ -6,6 +11,8 @@ "showMoreConversations": "Afficher plus", "showFewerConversations": "Afficher moins", "agentNewConversation": "Nouvelle conversation", + "agentUntitledConversation": "Nouvelle conversation", + "agentConversationActions": "Actions de conversation", "agentElapsedTime": "Durée {duration}", "agentConversationActions": "Actions de la conversation", "agentMoveToTrash": "Déplacer vers la corbeille", @@ -583,6 +590,7 @@ "revealMediaFailed": "Impossible d'afficher les médias dans le gestionnaire de fichiers", "openMatchingProject": "Ouvrez d'abord le projet correspondant", "projectMismatch": "La bibliothèque à cet emplacement ne correspond pas à la notice. Sélectionnez-le à nouveau avec Ouvrir la bibliothèque.", + "projectAlreadyExists": "Ce nom de projet est déjà utilisé. Choisissez un autre nom ou utilisez Ouvrir le projet pour ouvrir le projet existant.", "openProjectFirst": "Ouvrez d'abord une bibliothèque", "localFilesOnly": "Faites glisser les fichiers locaux depuis le gestionnaire de fichiers", "foldersUnsupported": "Sélectionnez les fichiers. Le déplacement de dossiers n'est pas encore pris en charge.", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "L’emplacement de sauvegarde est indisponible. Connectez le disque ou vérifiez le réseau et réessayez, ou changez d’emplacement.", "projectLocationNotWritable": "L’emplacement de sauvegarde n’est pas accessible en écriture. Vérifiez les autorisations ou changez d’emplacement.", "projectLocationCreateFailed": "Impossible de créer le dossier de sauvegarde ou d’y écrire. Vérifiez les autorisations ou changez d’emplacement.", + "removeProjectFromRecent": "Retirer des projets récents", "removeProjectFromSidebar": "Retirer de la barre latérale", "projectRemoved": "Projet retiré. Les fichiers locaux et les conversations sont conservés.", "agentNoConversations": "Aucune conversation pour le moment", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "Diagnostic enregistré.", "navigationChat": "Discussion", "navigationLibrary": "Bibliothèque", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "Palette de couleurs", + "paletteGraphite": "Graphite · Bleu", + "paletteViolet": "Gris doux · Violet", + "paletteTeal": "Gris chaud · Sarcelle", + "agentMinimize": "Réduire l’agent", + "agentDock": "Ancrer l’agent", + "agentExpandConversation": "Développer la conversation", + "agentCollapseConversation": "Réduire la conversation", + "noMatchingMedia": "Aucun média correspondant", + "sortMedia": "Trier les médias", + "mediaSortImportOrder": "Ordre d’importation", + "mediaSortNameAscending": "Nom : A à Z", + "mediaSortNameDescending": "Nom : Z à A", + "mediaSelectedCount": "{count} sélectionnés", + "navigationHome": "Accueil", + "mediaThumbnailSize": "Taille des vignettes", + "mediaThumbnailSmall": "Petites vignettes", + "mediaThumbnailMedium": "Vignettes moyennes", + "mediaThumbnailLarge": "Grandes vignettes", + "mediaSpecification": "Caractéristiques", + "resourceMyMedia": "Mes médias", + "resourceStickers": "Autocollants", + "resourceEffects": "Effets", + "resourceTransitions": "Transitions", + "resourceMore": "Plus", + "resourceLibraryEmpty": "Aucune ressource disponible pour {category}", + "resourceImportedAudioHint": "Les fichiers audio importés sont dans Mes médias.", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_it.arb b/lib/l10n/app_it.arb index eacca72..d35bb63 100644 --- a/lib/l10n/app_it.arb +++ b/lib/l10n/app_it.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "Stile righello della timeline", + "timelineRulerInline": "Tacche in linea", + "timelineRulerCentered": "Etichette centrate", + "timelineRulerOverlay": "Tacche sovrapposte", + "preview": "Anteprima", "projectsNone": "Nessun progetto", "agentConversations": "Conversazioni", "renameConversationTitle": "Rinomina chat", @@ -6,6 +11,8 @@ "showMoreConversations": "Mostra altro", "showFewerConversations": "Mostra meno", "agentNewConversation": "Nuova conversazione", + "agentUntitledConversation": "Nuova chat", + "agentConversationActions": "Azioni della conversazione", "agentElapsedTime": "Durata {duration}", "agentConversationActions": "Azioni della conversazione", "agentMoveToTrash": "Sposta nel cestino", @@ -583,6 +590,7 @@ "revealMediaFailed": "Impossibile mostrare i media nel file manager", "openMatchingProject": "Apri prima il progetto corrispondente", "projectMismatch": "La libreria in questa posizione non corrisponde al record. Selezionalo di nuovo con Apri libreria.", + "projectAlreadyExists": "Questo nome di progetto è già in uso. Scegli un altro nome oppure usa Apri progetto per aprire il progetto esistente.", "openProjectFirst": "Apri prima una libreria", "localFilesOnly": "Trascina i file locali dal file manager", "foldersUnsupported": "Seleziona i file. Il trascinamento delle cartelle non è ancora supportato.", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "La posizione di salvataggio non è disponibile. Collega il disco o controlla la rete e riprova, oppure cambia posizione.", "projectLocationNotWritable": "La posizione di salvataggio non è scrivibile. Controlla le autorizzazioni o cambia posizione.", "projectLocationCreateFailed": "Impossibile creare la cartella del progetto o scrivervi. Controlla le autorizzazioni o cambia posizione.", + "removeProjectFromRecent": "Rimuovi dai progetti recenti", "removeProjectFromSidebar": "Rimuovi dalla barra laterale", "projectRemoved": "Progetto rimosso. I file locali e le conversazioni sono conservati.", "agentNoConversations": "Nessuna conversazione", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "Pacchetto diagnostico salvato.", "navigationChat": "Chat", "navigationLibrary": "Libreria", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "Palette colori", + "paletteGraphite": "Grafite · Blu", + "paletteViolet": "Grigio tenue · Viola", + "paletteTeal": "Grigio caldo · Verde acqua", + "agentMinimize": "Riduci agente", + "agentDock": "Ancora agente", + "agentExpandConversation": "Espandi conversazione", + "agentCollapseConversation": "Comprimi conversazione", + "noMatchingMedia": "Nessun file corrispondente", + "sortMedia": "Ordina file", + "mediaSortImportOrder": "Ordine di importazione", + "mediaSortNameAscending": "Nome: A–Z", + "mediaSortNameDescending": "Nome: Z–A", + "mediaSelectedCount": "{count} selezionati", + "navigationHome": "Home", + "mediaThumbnailSize": "Dimensione miniature", + "mediaThumbnailSmall": "Miniature piccole", + "mediaThumbnailMedium": "Miniature medie", + "mediaThumbnailLarge": "Miniature grandi", + "mediaSpecification": "Specifiche", + "resourceMyMedia": "I miei media", + "resourceStickers": "Adesivi", + "resourceEffects": "Effetti", + "resourceTransitions": "Transizioni", + "resourceMore": "Altro", + "resourceLibraryEmpty": "Nessuna risorsa disponibile per {category}", + "resourceImportedAudioHint": "L’audio importato si trova in I miei media.", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_ja.arb b/lib/l10n/app_ja.arb index 1cf75e0..bd1025c 100644 --- a/lib/l10n/app_ja.arb +++ b/lib/l10n/app_ja.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "タイムラインの目盛りスタイル", + "timelineRulerInline": "同一帯に交互配置", + "timelineRulerCentered": "タイムコードを中央配置", + "timelineRulerOverlay": "薄い目盛りを重ねる", + "preview": "プレビュー", "projectsNone": "プロジェクトがありません", "agentConversations": "会話", "renameConversationTitle": "チャットの名前を変更", @@ -6,6 +11,8 @@ "showMoreConversations": "さらに表示", "showFewerConversations": "表示を減らす", "agentNewConversation": "新しい会話", + "agentUntitledConversation": "新しいチャット", + "agentConversationActions": "チャットの操作", "agentElapsedTime": "所要時間 {duration}", "agentConversationActions": "会話の操作", "agentMoveToTrash": "ゴミ箱に移動", @@ -583,6 +590,7 @@ "revealMediaFailed": "ファイルマネージャーでメディアを表示できませんでした", "openMatchingProject": "まず対応するプロジェクトを開きます", "projectMismatch": "この場所のライブラリはレコードと一致しません。 「ライブラリを開く」で再度選択します。", + "projectAlreadyExists": "このプロジェクト名はすでに使用されています。別の名前を選ぶか、「プロジェクトを開く」で既存のプロジェクトを開いてください。", "openProjectFirst": "まずライブラリを開いてください", "localFilesOnly": "ファイルマネージャーからローカルファイルをドラッグ", "foldersUnsupported": "ファイルを選択します。フォルダーのドラッグはまだサポートされていません。", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "プロジェクトの保存先を利用できません。ディスクやネットワークを確認して再試行するか、保存先を変更してください。", "projectLocationNotWritable": "プロジェクトの保存先に書き込めません。アクセス権を確認するか、保存先を変更してください。", "projectLocationCreateFailed": "プロジェクト保存フォルダの作成または書き込みに失敗しました。アクセス権を確認するか、保存先を変更してください。", + "removeProjectFromRecent": "最近のプロジェクトから削除", "removeProjectFromSidebar": "サイドバーから削除", "projectRemoved": "プロジェクトを一覧から削除しました。ローカルファイルと会話は保持されます。", "agentNoConversations": "まだ会話がありません", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "診断パッケージを保存しました。", "navigationChat": "チャット", "navigationLibrary": "ライブラリ", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "配色", + "paletteGraphite": "グラファイト · ブルー", + "paletteViolet": "ソフトグレー · パープル", + "paletteTeal": "ウォームグレー · ティール", + "agentMinimize": "エージェントを最小化", + "agentDock": "エージェントをドッキング", + "agentExpandConversation": "会話を展開", + "agentCollapseConversation": "会話を折りたたむ", + "noMatchingMedia": "一致する素材がありません", + "sortMedia": "素材を並べ替え", + "mediaSortImportOrder": "読み込み順", + "mediaSortNameAscending": "名前の昇順", + "mediaSortNameDescending": "名前の降順", + "mediaSelectedCount": "{count} 個選択", + "navigationHome": "ホーム", + "mediaThumbnailSize": "サムネイルサイズ", + "mediaThumbnailSmall": "小さいサムネイル", + "mediaThumbnailMedium": "中サイズのサムネイル", + "mediaThumbnailLarge": "大きいサムネイル", + "mediaSpecification": "仕様", + "resourceMyMedia": "マイメディア", + "resourceStickers": "ステッカー", + "resourceEffects": "エフェクト", + "resourceTransitions": "トランジション", + "resourceMore": "その他", + "resourceLibraryEmpty": "{category}の素材はありません", + "resourceImportedAudioHint": "読み込んだ音声は「マイメディア」にあります。", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_ko.arb b/lib/l10n/app_ko.arb index 42c6e4a..19ad9cd 100644 --- a/lib/l10n/app_ko.arb +++ b/lib/l10n/app_ko.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "타임라인 눈금 스타일", + "timelineRulerInline": "같은 줄에 교차 배치", + "timelineRulerCentered": "시간 코드 가운데 정렬", + "timelineRulerOverlay": "옅은 눈금 겹치기", + "preview": "미리보기", "projectsNone": "프로젝트가 없습니다", "agentConversations": "대화", "renameConversationTitle": "채팅 이름 변경", @@ -6,6 +11,8 @@ "showMoreConversations": "더 보기", "showFewerConversations": "접기", "agentNewConversation": "새 대화", + "agentUntitledConversation": "새 채팅", + "agentConversationActions": "채팅 작업", "agentElapsedTime": "소요 시간 {duration}", "agentConversationActions": "대화 작업", "agentMoveToTrash": "휴지통으로 이동", @@ -583,6 +590,7 @@ "revealMediaFailed": "파일 관리자에 미디어를 표시할 수 없습니다.", "openMatchingProject": "먼저 해당 프로젝트를 엽니다.", "projectMismatch": "이 위치에 있는 라이브러리는 기록과 일치하지 않습니다. 라이브러리 열기로 다시 선택하세요.", + "projectAlreadyExists": "이미 사용 중인 프로젝트 이름입니다. 다른 이름을 선택하거나 프로젝트 열기로 기존 프로젝트를 여세요.", "openProjectFirst": "먼저 라이브러리를 열어보세요", "localFilesOnly": "파일 관리자에서 로컬 파일 드래그", "foldersUnsupported": "파일을 선택합니다. 폴더 드래그는 아직 지원되지 않습니다.", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "프로젝트 저장 위치를 사용할 수 없습니다. 디스크나 네트워크를 확인하고 다시 시도하거나 위치를 변경하세요.", "projectLocationNotWritable": "프로젝트 저장 위치에 쓸 수 없습니다. 권한을 확인하거나 위치를 변경하세요.", "projectLocationCreateFailed": "프로젝트 저장 폴더를 만들거나 쓸 수 없습니다. 권한을 확인하거나 위치를 변경하세요.", + "removeProjectFromRecent": "최근 프로젝트에서 제거", "removeProjectFromSidebar": "사이드바에서 제거", "projectRemoved": "프로젝트를 목록에서 제거했습니다. 로컬 파일과 대화는 유지됩니다.", "agentNoConversations": "아직 대화가 없습니다", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "진단 패키지가 저장되었습니다.", "navigationChat": "채팅", "navigationLibrary": "라이브러리", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "색상 테마", + "paletteGraphite": "흑연색 · 파란색", + "paletteViolet": "부드러운 회색 · 보라색", + "paletteTeal": "따뜻한 회색 · 청록색", + "agentMinimize": "에이전트 최소화", + "agentDock": "에이전트 도킹", + "agentExpandConversation": "대화 펼치기", + "agentCollapseConversation": "대화 접기", + "noMatchingMedia": "일치하는 미디어 없음", + "sortMedia": "미디어 정렬", + "mediaSortImportOrder": "가져온 순서", + "mediaSortNameAscending": "이름 오름차순", + "mediaSortNameDescending": "이름 내림차순", + "mediaSelectedCount": "{count}개 선택됨", + "navigationHome": "홈", + "mediaThumbnailSize": "썸네일 크기", + "mediaThumbnailSmall": "작은 썸네일", + "mediaThumbnailMedium": "중간 썸네일", + "mediaThumbnailLarge": "큰 썸네일", + "mediaSpecification": "사양", + "resourceMyMedia": "내 미디어", + "resourceStickers": "스티커", + "resourceEffects": "효과", + "resourceTransitions": "전환", + "resourceMore": "더 보기", + "resourceLibraryEmpty": "사용 가능한 {category} 리소스가 없습니다", + "resourceImportedAudioHint": "가져온 오디오는 내 미디어에 있습니다.", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 2f32fef..cc648fd 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -116,6 +116,36 @@ abstract class AppLocalizations { Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'), ]; + /// No description provided for @timelineRulerStyle. + /// + /// In en, this message translates to: + /// **'Timeline ruler style'** + String get timelineRulerStyle; + + /// No description provided for @timelineRulerInline. + /// + /// In en, this message translates to: + /// **'Inline marks'** + String get timelineRulerInline; + + /// No description provided for @timelineRulerCentered. + /// + /// In en, this message translates to: + /// **'Centered labels'** + String get timelineRulerCentered; + + /// No description provided for @timelineRulerOverlay. + /// + /// In en, this message translates to: + /// **'Overlay marks'** + String get timelineRulerOverlay; + + /// No description provided for @preview. + /// + /// In en, this message translates to: + /// **'Preview'** + String get preview; + /// No description provided for @selectProject. /// /// In en, this message translates to: @@ -164,6 +194,12 @@ abstract class AppLocalizations { /// **'Could not create or write to the project save folder. Check permissions or change the location.'** String get projectLocationCreateFailed; + /// No description provided for @removeProjectFromRecent. + /// + /// In en, this message translates to: + /// **'Remove from recent projects'** + String get removeProjectFromRecent; + /// No description provided for @removeProjectFromSidebar. /// /// In en, this message translates to: @@ -242,11 +278,11 @@ abstract class AppLocalizations { /// **'New conversation'** String get agentNewConversation; - /// No description provided for @agentElapsedTime. + /// No description provided for @agentUntitledConversation. /// /// In en, this message translates to: - /// **'Took {duration}'** - String agentElapsedTime(String duration); + /// **'New chat'** + String get agentUntitledConversation; /// No description provided for @agentConversationActions. /// @@ -254,6 +290,12 @@ abstract class AppLocalizations { /// **'Conversation actions'** String get agentConversationActions; + /// No description provided for @agentElapsedTime. + /// + /// In en, this message translates to: + /// **'Took {duration}'** + String agentElapsedTime(String duration); + /// No description provided for @agentMoveToTrash. /// /// In en, this message translates to: @@ -2444,6 +2486,12 @@ abstract class AppLocalizations { /// **'The project at this location does not match the record. Select it again with Open project.'** String get projectMismatch; + /// No description provided for @projectAlreadyExists. + /// + /// In en, this message translates to: + /// **'This project name is already in use. Choose another name, or use Open project to open the existing project.'** + String get projectAlreadyExists; + /// No description provided for @openProjectFirst. /// /// In en, this message translates to: @@ -4111,6 +4159,168 @@ abstract class AppLocalizations { /// In en, this message translates to: /// **'Expand Agent'** String get agentFullscreen; + + /// No description provided for @agentMinimize. + /// + /// In en, this message translates to: + /// **'Minimize Agent'** + String get agentMinimize; + + /// No description provided for @agentDock. + /// + /// In en, this message translates to: + /// **'Dock Agent'** + String get agentDock; + + /// No description provided for @agentExpandConversation. + /// + /// In en, this message translates to: + /// **'Expand conversation'** + String get agentExpandConversation; + + /// No description provided for @agentCollapseConversation. + /// + /// In en, this message translates to: + /// **'Collapse conversation'** + String get agentCollapseConversation; + + /// No description provided for @colorPalette. + /// + /// In en, this message translates to: + /// **'Color palette'** + String get colorPalette; + + /// No description provided for @paletteGraphite. + /// + /// In en, this message translates to: + /// **'Graphite · Blue'** + String get paletteGraphite; + + /// No description provided for @paletteViolet. + /// + /// In en, this message translates to: + /// **'Soft gray · Violet'** + String get paletteViolet; + + /// No description provided for @paletteTeal. + /// + /// In en, this message translates to: + /// **'Warm gray · Teal'** + String get paletteTeal; + + /// No description provided for @noMatchingMedia. + /// + /// In en, this message translates to: + /// **'No matching media'** + String get noMatchingMedia; + + /// No description provided for @sortMedia. + /// + /// In en, this message translates to: + /// **'Sort media'** + String get sortMedia; + + /// No description provided for @mediaSortImportOrder. + /// + /// In en, this message translates to: + /// **'Import order'** + String get mediaSortImportOrder; + + /// No description provided for @mediaSortNameAscending. + /// + /// In en, this message translates to: + /// **'Name: A to Z'** + String get mediaSortNameAscending; + + /// No description provided for @mediaSortNameDescending. + /// + /// In en, this message translates to: + /// **'Name: Z to A'** + String get mediaSortNameDescending; + + /// No description provided for @mediaSelectedCount. + /// + /// In en, this message translates to: + /// **'{count} selected'** + String mediaSelectedCount(int count); + + /// No description provided for @navigationHome. + /// + /// In en, this message translates to: + /// **'Home'** + String get navigationHome; + + /// No description provided for @mediaThumbnailSize. + /// + /// In en, this message translates to: + /// **'Thumbnail size'** + String get mediaThumbnailSize; + + /// No description provided for @mediaThumbnailSmall. + /// + /// In en, this message translates to: + /// **'Small thumbnails'** + String get mediaThumbnailSmall; + + /// No description provided for @mediaThumbnailMedium. + /// + /// In en, this message translates to: + /// **'Medium thumbnails'** + String get mediaThumbnailMedium; + + /// No description provided for @mediaThumbnailLarge. + /// + /// In en, this message translates to: + /// **'Large thumbnails'** + String get mediaThumbnailLarge; + + /// No description provided for @mediaSpecification. + /// + /// In en, this message translates to: + /// **'Specifications'** + String get mediaSpecification; + + /// No description provided for @resourceMyMedia. + /// + /// In en, this message translates to: + /// **'My media'** + String get resourceMyMedia; + + /// No description provided for @resourceStickers. + /// + /// In en, this message translates to: + /// **'Stickers'** + String get resourceStickers; + + /// No description provided for @resourceEffects. + /// + /// In en, this message translates to: + /// **'Effects'** + String get resourceEffects; + + /// No description provided for @resourceTransitions. + /// + /// In en, this message translates to: + /// **'Transitions'** + String get resourceTransitions; + + /// No description provided for @resourceMore. + /// + /// In en, this message translates to: + /// **'More'** + String get resourceMore; + + /// No description provided for @resourceLibraryEmpty. + /// + /// In en, this message translates to: + /// **'No {category} resources available'** + String resourceLibraryEmpty(String category); + + /// No description provided for @resourceImportedAudioHint. + /// + /// In en, this message translates to: + /// **'Imported audio is in My media.'** + String get resourceImportedAudioHint; } class _AppLocalizationsDelegate diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index d10af14..c17442d 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsDe extends AppLocalizations { AppLocalizationsDe([String locale = 'de']) : super(locale); + @override + String get timelineRulerStyle => 'Zeitleisten-Skalenstil'; + + @override + String get timelineRulerInline => 'Markierungen neben Zeitcodes'; + + @override + String get timelineRulerCentered => 'Zentrierte Zeitcodes'; + + @override + String get timelineRulerOverlay => 'Überlagerte Markierungen'; + + @override + String get preview => 'Vorschau'; + @override String get selectProject => 'Projekt auswählen'; @@ -37,6 +52,10 @@ class AppLocalizationsDe extends AppLocalizations { String get projectLocationCreateFailed => 'Der Projektordner konnte nicht erstellt oder beschrieben werden. Prüfen Sie die Berechtigungen oder ändern Sie den Speicherort.'; + @override + String get removeProjectFromRecent => + 'Aus zuletzt verwendeten Projekten entfernen'; + @override String get removeProjectFromSidebar => 'Aus der Seitenleiste entfernen'; @@ -82,13 +101,16 @@ class AppLocalizationsDe extends AppLocalizations { String get agentNewConversation => 'Neue Unterhaltung'; @override - String agentElapsedTime(String duration) { - return 'Dauer $duration'; - } + String get agentUntitledConversation => 'Neuer Chat'; @override String get agentConversationActions => 'Unterhaltungsaktionen'; + @override + String agentElapsedTime(String duration) { + return 'Dauer $duration'; + } + @override String get agentMoveToTrash => 'In den Papierkorb verschieben'; @@ -1333,6 +1355,10 @@ class AppLocalizationsDe extends AppLocalizations { String get projectMismatch => 'Die Bibliothek an diesem Standort stimmt nicht mit dem Datensatz überein. Wählen Sie es erneut mit Bibliothek öffnen aus.'; + @override + String get projectAlreadyExists => + 'Dieser Projektname wird bereits verwendet. Wählen Sie einen anderen Namen oder öffnen Sie das bestehende Projekt über „Projekt öffnen“.'; + @override String get openProjectFirst => 'Öffnen Sie zunächst eine Bibliothek'; @@ -2238,4 +2264,90 @@ class AppLocalizationsDe extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'Agent minimieren'; + + @override + String get agentDock => 'Agent andocken'; + + @override + String get agentExpandConversation => 'Unterhaltung erweitern'; + + @override + String get agentCollapseConversation => 'Unterhaltung einklappen'; + + @override + String get colorPalette => 'Farbpalette'; + + @override + String get paletteGraphite => 'Graphit · Blau'; + + @override + String get paletteViolet => 'Sanftes Grau · Violett'; + + @override + String get paletteTeal => 'Warmes Grau · Türkis'; + + @override + String get noMatchingMedia => 'Keine passenden Medien'; + + @override + String get sortMedia => 'Medien sortieren'; + + @override + String get mediaSortImportOrder => 'Importreihenfolge'; + + @override + String get mediaSortNameAscending => 'Name: A bis Z'; + + @override + String get mediaSortNameDescending => 'Name: Z bis A'; + + @override + String mediaSelectedCount(int count) { + return '$count ausgewählt'; + } + + @override + String get navigationHome => 'Startseite'; + + @override + String get mediaThumbnailSize => 'Vorschaubildgröße'; + + @override + String get mediaThumbnailSmall => 'Kleine Vorschaubilder'; + + @override + String get mediaThumbnailMedium => 'Mittlere Vorschaubilder'; + + @override + String get mediaThumbnailLarge => 'Große Vorschaubilder'; + + @override + String get mediaSpecification => 'Eigenschaften'; + + @override + String get resourceMyMedia => 'Meine Medien'; + + @override + String get resourceStickers => 'Sticker'; + + @override + String get resourceEffects => 'Effekte'; + + @override + String get resourceTransitions => 'Übergänge'; + + @override + String get resourceMore => 'Mehr'; + + @override + String resourceLibraryEmpty(String category) { + return 'Keine Ressourcen für $category verfügbar'; + } + + @override + String get resourceImportedAudioHint => + 'Importiertes Audio befindet sich in Meine Medien.'; } diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index ab98394..64502dc 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsEn extends AppLocalizations { AppLocalizationsEn([String locale = 'en']) : super(locale); + @override + String get timelineRulerStyle => 'Timeline ruler style'; + + @override + String get timelineRulerInline => 'Inline marks'; + + @override + String get timelineRulerCentered => 'Centered labels'; + + @override + String get timelineRulerOverlay => 'Overlay marks'; + + @override + String get preview => 'Preview'; + @override String get selectProject => 'Select project'; @@ -37,6 +52,9 @@ class AppLocalizationsEn extends AppLocalizations { String get projectLocationCreateFailed => 'Could not create or write to the project save folder. Check permissions or change the location.'; + @override + String get removeProjectFromRecent => 'Remove from recent projects'; + @override String get removeProjectFromSidebar => 'Remove from sidebar'; @@ -82,13 +100,16 @@ class AppLocalizationsEn extends AppLocalizations { String get agentNewConversation => 'New conversation'; @override - String agentElapsedTime(String duration) { - return 'Took $duration'; - } + String get agentUntitledConversation => 'New chat'; @override String get agentConversationActions => 'Conversation actions'; + @override + String agentElapsedTime(String duration) { + return 'Took $duration'; + } + @override String get agentMoveToTrash => 'Move to Trash'; @@ -1308,6 +1329,10 @@ class AppLocalizationsEn extends AppLocalizations { String get projectMismatch => 'The project at this location does not match the record. Select it again with Open project.'; + @override + String get projectAlreadyExists => + 'This project name is already in use. Choose another name, or use Open project to open the existing project.'; + @override String get openProjectFirst => 'Open a project first'; @@ -2204,4 +2229,89 @@ class AppLocalizationsEn extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'Minimize Agent'; + + @override + String get agentDock => 'Dock Agent'; + + @override + String get agentExpandConversation => 'Expand conversation'; + + @override + String get agentCollapseConversation => 'Collapse conversation'; + + @override + String get colorPalette => 'Color palette'; + + @override + String get paletteGraphite => 'Graphite · Blue'; + + @override + String get paletteViolet => 'Soft gray · Violet'; + + @override + String get paletteTeal => 'Warm gray · Teal'; + + @override + String get noMatchingMedia => 'No matching media'; + + @override + String get sortMedia => 'Sort media'; + + @override + String get mediaSortImportOrder => 'Import order'; + + @override + String get mediaSortNameAscending => 'Name: A to Z'; + + @override + String get mediaSortNameDescending => 'Name: Z to A'; + + @override + String mediaSelectedCount(int count) { + return '$count selected'; + } + + @override + String get navigationHome => 'Home'; + + @override + String get mediaThumbnailSize => 'Thumbnail size'; + + @override + String get mediaThumbnailSmall => 'Small thumbnails'; + + @override + String get mediaThumbnailMedium => 'Medium thumbnails'; + + @override + String get mediaThumbnailLarge => 'Large thumbnails'; + + @override + String get mediaSpecification => 'Specifications'; + + @override + String get resourceMyMedia => 'My media'; + + @override + String get resourceStickers => 'Stickers'; + + @override + String get resourceEffects => 'Effects'; + + @override + String get resourceTransitions => 'Transitions'; + + @override + String get resourceMore => 'More'; + + @override + String resourceLibraryEmpty(String category) { + return 'No $category resources available'; + } + + @override + String get resourceImportedAudioHint => 'Imported audio is in My media.'; } diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index 750b63d..17505c1 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsEs extends AppLocalizations { AppLocalizationsEs([String locale = 'es']) : super(locale); + @override + String get timelineRulerStyle => 'Estilo de regla de tiempo'; + + @override + String get timelineRulerInline => 'Marcas en línea'; + + @override + String get timelineRulerCentered => 'Etiquetas centradas'; + + @override + String get timelineRulerOverlay => 'Marcas superpuestas'; + + @override + String get preview => 'Vista previa'; + @override String get selectProject => 'Seleccionar proyecto'; @@ -37,6 +52,9 @@ class AppLocalizationsEs extends AppLocalizations { String get projectLocationCreateFailed => 'No se pudo crear la carpeta del proyecto o escribir en ella. Comprueba los permisos o cambia la ubicación.'; + @override + String get removeProjectFromRecent => 'Quitar de proyectos recientes'; + @override String get removeProjectFromSidebar => 'Quitar de la barra lateral'; @@ -82,13 +100,16 @@ class AppLocalizationsEs extends AppLocalizations { String get agentNewConversation => 'Nueva conversación'; @override - String agentElapsedTime(String duration) { - return 'Duración $duration'; - } + String get agentUntitledConversation => 'Nuevo chat'; @override String get agentConversationActions => 'Acciones de conversación'; + @override + String agentElapsedTime(String duration) { + return 'Duración $duration'; + } + @override String get agentMoveToTrash => 'Mover a la papelera'; @@ -1332,6 +1353,10 @@ class AppLocalizationsEs extends AppLocalizations { String get projectMismatch => 'La biblioteca en esta ubicación no coincide con el registro. Selecciónelo nuevamente con Abrir biblioteca.'; + @override + String get projectAlreadyExists => + 'Este nombre de proyecto ya está en uso. Elija otro nombre o use Abrir proyecto para abrir el proyecto existente.'; + @override String get openProjectFirst => 'Abra una biblioteca primero'; @@ -2238,4 +2263,90 @@ class AppLocalizationsEs extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'Minimizar agente'; + + @override + String get agentDock => 'Acoplar agente'; + + @override + String get agentExpandConversation => 'Expandir conversación'; + + @override + String get agentCollapseConversation => 'Contraer conversación'; + + @override + String get colorPalette => 'Paleta de colores'; + + @override + String get paletteGraphite => 'Grafito · Azul'; + + @override + String get paletteViolet => 'Gris suave · Violeta'; + + @override + String get paletteTeal => 'Gris cálido · Verde azulado'; + + @override + String get noMatchingMedia => 'No hay medios coincidentes'; + + @override + String get sortMedia => 'Ordenar medios'; + + @override + String get mediaSortImportOrder => 'Orden de importación'; + + @override + String get mediaSortNameAscending => 'Nombre: A a Z'; + + @override + String get mediaSortNameDescending => 'Nombre: Z a A'; + + @override + String mediaSelectedCount(int count) { + return '$count seleccionados'; + } + + @override + String get navigationHome => 'Inicio'; + + @override + String get mediaThumbnailSize => 'Tamaño de miniatura'; + + @override + String get mediaThumbnailSmall => 'Miniaturas pequeñas'; + + @override + String get mediaThumbnailMedium => 'Miniaturas medianas'; + + @override + String get mediaThumbnailLarge => 'Miniaturas grandes'; + + @override + String get mediaSpecification => 'Especificaciones'; + + @override + String get resourceMyMedia => 'Mis medios'; + + @override + String get resourceStickers => 'Adhesivos'; + + @override + String get resourceEffects => 'Efectos'; + + @override + String get resourceTransitions => 'Transiciones'; + + @override + String get resourceMore => 'Más'; + + @override + String resourceLibraryEmpty(String category) { + return 'No hay recursos de $category disponibles'; + } + + @override + String get resourceImportedAudioHint => + 'El audio importado está en Mis medios.'; } diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index e2c13c8..e90e827 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsFr extends AppLocalizations { AppLocalizationsFr([String locale = 'fr']) : super(locale); + @override + String get timelineRulerStyle => 'Style de règle de montage'; + + @override + String get timelineRulerInline => 'Graduations en ligne'; + + @override + String get timelineRulerCentered => 'Libellés centrés'; + + @override + String get timelineRulerOverlay => 'Graduations superposées'; + + @override + String get preview => 'Aperçu'; + @override String get selectProject => 'Sélectionner un projet'; @@ -37,6 +52,9 @@ class AppLocalizationsFr extends AppLocalizations { String get projectLocationCreateFailed => 'Impossible de créer le dossier de sauvegarde ou d’y écrire. Vérifiez les autorisations ou changez d’emplacement.'; + @override + String get removeProjectFromRecent => 'Retirer des projets récents'; + @override String get removeProjectFromSidebar => 'Retirer de la barre latérale'; @@ -82,13 +100,16 @@ class AppLocalizationsFr extends AppLocalizations { String get agentNewConversation => 'Nouvelle conversation'; @override - String agentElapsedTime(String duration) { - return 'Durée $duration'; - } + String get agentUntitledConversation => 'Nouvelle conversation'; @override String get agentConversationActions => 'Actions de la conversation'; + @override + String agentElapsedTime(String duration) { + return 'Durée $duration'; + } + @override String get agentMoveToTrash => 'Déplacer vers la corbeille'; @@ -1330,6 +1351,10 @@ class AppLocalizationsFr extends AppLocalizations { String get projectMismatch => 'La bibliothèque à cet emplacement ne correspond pas à la notice. Sélectionnez-le à nouveau avec Ouvrir la bibliothèque.'; + @override + String get projectAlreadyExists => + 'Ce nom de projet est déjà utilisé. Choisissez un autre nom ou utilisez Ouvrir le projet pour ouvrir le projet existant.'; + @override String get openProjectFirst => 'Ouvrez d\'abord une bibliothèque'; @@ -2241,4 +2266,90 @@ class AppLocalizationsFr extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'Réduire l’agent'; + + @override + String get agentDock => 'Ancrer l’agent'; + + @override + String get agentExpandConversation => 'Développer la conversation'; + + @override + String get agentCollapseConversation => 'Réduire la conversation'; + + @override + String get colorPalette => 'Palette de couleurs'; + + @override + String get paletteGraphite => 'Graphite · Bleu'; + + @override + String get paletteViolet => 'Gris doux · Violet'; + + @override + String get paletteTeal => 'Gris chaud · Sarcelle'; + + @override + String get noMatchingMedia => 'Aucun média correspondant'; + + @override + String get sortMedia => 'Trier les médias'; + + @override + String get mediaSortImportOrder => 'Ordre d’importation'; + + @override + String get mediaSortNameAscending => 'Nom : A à Z'; + + @override + String get mediaSortNameDescending => 'Nom : Z à A'; + + @override + String mediaSelectedCount(int count) { + return '$count sélectionnés'; + } + + @override + String get navigationHome => 'Accueil'; + + @override + String get mediaThumbnailSize => 'Taille des vignettes'; + + @override + String get mediaThumbnailSmall => 'Petites vignettes'; + + @override + String get mediaThumbnailMedium => 'Vignettes moyennes'; + + @override + String get mediaThumbnailLarge => 'Grandes vignettes'; + + @override + String get mediaSpecification => 'Caractéristiques'; + + @override + String get resourceMyMedia => 'Mes médias'; + + @override + String get resourceStickers => 'Autocollants'; + + @override + String get resourceEffects => 'Effets'; + + @override + String get resourceTransitions => 'Transitions'; + + @override + String get resourceMore => 'Plus'; + + @override + String resourceLibraryEmpty(String category) { + return 'Aucune ressource disponible pour $category'; + } + + @override + String get resourceImportedAudioHint => + 'Les fichiers audio importés sont dans Mes médias.'; } diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index 58d1f67..93eb538 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsIt extends AppLocalizations { AppLocalizationsIt([String locale = 'it']) : super(locale); + @override + String get timelineRulerStyle => 'Stile righello della timeline'; + + @override + String get timelineRulerInline => 'Tacche in linea'; + + @override + String get timelineRulerCentered => 'Etichette centrate'; + + @override + String get timelineRulerOverlay => 'Tacche sovrapposte'; + + @override + String get preview => 'Anteprima'; + @override String get selectProject => 'Seleziona progetto'; @@ -37,6 +52,9 @@ class AppLocalizationsIt extends AppLocalizations { String get projectLocationCreateFailed => 'Impossibile creare la cartella del progetto o scrivervi. Controlla le autorizzazioni o cambia posizione.'; + @override + String get removeProjectFromRecent => 'Rimuovi dai progetti recenti'; + @override String get removeProjectFromSidebar => 'Rimuovi dalla barra laterale'; @@ -82,13 +100,16 @@ class AppLocalizationsIt extends AppLocalizations { String get agentNewConversation => 'Nuova conversazione'; @override - String agentElapsedTime(String duration) { - return 'Durata $duration'; - } + String get agentUntitledConversation => 'Nuova chat'; @override String get agentConversationActions => 'Azioni della conversazione'; + @override + String agentElapsedTime(String duration) { + return 'Durata $duration'; + } + @override String get agentMoveToTrash => 'Sposta nel cestino'; @@ -1327,6 +1348,10 @@ class AppLocalizationsIt extends AppLocalizations { String get projectMismatch => 'La libreria in questa posizione non corrisponde al record. Selezionalo di nuovo con Apri libreria.'; + @override + String get projectAlreadyExists => + 'Questo nome di progetto è già in uso. Scegli un altro nome oppure usa Apri progetto per aprire il progetto esistente.'; + @override String get openProjectFirst => 'Apri prima una libreria'; @@ -2231,4 +2256,90 @@ class AppLocalizationsIt extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'Riduci agente'; + + @override + String get agentDock => 'Ancora agente'; + + @override + String get agentExpandConversation => 'Espandi conversazione'; + + @override + String get agentCollapseConversation => 'Comprimi conversazione'; + + @override + String get colorPalette => 'Palette colori'; + + @override + String get paletteGraphite => 'Grafite · Blu'; + + @override + String get paletteViolet => 'Grigio tenue · Viola'; + + @override + String get paletteTeal => 'Grigio caldo · Verde acqua'; + + @override + String get noMatchingMedia => 'Nessun file corrispondente'; + + @override + String get sortMedia => 'Ordina file'; + + @override + String get mediaSortImportOrder => 'Ordine di importazione'; + + @override + String get mediaSortNameAscending => 'Nome: A–Z'; + + @override + String get mediaSortNameDescending => 'Nome: Z–A'; + + @override + String mediaSelectedCount(int count) { + return '$count selezionati'; + } + + @override + String get navigationHome => 'Home'; + + @override + String get mediaThumbnailSize => 'Dimensione miniature'; + + @override + String get mediaThumbnailSmall => 'Miniature piccole'; + + @override + String get mediaThumbnailMedium => 'Miniature medie'; + + @override + String get mediaThumbnailLarge => 'Miniature grandi'; + + @override + String get mediaSpecification => 'Specifiche'; + + @override + String get resourceMyMedia => 'I miei media'; + + @override + String get resourceStickers => 'Adesivi'; + + @override + String get resourceEffects => 'Effetti'; + + @override + String get resourceTransitions => 'Transizioni'; + + @override + String get resourceMore => 'Altro'; + + @override + String resourceLibraryEmpty(String category) { + return 'Nessuna risorsa disponibile per $category'; + } + + @override + String get resourceImportedAudioHint => + 'L’audio importato si trova in I miei media.'; } diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index 144cecb..d3343e6 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsJa extends AppLocalizations { AppLocalizationsJa([String locale = 'ja']) : super(locale); + @override + String get timelineRulerStyle => 'タイムラインの目盛りスタイル'; + + @override + String get timelineRulerInline => '同一帯に交互配置'; + + @override + String get timelineRulerCentered => 'タイムコードを中央配置'; + + @override + String get timelineRulerOverlay => '薄い目盛りを重ねる'; + + @override + String get preview => 'プレビュー'; + @override String get selectProject => 'プロジェクトを選択'; @@ -36,6 +51,9 @@ class AppLocalizationsJa extends AppLocalizations { String get projectLocationCreateFailed => 'プロジェクト保存フォルダの作成または書き込みに失敗しました。アクセス権を確認するか、保存先を変更してください。'; + @override + String get removeProjectFromRecent => '最近のプロジェクトから削除'; + @override String get removeProjectFromSidebar => 'サイドバーから削除'; @@ -79,13 +97,16 @@ class AppLocalizationsJa extends AppLocalizations { String get agentNewConversation => '新しい会話'; @override - String agentElapsedTime(String duration) { - return '所要時間 $duration'; - } + String get agentUntitledConversation => '新しいチャット'; @override String get agentConversationActions => '会話の操作'; + @override + String agentElapsedTime(String duration) { + return '所要時間 $duration'; + } + @override String get agentMoveToTrash => 'ゴミ箱に移動'; @@ -1271,6 +1292,10 @@ class AppLocalizationsJa extends AppLocalizations { @override String get projectMismatch => 'この場所のライブラリはレコードと一致しません。 「ライブラリを開く」で再度選択します。'; + @override + String get projectAlreadyExists => + 'このプロジェクト名はすでに使用されています。別の名前を選ぶか、「プロジェクトを開く」で既存のプロジェクトを開いてください。'; + @override String get openProjectFirst => 'まずライブラリを開いてください'; @@ -2139,4 +2164,89 @@ class AppLocalizationsJa extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'エージェントを最小化'; + + @override + String get agentDock => 'エージェントをドッキング'; + + @override + String get agentExpandConversation => '会話を展開'; + + @override + String get agentCollapseConversation => '会話を折りたたむ'; + + @override + String get colorPalette => '配色'; + + @override + String get paletteGraphite => 'グラファイト · ブルー'; + + @override + String get paletteViolet => 'ソフトグレー · パープル'; + + @override + String get paletteTeal => 'ウォームグレー · ティール'; + + @override + String get noMatchingMedia => '一致する素材がありません'; + + @override + String get sortMedia => '素材を並べ替え'; + + @override + String get mediaSortImportOrder => '読み込み順'; + + @override + String get mediaSortNameAscending => '名前の昇順'; + + @override + String get mediaSortNameDescending => '名前の降順'; + + @override + String mediaSelectedCount(int count) { + return '$count 個選択'; + } + + @override + String get navigationHome => 'ホーム'; + + @override + String get mediaThumbnailSize => 'サムネイルサイズ'; + + @override + String get mediaThumbnailSmall => '小さいサムネイル'; + + @override + String get mediaThumbnailMedium => '中サイズのサムネイル'; + + @override + String get mediaThumbnailLarge => '大きいサムネイル'; + + @override + String get mediaSpecification => '仕様'; + + @override + String get resourceMyMedia => 'マイメディア'; + + @override + String get resourceStickers => 'ステッカー'; + + @override + String get resourceEffects => 'エフェクト'; + + @override + String get resourceTransitions => 'トランジション'; + + @override + String get resourceMore => 'その他'; + + @override + String resourceLibraryEmpty(String category) { + return '$categoryの素材はありません'; + } + + @override + String get resourceImportedAudioHint => '読み込んだ音声は「マイメディア」にあります。'; } diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index ddaf341..9f509f7 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsKo extends AppLocalizations { AppLocalizationsKo([String locale = 'ko']) : super(locale); + @override + String get timelineRulerStyle => '타임라인 눈금 스타일'; + + @override + String get timelineRulerInline => '같은 줄에 교차 배치'; + + @override + String get timelineRulerCentered => '시간 코드 가운데 정렬'; + + @override + String get timelineRulerOverlay => '옅은 눈금 겹치기'; + + @override + String get preview => '미리보기'; + @override String get selectProject => '프로젝트 선택'; @@ -36,6 +51,9 @@ class AppLocalizationsKo extends AppLocalizations { String get projectLocationCreateFailed => '프로젝트 저장 폴더를 만들거나 쓸 수 없습니다. 권한을 확인하거나 위치를 변경하세요.'; + @override + String get removeProjectFromRecent => '최근 프로젝트에서 제거'; + @override String get removeProjectFromSidebar => '사이드바에서 제거'; @@ -79,13 +97,16 @@ class AppLocalizationsKo extends AppLocalizations { String get agentNewConversation => '새 대화'; @override - String agentElapsedTime(String duration) { - return '소요 시간 $duration'; - } + String get agentUntitledConversation => '새 채팅'; @override String get agentConversationActions => '대화 작업'; + @override + String agentElapsedTime(String duration) { + return '소요 시간 $duration'; + } + @override String get agentMoveToTrash => '휴지통으로 이동'; @@ -1270,6 +1291,10 @@ class AppLocalizationsKo extends AppLocalizations { String get projectMismatch => '이 위치에 있는 라이브러리는 기록과 일치하지 않습니다. 라이브러리 열기로 다시 선택하세요.'; + @override + String get projectAlreadyExists => + '이미 사용 중인 프로젝트 이름입니다. 다른 이름을 선택하거나 프로젝트 열기로 기존 프로젝트를 여세요.'; + @override String get openProjectFirst => '먼저 라이브러리를 열어보세요'; @@ -2139,4 +2164,89 @@ class AppLocalizationsKo extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => '에이전트 최소화'; + + @override + String get agentDock => '에이전트 도킹'; + + @override + String get agentExpandConversation => '대화 펼치기'; + + @override + String get agentCollapseConversation => '대화 접기'; + + @override + String get colorPalette => '색상 테마'; + + @override + String get paletteGraphite => '흑연색 · 파란색'; + + @override + String get paletteViolet => '부드러운 회색 · 보라색'; + + @override + String get paletteTeal => '따뜻한 회색 · 청록색'; + + @override + String get noMatchingMedia => '일치하는 미디어 없음'; + + @override + String get sortMedia => '미디어 정렬'; + + @override + String get mediaSortImportOrder => '가져온 순서'; + + @override + String get mediaSortNameAscending => '이름 오름차순'; + + @override + String get mediaSortNameDescending => '이름 내림차순'; + + @override + String mediaSelectedCount(int count) { + return '$count개 선택됨'; + } + + @override + String get navigationHome => '홈'; + + @override + String get mediaThumbnailSize => '썸네일 크기'; + + @override + String get mediaThumbnailSmall => '작은 썸네일'; + + @override + String get mediaThumbnailMedium => '중간 썸네일'; + + @override + String get mediaThumbnailLarge => '큰 썸네일'; + + @override + String get mediaSpecification => '사양'; + + @override + String get resourceMyMedia => '내 미디어'; + + @override + String get resourceStickers => '스티커'; + + @override + String get resourceEffects => '효과'; + + @override + String get resourceTransitions => '전환'; + + @override + String get resourceMore => '더 보기'; + + @override + String resourceLibraryEmpty(String category) { + return '사용 가능한 $category 리소스가 없습니다'; + } + + @override + String get resourceImportedAudioHint => '가져온 오디오는 내 미디어에 있습니다.'; } diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index 7b37f9f..085346d 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsPt extends AppLocalizations { AppLocalizationsPt([String locale = 'pt']) : super(locale); + @override + String get timelineRulerStyle => 'Estilo da régua da linha do tempo'; + + @override + String get timelineRulerInline => 'Marcas em linha'; + + @override + String get timelineRulerCentered => 'Rótulos centralizados'; + + @override + String get timelineRulerOverlay => 'Marcas sobrepostas'; + + @override + String get preview => 'Pré-visualização'; + @override String get selectProject => 'Selecionar projeto'; @@ -37,6 +52,9 @@ class AppLocalizationsPt extends AppLocalizations { String get projectLocationCreateFailed => 'Não foi possível criar a pasta do projeto ou gravar nela. Verifique as permissões ou altere o local.'; + @override + String get removeProjectFromRecent => 'Remover dos projetos recentes'; + @override String get removeProjectFromSidebar => 'Remover da barra lateral'; @@ -82,13 +100,16 @@ class AppLocalizationsPt extends AppLocalizations { String get agentNewConversation => 'Nova conversa'; @override - String agentElapsedTime(String duration) { - return 'Duração $duration'; - } + String get agentUntitledConversation => 'Nova conversa'; @override String get agentConversationActions => 'Ações da conversa'; + @override + String agentElapsedTime(String duration) { + return 'Duração $duration'; + } + @override String get agentMoveToTrash => 'Mover para a lixeira'; @@ -1327,6 +1348,10 @@ class AppLocalizationsPt extends AppLocalizations { String get projectMismatch => 'A biblioteca neste local não corresponde ao registro. Selecione-o novamente com Abrir biblioteca.'; + @override + String get projectAlreadyExists => + 'Este nome de projeto já está em uso. Escolha outro nome ou use Abrir projeto para abrir o projeto existente.'; + @override String get openProjectFirst => 'Abra uma biblioteca primeiro'; @@ -2231,4 +2256,90 @@ class AppLocalizationsPt extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'Minimizar agente'; + + @override + String get agentDock => 'Acoplar agente'; + + @override + String get agentExpandConversation => 'Expandir conversa'; + + @override + String get agentCollapseConversation => 'Recolher conversa'; + + @override + String get colorPalette => 'Paleta de cores'; + + @override + String get paletteGraphite => 'Grafite · Azul'; + + @override + String get paletteViolet => 'Cinza suave · Violeta'; + + @override + String get paletteTeal => 'Cinza quente · Verde-azulado'; + + @override + String get noMatchingMedia => 'Nenhum arquivo correspondente'; + + @override + String get sortMedia => 'Ordenar mídia'; + + @override + String get mediaSortImportOrder => 'Ordem de importação'; + + @override + String get mediaSortNameAscending => 'Nome: A a Z'; + + @override + String get mediaSortNameDescending => 'Nome: Z a A'; + + @override + String mediaSelectedCount(int count) { + return '$count selecionados'; + } + + @override + String get navigationHome => 'Início'; + + @override + String get mediaThumbnailSize => 'Tamanho das miniaturas'; + + @override + String get mediaThumbnailSmall => 'Miniaturas pequenas'; + + @override + String get mediaThumbnailMedium => 'Miniaturas médias'; + + @override + String get mediaThumbnailLarge => 'Miniaturas grandes'; + + @override + String get mediaSpecification => 'Especificações'; + + @override + String get resourceMyMedia => 'Minha mídia'; + + @override + String get resourceStickers => 'Adesivos'; + + @override + String get resourceEffects => 'Efeitos'; + + @override + String get resourceTransitions => 'Transições'; + + @override + String get resourceMore => 'Mais'; + + @override + String resourceLibraryEmpty(String category) { + return 'Não há recursos de $category disponíveis'; + } + + @override + String get resourceImportedAudioHint => + 'O áudio importado está em Minha mídia.'; } diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index 2bb14cc..c9955a6 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsRu extends AppLocalizations { AppLocalizationsRu([String locale = 'ru']) : super(locale); + @override + String get timelineRulerStyle => 'Стиль линейки времени'; + + @override + String get timelineRulerInline => 'Метки в одной строке'; + + @override + String get timelineRulerCentered => 'Коды по центру'; + + @override + String get timelineRulerOverlay => 'Наложение меток'; + + @override + String get preview => 'Предпросмотр'; + @override String get selectProject => 'Выбрать проект'; @@ -37,6 +52,9 @@ class AppLocalizationsRu extends AppLocalizations { String get projectLocationCreateFailed => 'Не удалось создать папку проекта или записать в неё данные. Проверьте разрешения или выберите другое место.'; + @override + String get removeProjectFromRecent => 'Убрать из недавних проектов'; + @override String get removeProjectFromSidebar => 'Убрать с боковой панели'; @@ -82,13 +100,16 @@ class AppLocalizationsRu extends AppLocalizations { String get agentNewConversation => 'Новый диалог'; @override - String agentElapsedTime(String duration) { - return 'Время $duration'; - } + String get agentUntitledConversation => 'Новый чат'; @override String get agentConversationActions => 'Действия с диалогом'; + @override + String agentElapsedTime(String duration) { + return 'Время $duration'; + } + @override String get agentMoveToTrash => 'Переместить в корзину'; @@ -1322,6 +1343,10 @@ class AppLocalizationsRu extends AppLocalizations { String get projectMismatch => 'Библиотека по этому адресу не соответствует записи. Выберите его еще раз с помощью команды «Открыть библиотеку».'; + @override + String get projectAlreadyExists => + 'Это имя проекта уже используется. Выберите другое имя или откройте существующий проект через «Открыть проект».'; + @override String get openProjectFirst => 'Сначала откройте библиотеку'; @@ -2224,4 +2249,90 @@ class AppLocalizationsRu extends AppLocalizations { @override String get agentFullscreen => 'Expand Agent'; + + @override + String get agentMinimize => 'Свернуть агента'; + + @override + String get agentDock => 'Закрепить агента'; + + @override + String get agentExpandConversation => 'Развернуть диалог'; + + @override + String get agentCollapseConversation => 'Свернуть диалог'; + + @override + String get colorPalette => 'Цветовая палитра'; + + @override + String get paletteGraphite => 'Графит · Синий'; + + @override + String get paletteViolet => 'Мягкий серый · Фиолетовый'; + + @override + String get paletteTeal => 'Тёплый серый · Бирюзовый'; + + @override + String get noMatchingMedia => 'Нет подходящих материалов'; + + @override + String get sortMedia => 'Сортировка материалов'; + + @override + String get mediaSortImportOrder => 'Порядок импорта'; + + @override + String get mediaSortNameAscending => 'Имя: А–Я'; + + @override + String get mediaSortNameDescending => 'Имя: Я–А'; + + @override + String mediaSelectedCount(int count) { + return 'Выбрано: $count'; + } + + @override + String get navigationHome => 'Главная'; + + @override + String get mediaThumbnailSize => 'Размер миниатюр'; + + @override + String get mediaThumbnailSmall => 'Маленькие миниатюры'; + + @override + String get mediaThumbnailMedium => 'Средние миниатюры'; + + @override + String get mediaThumbnailLarge => 'Большие миниатюры'; + + @override + String get mediaSpecification => 'Характеристики'; + + @override + String get resourceMyMedia => 'Мои медиа'; + + @override + String get resourceStickers => 'Стикеры'; + + @override + String get resourceEffects => 'Эффекты'; + + @override + String get resourceTransitions => 'Переходы'; + + @override + String get resourceMore => 'Ещё'; + + @override + String resourceLibraryEmpty(String category) { + return 'Нет доступных ресурсов: $category'; + } + + @override + String get resourceImportedAudioHint => + 'Импортированное аудио находится в разделе «Мои медиа».'; } diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index 00c669f..4321dc4 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -9,6 +9,21 @@ import 'app_localizations.dart'; class AppLocalizationsZh extends AppLocalizations { AppLocalizationsZh([String locale = 'zh']) : super(locale); + @override + String get timelineRulerStyle => '时间线刻度风格'; + + @override + String get timelineRulerInline => '同带交错'; + + @override + String get timelineRulerCentered => '居中锚定'; + + @override + String get timelineRulerOverlay => '淡刻度叠印'; + + @override + String get preview => '预览'; + @override String get selectProject => '选择项目'; @@ -33,6 +48,9 @@ class AppLocalizationsZh extends AppLocalizations { @override String get projectLocationCreateFailed => '无法创建或写入项目保存目录,请检查权限或更改位置。'; + @override + String get removeProjectFromRecent => '从最近项目移除'; + @override String get removeProjectFromSidebar => '从侧边栏移除'; @@ -75,13 +93,16 @@ class AppLocalizationsZh extends AppLocalizations { String get agentNewConversation => '新建对话'; @override - String agentElapsedTime(String duration) { - return '用时 $duration'; - } + String get agentUntitledConversation => '新聊天'; @override String get agentConversationActions => '对话操作'; + @override + String agentElapsedTime(String duration) { + return '用时 $duration'; + } + @override String get agentMoveToTrash => '移至回收区'; @@ -1245,6 +1266,9 @@ class AppLocalizationsZh extends AppLocalizations { @override String get projectMismatch => '此位置的项目与记录不一致,请使用“打开项目”重新选择。'; + @override + String get projectAlreadyExists => '该项目名称已被占用。请更换名称,或使用“打开项目”打开已有项目。'; + @override String get openProjectFirst => '请先打开项目'; @@ -2097,12 +2121,112 @@ class AppLocalizationsZh extends AppLocalizations { @override String get agentFullscreen => '全屏 Agent'; + + @override + String get agentMinimize => '缩小 Agent'; + + @override + String get agentDock => '还原 Agent'; + + @override + String get agentExpandConversation => '展开对话'; + + @override + String get agentCollapseConversation => '收起对话'; + + @override + String get colorPalette => '配色方案'; + + @override + String get paletteGraphite => '石墨灰 · 蓝色'; + + @override + String get paletteViolet => '柔灰 · 紫色'; + + @override + String get paletteTeal => '暖灰 · 青绿'; + + @override + String get noMatchingMedia => '没有匹配的素材'; + + @override + String get sortMedia => '素材排序'; + + @override + String get mediaSortImportOrder => '导入顺序'; + + @override + String get mediaSortNameAscending => '名称升序'; + + @override + String get mediaSortNameDescending => '名称降序'; + + @override + String mediaSelectedCount(int count) { + return '已选 $count 个'; + } + + @override + String get navigationHome => '首页'; + + @override + String get mediaThumbnailSize => '缩略图大小'; + + @override + String get mediaThumbnailSmall => '小缩略图'; + + @override + String get mediaThumbnailMedium => '中缩略图'; + + @override + String get mediaThumbnailLarge => '大缩略图'; + + @override + String get mediaSpecification => '规格'; + + @override + String get resourceMyMedia => '我的素材'; + + @override + String get resourceStickers => '贴纸'; + + @override + String get resourceEffects => '特效'; + + @override + String get resourceTransitions => '转场'; + + @override + String get resourceMore => '更多'; + + @override + String resourceLibraryEmpty(String category) { + return '暂无$category资源'; + } + + @override + String get resourceImportedAudioHint => '导入的音频可在“我的素材”中找到。'; } /// The translations for Chinese, using the Han script (`zh_Hans`). class AppLocalizationsZhHans extends AppLocalizationsZh { AppLocalizationsZhHans() : super('zh_Hans'); + @override + String get timelineRulerStyle => '时间线刻度风格'; + + @override + String get timelineRulerInline => '同带交错'; + + @override + String get timelineRulerCentered => '居中锚定'; + + @override + String get timelineRulerOverlay => '淡刻度叠印'; + + @override + String get preview => '预览'; + @override String get selectProject => '选择项目'; @@ -2127,6 +2251,9 @@ class AppLocalizationsZhHans extends AppLocalizationsZh { @override String get projectLocationCreateFailed => '无法创建或写入项目保存目录,请检查权限或更改位置。'; + @override + String get removeProjectFromRecent => '从最近项目移除'; + @override String get removeProjectFromSidebar => '从侧边栏移除'; @@ -2169,13 +2296,16 @@ class AppLocalizationsZhHans extends AppLocalizationsZh { String get agentNewConversation => '新建对话'; @override - String agentElapsedTime(String duration) { - return '用时 $duration'; - } + String get agentUntitledConversation => '新聊天'; @override String get agentConversationActions => '对话操作'; + @override + String agentElapsedTime(String duration) { + return '用时 $duration'; + } + @override String get agentMoveToTrash => '移至回收区'; @@ -3339,6 +3469,9 @@ class AppLocalizationsZhHans extends AppLocalizationsZh { @override String get projectMismatch => '此位置的项目与记录不一致,请使用“打开项目”重新选择。'; + @override + String get projectAlreadyExists => '该项目名称已被占用。请更换名称,或使用“打开项目”打开已有项目。'; + @override String get openProjectFirst => '请先打开项目'; @@ -4191,12 +4324,112 @@ class AppLocalizationsZhHans extends AppLocalizationsZh { @override String get agentFullscreen => '全屏 Agent'; + + @override + String get agentMinimize => '缩小 Agent'; + + @override + String get agentDock => '还原 Agent'; + + @override + String get agentExpandConversation => '展开对话'; + + @override + String get agentCollapseConversation => '收起对话'; + + @override + String get colorPalette => '配色方案'; + + @override + String get paletteGraphite => '石墨灰 · 蓝色'; + + @override + String get paletteViolet => '柔灰 · 紫色'; + + @override + String get paletteTeal => '暖灰 · 青绿'; + + @override + String get noMatchingMedia => '没有匹配的素材'; + + @override + String get sortMedia => '素材排序'; + + @override + String get mediaSortImportOrder => '导入顺序'; + + @override + String get mediaSortNameAscending => '名称升序'; + + @override + String get mediaSortNameDescending => '名称降序'; + + @override + String mediaSelectedCount(int count) { + return '已选 $count 个'; + } + + @override + String get navigationHome => '首页'; + + @override + String get mediaThumbnailSize => '缩略图大小'; + + @override + String get mediaThumbnailSmall => '小缩略图'; + + @override + String get mediaThumbnailMedium => '中缩略图'; + + @override + String get mediaThumbnailLarge => '大缩略图'; + + @override + String get mediaSpecification => '规格'; + + @override + String get resourceMyMedia => '我的素材'; + + @override + String get resourceStickers => '贴纸'; + + @override + String get resourceEffects => '特效'; + + @override + String get resourceTransitions => '转场'; + + @override + String get resourceMore => '更多'; + + @override + String resourceLibraryEmpty(String category) { + return '暂无$category资源'; + } + + @override + String get resourceImportedAudioHint => '导入的音频可在“我的素材”中找到。'; } /// The translations for Chinese, using the Han script (`zh_Hant`). class AppLocalizationsZhHant extends AppLocalizationsZh { AppLocalizationsZhHant() : super('zh_Hant'); + @override + String get timelineRulerStyle => '時間線刻度風格'; + + @override + String get timelineRulerInline => '同帶交錯'; + + @override + String get timelineRulerCentered => '居中錨定'; + + @override + String get timelineRulerOverlay => '淡刻度疊印'; + + @override + String get preview => '預覽'; + @override String get selectProject => '選擇專案'; @@ -4221,6 +4454,9 @@ class AppLocalizationsZhHant extends AppLocalizationsZh { @override String get projectLocationCreateFailed => '無法建立或寫入專案儲存目錄,請檢查權限或變更位置。'; + @override + String get removeProjectFromRecent => '從最近專案移除'; + @override String get removeProjectFromSidebar => '從側邊欄移除'; @@ -4263,13 +4499,16 @@ class AppLocalizationsZhHant extends AppLocalizationsZh { String get agentNewConversation => '新增對話'; @override - String agentElapsedTime(String duration) { - return '耗時 $duration'; - } + String get agentUntitledConversation => '新聊天'; @override String get agentConversationActions => '對話操作'; + @override + String agentElapsedTime(String duration) { + return '耗時 $duration'; + } + @override String get agentMoveToTrash => '移至資源回收桶'; @@ -5433,6 +5672,9 @@ class AppLocalizationsZhHant extends AppLocalizationsZh { @override String get projectMismatch => '此位置的專案與記錄不一致,請使用“開啟專案”重新選擇。'; + @override + String get projectAlreadyExists => '此專案名稱已被使用。請更換名稱,或使用「開啟專案」開啟現有專案。'; + @override String get openProjectFirst => '請先開啟專案'; @@ -6285,4 +6527,89 @@ class AppLocalizationsZhHant extends AppLocalizationsZh { @override String get agentFullscreen => '全屏 Agent'; + + @override + String get agentMinimize => '縮小 Agent'; + + @override + String get agentDock => '還原 Agent'; + + @override + String get agentExpandConversation => '展開對話'; + + @override + String get agentCollapseConversation => '收起對話'; + + @override + String get colorPalette => '配色方案'; + + @override + String get paletteGraphite => '石墨灰 · 藍色'; + + @override + String get paletteViolet => '柔灰 · 紫色'; + + @override + String get paletteTeal => '暖灰 · 青綠'; + + @override + String get noMatchingMedia => '沒有符合的素材'; + + @override + String get sortMedia => '素材排序'; + + @override + String get mediaSortImportOrder => '匯入順序'; + + @override + String get mediaSortNameAscending => '名稱升冪'; + + @override + String get mediaSortNameDescending => '名稱降冪'; + + @override + String mediaSelectedCount(int count) { + return '已選 $count 個'; + } + + @override + String get navigationHome => '首頁'; + + @override + String get mediaThumbnailSize => '縮圖大小'; + + @override + String get mediaThumbnailSmall => '小縮圖'; + + @override + String get mediaThumbnailMedium => '中縮圖'; + + @override + String get mediaThumbnailLarge => '大縮圖'; + + @override + String get mediaSpecification => '規格'; + + @override + String get resourceMyMedia => '我的素材'; + + @override + String get resourceStickers => '貼紙'; + + @override + String get resourceEffects => '特效'; + + @override + String get resourceTransitions => '轉場'; + + @override + String get resourceMore => '更多'; + + @override + String resourceLibraryEmpty(String category) { + return '暫無$category資源'; + } + + @override + String get resourceImportedAudioHint => '匯入的音訊可在「我的素材」中找到。'; } diff --git a/lib/l10n/app_messages.dart b/lib/l10n/app_messages.dart index 4be8f66..35a6808 100644 --- a/lib/l10n/app_messages.dart +++ b/lib/l10n/app_messages.dart @@ -27,6 +27,7 @@ extension LocalizedAppMessages on AppLocalizations { AppErrorCode.openMatchingProject => openMatchingProject, AppErrorCode.openTimelineFailed => openTimelineFailed, AppErrorCode.projectMismatch => projectMismatch, + AppErrorCode.projectAlreadyExists => projectAlreadyExists, AppErrorCode.openProjectFirst => openProjectFirst, AppErrorCode.localFilesOnly => localFilesOnly, AppErrorCode.foldersUnsupported => foldersUnsupported, diff --git a/lib/l10n/app_pt.arb b/lib/l10n/app_pt.arb index 96a2536..0bb8e72 100644 --- a/lib/l10n/app_pt.arb +++ b/lib/l10n/app_pt.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "Estilo da régua da linha do tempo", + "timelineRulerInline": "Marcas em linha", + "timelineRulerCentered": "Rótulos centralizados", + "timelineRulerOverlay": "Marcas sobrepostas", + "preview": "Pré-visualização", "projectsNone": "Nenhum projeto", "agentConversations": "Conversas", "renameConversationTitle": "Renomear conversa", @@ -6,6 +11,8 @@ "showMoreConversations": "Mostrar mais", "showFewerConversations": "Mostrar menos", "agentNewConversation": "Nova conversa", + "agentUntitledConversation": "Nova conversa", + "agentConversationActions": "Ações da conversa", "agentElapsedTime": "Duração {duration}", "agentConversationActions": "Ações da conversa", "agentMoveToTrash": "Mover para a lixeira", @@ -583,6 +590,7 @@ "revealMediaFailed": "Não foi possível mostrar a mídia no gerenciador de arquivos", "openMatchingProject": "Abra o projeto correspondente primeiro", "projectMismatch": "A biblioteca neste local não corresponde ao registro. Selecione-o novamente com Abrir biblioteca.", + "projectAlreadyExists": "Este nome de projeto já está em uso. Escolha outro nome ou use Abrir projeto para abrir o projeto existente.", "openProjectFirst": "Abra uma biblioteca primeiro", "localFilesOnly": "Arraste arquivos locais do gerenciador de arquivos", "foldersUnsupported": "Selecione os arquivos. Arrastar pastas ainda não é compatível.", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "O local de armazenamento está indisponível. Conecte o disco ou verifique a rede e tente novamente, ou altere o local.", "projectLocationNotWritable": "Não é possível gravar no local de armazenamento. Verifique as permissões ou altere o local.", "projectLocationCreateFailed": "Não foi possível criar a pasta do projeto ou gravar nela. Verifique as permissões ou altere o local.", + "removeProjectFromRecent": "Remover dos projetos recentes", "removeProjectFromSidebar": "Remover da barra lateral", "projectRemoved": "Projeto removido. Os arquivos locais e as conversas foram preservados.", "agentNoConversations": "Ainda não há conversas", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "Pacote de diagnóstico salvo.", "navigationChat": "Chat", "navigationLibrary": "Biblioteca", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "Paleta de cores", + "paletteGraphite": "Grafite · Azul", + "paletteViolet": "Cinza suave · Violeta", + "paletteTeal": "Cinza quente · Verde-azulado", + "agentMinimize": "Minimizar agente", + "agentDock": "Acoplar agente", + "agentExpandConversation": "Expandir conversa", + "agentCollapseConversation": "Recolher conversa", + "noMatchingMedia": "Nenhum arquivo correspondente", + "sortMedia": "Ordenar mídia", + "mediaSortImportOrder": "Ordem de importação", + "mediaSortNameAscending": "Nome: A a Z", + "mediaSortNameDescending": "Nome: Z a A", + "mediaSelectedCount": "{count} selecionados", + "navigationHome": "Início", + "mediaThumbnailSize": "Tamanho das miniaturas", + "mediaThumbnailSmall": "Miniaturas pequenas", + "mediaThumbnailMedium": "Miniaturas médias", + "mediaThumbnailLarge": "Miniaturas grandes", + "mediaSpecification": "Especificações", + "resourceMyMedia": "Minha mídia", + "resourceStickers": "Adesivos", + "resourceEffects": "Efeitos", + "resourceTransitions": "Transições", + "resourceMore": "Mais", + "resourceLibraryEmpty": "Não há recursos de {category} disponíveis", + "resourceImportedAudioHint": "O áudio importado está em Minha mídia.", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb index d037c2d..0c55c6c 100644 --- a/lib/l10n/app_ru.arb +++ b/lib/l10n/app_ru.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "Стиль линейки времени", + "timelineRulerInline": "Метки в одной строке", + "timelineRulerCentered": "Коды по центру", + "timelineRulerOverlay": "Наложение меток", + "preview": "Предпросмотр", "projectsNone": "Нет проектов", "agentConversations": "Диалоги", "renameConversationTitle": "Переименовать чат", @@ -6,6 +11,8 @@ "showMoreConversations": "Показать ещё", "showFewerConversations": "Показать меньше", "agentNewConversation": "Новый диалог", + "agentUntitledConversation": "Новый чат", + "agentConversationActions": "Действия с чатом", "agentElapsedTime": "Время {duration}", "agentConversationActions": "Действия с диалогом", "agentMoveToTrash": "Переместить в корзину", @@ -583,6 +590,7 @@ "revealMediaFailed": "Не удалось отобразить медиафайлы в файловом менеджере.", "openMatchingProject": "Сначала откройте соответствующий проект", "projectMismatch": "Библиотека по этому адресу не соответствует записи. Выберите его еще раз с помощью команды «Открыть библиотеку».", + "projectAlreadyExists": "Это имя проекта уже используется. Выберите другое имя или откройте существующий проект через «Открыть проект».", "openProjectFirst": "Сначала откройте библиотеку", "localFilesOnly": "Перетащите локальные файлы из файлового менеджера", "foldersUnsupported": "Выберите файлы. Перетаскивание папок пока не поддерживается.", @@ -738,6 +746,7 @@ "projectLocationUnavailable": "Место сохранения проекта недоступно. Подключите диск или проверьте сеть и повторите попытку либо выберите другое место.", "projectLocationNotWritable": "Запись в место сохранения проекта невозможна. Проверьте разрешения или выберите другое место.", "projectLocationCreateFailed": "Не удалось создать папку проекта или записать в неё данные. Проверьте разрешения или выберите другое место.", + "removeProjectFromRecent": "Убрать из недавних проектов", "removeProjectFromSidebar": "Убрать с боковой панели", "projectRemoved": "Проект убран. Локальные файлы и беседы сохранены.", "agentNoConversations": "Бесед пока нет", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "Пакет диагностики сохранён.", "navigationChat": "Чат", "navigationLibrary": "Библиотека", - "agentFullscreen": "Expand Agent" + "agentFullscreen": "Expand Agent", + "colorPalette": "Цветовая палитра", + "paletteGraphite": "Графит · Синий", + "paletteViolet": "Мягкий серый · Фиолетовый", + "paletteTeal": "Тёплый серый · Бирюзовый", + "agentMinimize": "Свернуть агента", + "agentDock": "Закрепить агента", + "agentExpandConversation": "Развернуть диалог", + "agentCollapseConversation": "Свернуть диалог", + "noMatchingMedia": "Нет подходящих материалов", + "sortMedia": "Сортировка материалов", + "mediaSortImportOrder": "Порядок импорта", + "mediaSortNameAscending": "Имя: А–Я", + "mediaSortNameDescending": "Имя: Я–А", + "mediaSelectedCount": "Выбрано: {count}", + "navigationHome": "Главная", + "mediaThumbnailSize": "Размер миниатюр", + "mediaThumbnailSmall": "Маленькие миниатюры", + "mediaThumbnailMedium": "Средние миниатюры", + "mediaThumbnailLarge": "Большие миниатюры", + "mediaSpecification": "Характеристики", + "resourceMyMedia": "Мои медиа", + "resourceStickers": "Стикеры", + "resourceEffects": "Эффекты", + "resourceTransitions": "Переходы", + "resourceMore": "Ещё", + "resourceLibraryEmpty": "Нет доступных ресурсов: {category}", + "resourceImportedAudioHint": "Импортированное аудио находится в разделе «Мои медиа».", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index cde5185..3824894 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "时间线刻度风格", + "timelineRulerInline": "同带交错", + "timelineRulerCentered": "居中锚定", + "timelineRulerOverlay": "淡刻度叠印", + "preview": "预览", "selectProject": "选择项目", "searchProjects": "搜索项目", "noMatchingProjects": "没有匹配的项目", @@ -7,6 +12,7 @@ "projectLocationUnavailable": "项目保存位置不可用,请连接磁盘或检查网络后重试,也可以更改位置。", "projectLocationNotWritable": "项目保存位置没有写入权限,请检查权限或更改位置。", "projectLocationCreateFailed": "无法创建或写入项目保存目录,请检查权限或更改位置。", + "removeProjectFromRecent": "从最近项目移除", "removeProjectFromSidebar": "从侧边栏移除", "projectRemoved": "已移除项目,本地文件和聊天记录已保留。", "agentNoConversations": "暂无聊天", @@ -20,6 +26,8 @@ "showMoreConversations": "展开显示", "showFewerConversations": "收起显示", "agentNewConversation": "新建对话", + "agentUntitledConversation": "新聊天", + "agentConversationActions": "聊天操作", "agentElapsedTime": "用时 {duration}", "agentConversationActions": "对话操作", "agentMoveToTrash": "移至回收区", @@ -611,6 +619,7 @@ "revealMediaFailed": "无法在文件管理器中显示素材", "openMatchingProject": "请先打开对应项目", "projectMismatch": "此位置的项目与记录不一致,请使用“打开项目”重新选择。", + "projectAlreadyExists": "该项目名称已被占用。请更换名称,或使用“打开项目”打开已有项目。", "openProjectFirst": "请先打开项目", "localFilesOnly": "请从文件管理器拖入本地文件", "foldersUnsupported": "请选择文件,暂不支持拖入文件夹", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "诊断包已保存。", "navigationChat": "聊天", "navigationLibrary": "资源库", - "agentFullscreen": "全屏 Agent" + "agentFullscreen": "全屏 Agent", + "agentMinimize": "缩小 Agent", + "agentDock": "还原 Agent", + "agentExpandConversation": "展开对话", + "agentCollapseConversation": "收起对话", + "colorPalette": "配色方案", + "paletteGraphite": "石墨灰 · 蓝色", + "paletteViolet": "柔灰 · 紫色", + "paletteTeal": "暖灰 · 青绿", + "noMatchingMedia": "没有匹配的素材", + "sortMedia": "素材排序", + "mediaSortImportOrder": "导入顺序", + "mediaSortNameAscending": "名称升序", + "mediaSortNameDescending": "名称降序", + "mediaSelectedCount": "已选 {count} 个", + "navigationHome": "首页", + "mediaThumbnailSize": "缩略图大小", + "mediaThumbnailSmall": "小缩略图", + "mediaThumbnailMedium": "中缩略图", + "mediaThumbnailLarge": "大缩略图", + "mediaSpecification": "规格", + "resourceMyMedia": "我的素材", + "resourceStickers": "贴纸", + "resourceEffects": "特效", + "resourceTransitions": "转场", + "resourceMore": "更多", + "resourceLibraryEmpty": "暂无{category}资源", + "resourceImportedAudioHint": "导入的音频可在“我的素材”中找到。", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_zh_Hans.arb b/lib/l10n/app_zh_Hans.arb index a099f33..f0b243b 100644 --- a/lib/l10n/app_zh_Hans.arb +++ b/lib/l10n/app_zh_Hans.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "时间线刻度风格", + "timelineRulerInline": "同带交错", + "timelineRulerCentered": "居中锚定", + "timelineRulerOverlay": "淡刻度叠印", + "preview": "预览", "selectProject": "选择项目", "searchProjects": "搜索项目", "noMatchingProjects": "没有匹配的项目", @@ -7,6 +12,7 @@ "projectLocationUnavailable": "项目保存位置不可用,请连接磁盘或检查网络后重试,也可以更改位置。", "projectLocationNotWritable": "项目保存位置没有写入权限,请检查权限或更改位置。", "projectLocationCreateFailed": "无法创建或写入项目保存目录,请检查权限或更改位置。", + "removeProjectFromRecent": "从最近项目移除", "removeProjectFromSidebar": "从侧边栏移除", "projectRemoved": "已移除项目,本地文件和聊天记录已保留。", "agentNoConversations": "暂无聊天", @@ -20,6 +26,8 @@ "showMoreConversations": "展开显示", "showFewerConversations": "收起显示", "agentNewConversation": "新建对话", + "agentUntitledConversation": "新聊天", + "agentConversationActions": "聊天操作", "agentElapsedTime": "用时 {duration}", "agentConversationActions": "对话操作", "agentMoveToTrash": "移至回收区", @@ -611,6 +619,7 @@ "revealMediaFailed": "无法在文件管理器中显示素材", "openMatchingProject": "请先打开对应项目", "projectMismatch": "此位置的项目与记录不一致,请使用“打开项目”重新选择。", + "projectAlreadyExists": "该项目名称已被占用。请更换名称,或使用“打开项目”打开已有项目。", "openProjectFirst": "请先打开项目", "localFilesOnly": "请从文件管理器拖入本地文件", "foldersUnsupported": "请选择文件,暂不支持拖入文件夹", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "诊断包已保存。", "navigationChat": "聊天", "navigationLibrary": "资源库", - "agentFullscreen": "全屏 Agent" + "agentFullscreen": "全屏 Agent", + "agentMinimize": "缩小 Agent", + "agentDock": "还原 Agent", + "agentExpandConversation": "展开对话", + "agentCollapseConversation": "收起对话", + "colorPalette": "配色方案", + "paletteGraphite": "石墨灰 · 蓝色", + "paletteViolet": "柔灰 · 紫色", + "paletteTeal": "暖灰 · 青绿", + "noMatchingMedia": "没有匹配的素材", + "sortMedia": "素材排序", + "mediaSortImportOrder": "导入顺序", + "mediaSortNameAscending": "名称升序", + "mediaSortNameDescending": "名称降序", + "mediaSelectedCount": "已选 {count} 个", + "navigationHome": "首页", + "mediaThumbnailSize": "缩略图大小", + "mediaThumbnailSmall": "小缩略图", + "mediaThumbnailMedium": "中缩略图", + "mediaThumbnailLarge": "大缩略图", + "mediaSpecification": "规格", + "resourceMyMedia": "我的素材", + "resourceStickers": "贴纸", + "resourceEffects": "特效", + "resourceTransitions": "转场", + "resourceMore": "更多", + "resourceLibraryEmpty": "暂无{category}资源", + "resourceImportedAudioHint": "导入的音频可在“我的素材”中找到。", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/l10n/app_zh_Hant.arb b/lib/l10n/app_zh_Hant.arb index 254826a..4adaa13 100644 --- a/lib/l10n/app_zh_Hant.arb +++ b/lib/l10n/app_zh_Hant.arb @@ -1,4 +1,9 @@ { + "timelineRulerStyle": "時間線刻度風格", + "timelineRulerInline": "同帶交錯", + "timelineRulerCentered": "居中錨定", + "timelineRulerOverlay": "淡刻度疊印", + "preview": "預覽", "selectProject": "選擇專案", "searchProjects": "搜尋專案", "noMatchingProjects": "沒有符合的專案", @@ -7,6 +12,7 @@ "projectLocationUnavailable": "專案儲存位置無法使用,請連接磁碟或檢查網路後重試,也可以變更位置。", "projectLocationNotWritable": "專案儲存位置沒有寫入權限,請檢查權限或變更位置。", "projectLocationCreateFailed": "無法建立或寫入專案儲存目錄,請檢查權限或變更位置。", + "removeProjectFromRecent": "從最近專案移除", "removeProjectFromSidebar": "從側邊欄移除", "projectRemoved": "已移除專案,本機檔案和聊天記錄已保留。", "agentNoConversations": "暫無聊天", @@ -20,6 +26,8 @@ "showMoreConversations": "展開顯示", "showFewerConversations": "收起顯示", "agentNewConversation": "新增對話", + "agentUntitledConversation": "新聊天", + "agentConversationActions": "聊天操作", "agentElapsedTime": "耗時 {duration}", "agentConversationActions": "對話操作", "agentMoveToTrash": "移至資源回收桶", @@ -611,6 +619,7 @@ "revealMediaFailed": "無法在檔案管理器中顯示素材", "openMatchingProject": "請先開啟對應專案", "projectMismatch": "此位置的專案與記錄不一致,請使用“開啟專案”重新選擇。", + "projectAlreadyExists": "此專案名稱已被使用。請更換名稱,或使用「開啟專案」開啟現有專案。", "openProjectFirst": "請先開啟專案", "localFilesOnly": "請從檔案管理器拖入本地檔案", "foldersUnsupported": "請選擇檔案,暫不支援拖入資料夾", @@ -888,5 +897,39 @@ "exportDiagnosticsSucceeded": "診斷套件已儲存。", "navigationChat": "聊天", "navigationLibrary": "資源庫", - "agentFullscreen": "全屏 Agent" + "agentFullscreen": "全屏 Agent", + "agentMinimize": "縮小 Agent", + "agentDock": "還原 Agent", + "agentExpandConversation": "展開對話", + "agentCollapseConversation": "收起對話", + "colorPalette": "配色方案", + "paletteGraphite": "石墨灰 · 藍色", + "paletteViolet": "柔灰 · 紫色", + "paletteTeal": "暖灰 · 青綠", + "noMatchingMedia": "沒有符合的素材", + "sortMedia": "素材排序", + "mediaSortImportOrder": "匯入順序", + "mediaSortNameAscending": "名稱升冪", + "mediaSortNameDescending": "名稱降冪", + "mediaSelectedCount": "已選 {count} 個", + "navigationHome": "首頁", + "mediaThumbnailSize": "縮圖大小", + "mediaThumbnailSmall": "小縮圖", + "mediaThumbnailMedium": "中縮圖", + "mediaThumbnailLarge": "大縮圖", + "mediaSpecification": "規格", + "resourceMyMedia": "我的素材", + "resourceStickers": "貼紙", + "resourceEffects": "特效", + "resourceTransitions": "轉場", + "resourceMore": "更多", + "resourceLibraryEmpty": "暫無{category}資源", + "resourceImportedAudioHint": "匯入的音訊可在「我的素材」中找到。", + "@resourceLibraryEmpty": { + "placeholders": { + "category": { + "type": "String" + } + } + } } diff --git a/lib/persistence/app_database.dart b/lib/persistence/app_database.dart index a4f79ec..b3ec7e8 100644 --- a/lib/persistence/app_database.dart +++ b/lib/persistence/app_database.dart @@ -39,6 +39,9 @@ class McpConfigurations extends Table { class AppearanceConfigurations extends Table { IntColumn get id => integer()(); TextColumn get themeMode => text()(); + TextColumn get palette => text().withDefault(const Constant('graphite'))(); + TextColumn get timelineRulerLayout => + text().withDefault(const Constant('inline'))(); @override Set> get primaryKey => {id}; @@ -166,13 +169,25 @@ class AppDatabase extends _$AppDatabase { AppDatabase(super.executor); @override - int get schemaVersion => 2; + int get schemaVersion => 4; @override MigrationStrategy get migration => MigrationStrategy( onCreate: (migrator) => migrator.createAll(), - onUpgrade: (_, from, _) async { - throw StateError('Unsupported app database schema version: $from'); + onUpgrade: (migrator, from, _) async { + if (from != 2 && from != 3) { + throw StateError('Unsupported app database schema version: $from'); + } + if (from == 2) { + await migrator.addColumn( + appearanceConfigurations, + appearanceConfigurations.palette, + ); + } + await migrator.addColumn( + appearanceConfigurations, + appearanceConfigurations.timelineRulerLayout, + ); }, beforeOpen: (_) async { await customStatement('PRAGMA journal_mode = WAL'); diff --git a/lib/persistence/app_database.g.dart b/lib/persistence/app_database.g.dart index 381059c..50aaadb 100644 --- a/lib/persistence/app_database.g.dart +++ b/lib/persistence/app_database.g.dart @@ -854,8 +854,37 @@ class $AppearanceConfigurationsTable extends AppearanceConfigurations type: DriftSqlType.string, requiredDuringInsert: true, ); + static const VerificationMeta _paletteMeta = const VerificationMeta( + 'palette', + ); @override - List get $columns => [id, themeMode]; + late final GeneratedColumn palette = GeneratedColumn( + 'palette', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: const Constant('graphite'), + ); + static const VerificationMeta _timelineRulerLayoutMeta = + const VerificationMeta('timelineRulerLayout'); + @override + late final GeneratedColumn timelineRulerLayout = + GeneratedColumn( + 'timeline_ruler_layout', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: false, + defaultValue: const Constant('inline'), + ); + @override + List get $columns => [ + id, + themeMode, + palette, + timelineRulerLayout, + ]; @override String get aliasedName => _alias ?? actualTableName; @override @@ -879,6 +908,21 @@ class $AppearanceConfigurationsTable extends AppearanceConfigurations } else if (isInserting) { context.missing(_themeModeMeta); } + if (data.containsKey('palette')) { + context.handle( + _paletteMeta, + palette.isAcceptableOrUnknown(data['palette']!, _paletteMeta), + ); + } + if (data.containsKey('timeline_ruler_layout')) { + context.handle( + _timelineRulerLayoutMeta, + timelineRulerLayout.isAcceptableOrUnknown( + data['timeline_ruler_layout']!, + _timelineRulerLayoutMeta, + ), + ); + } return context; } @@ -899,6 +943,14 @@ class $AppearanceConfigurationsTable extends AppearanceConfigurations DriftSqlType.string, data['${effectivePrefix}theme_mode'], )!, + palette: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}palette'], + )!, + timelineRulerLayout: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}timeline_ruler_layout'], + )!, ); } @@ -912,12 +964,21 @@ class AppearanceConfiguration extends DataClass implements Insertable { final int id; final String themeMode; - const AppearanceConfiguration({required this.id, required this.themeMode}); + final String palette; + final String timelineRulerLayout; + const AppearanceConfiguration({ + required this.id, + required this.themeMode, + required this.palette, + required this.timelineRulerLayout, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['theme_mode'] = Variable(themeMode); + map['palette'] = Variable(palette); + map['timeline_ruler_layout'] = Variable(timelineRulerLayout); return map; } @@ -925,6 +986,8 @@ class AppearanceConfiguration extends DataClass return AppearanceConfigurationsCompanion( id: Value(id), themeMode: Value(themeMode), + palette: Value(palette), + timelineRulerLayout: Value(timelineRulerLayout), ); } @@ -936,6 +999,10 @@ class AppearanceConfiguration extends DataClass return AppearanceConfiguration( id: serializer.fromJson(json['id']), themeMode: serializer.fromJson(json['themeMode']), + palette: serializer.fromJson(json['palette']), + timelineRulerLayout: serializer.fromJson( + json['timelineRulerLayout'], + ), ); } @override @@ -944,20 +1011,32 @@ class AppearanceConfiguration extends DataClass return { 'id': serializer.toJson(id), 'themeMode': serializer.toJson(themeMode), + 'palette': serializer.toJson(palette), + 'timelineRulerLayout': serializer.toJson(timelineRulerLayout), }; } - AppearanceConfiguration copyWith({int? id, String? themeMode}) => - AppearanceConfiguration( - id: id ?? this.id, - themeMode: themeMode ?? this.themeMode, - ); + AppearanceConfiguration copyWith({ + int? id, + String? themeMode, + String? palette, + String? timelineRulerLayout, + }) => AppearanceConfiguration( + id: id ?? this.id, + themeMode: themeMode ?? this.themeMode, + palette: palette ?? this.palette, + timelineRulerLayout: timelineRulerLayout ?? this.timelineRulerLayout, + ); AppearanceConfiguration copyWithCompanion( AppearanceConfigurationsCompanion data, ) { return AppearanceConfiguration( id: data.id.present ? data.id.value : this.id, themeMode: data.themeMode.present ? data.themeMode.value : this.themeMode, + palette: data.palette.present ? data.palette.value : this.palette, + timelineRulerLayout: data.timelineRulerLayout.present + ? data.timelineRulerLayout.value + : this.timelineRulerLayout, ); } @@ -965,50 +1044,69 @@ class AppearanceConfiguration extends DataClass String toString() { return (StringBuffer('AppearanceConfiguration(') ..write('id: $id, ') - ..write('themeMode: $themeMode') + ..write('themeMode: $themeMode, ') + ..write('palette: $palette, ') + ..write('timelineRulerLayout: $timelineRulerLayout') ..write(')')) .toString(); } @override - int get hashCode => Object.hash(id, themeMode); + int get hashCode => Object.hash(id, themeMode, palette, timelineRulerLayout); @override bool operator ==(Object other) => identical(this, other) || (other is AppearanceConfiguration && other.id == this.id && - other.themeMode == this.themeMode); + other.themeMode == this.themeMode && + other.palette == this.palette && + other.timelineRulerLayout == this.timelineRulerLayout); } class AppearanceConfigurationsCompanion extends UpdateCompanion { final Value id; final Value themeMode; + final Value palette; + final Value timelineRulerLayout; const AppearanceConfigurationsCompanion({ this.id = const Value.absent(), this.themeMode = const Value.absent(), + this.palette = const Value.absent(), + this.timelineRulerLayout = const Value.absent(), }); AppearanceConfigurationsCompanion.insert({ this.id = const Value.absent(), required String themeMode, + this.palette = const Value.absent(), + this.timelineRulerLayout = const Value.absent(), }) : themeMode = Value(themeMode); static Insertable custom({ Expression? id, Expression? themeMode, + Expression? palette, + Expression? timelineRulerLayout, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (themeMode != null) 'theme_mode': themeMode, + if (palette != null) 'palette': palette, + if (timelineRulerLayout != null) + 'timeline_ruler_layout': timelineRulerLayout, }); } AppearanceConfigurationsCompanion copyWith({ Value? id, Value? themeMode, + Value? palette, + Value? timelineRulerLayout, }) { return AppearanceConfigurationsCompanion( id: id ?? this.id, themeMode: themeMode ?? this.themeMode, + palette: palette ?? this.palette, + timelineRulerLayout: timelineRulerLayout ?? this.timelineRulerLayout, ); } @@ -1021,6 +1119,14 @@ class AppearanceConfigurationsCompanion if (themeMode.present) { map['theme_mode'] = Variable(themeMode.value); } + if (palette.present) { + map['palette'] = Variable(palette.value); + } + if (timelineRulerLayout.present) { + map['timeline_ruler_layout'] = Variable( + timelineRulerLayout.value, + ); + } return map; } @@ -1028,7 +1134,9 @@ class AppearanceConfigurationsCompanion String toString() { return (StringBuffer('AppearanceConfigurationsCompanion(') ..write('id: $id, ') - ..write('themeMode: $themeMode') + ..write('themeMode: $themeMode, ') + ..write('palette: $palette, ') + ..write('timelineRulerLayout: $timelineRulerLayout') ..write(')')) .toString(); } @@ -4913,11 +5021,15 @@ typedef $$AppearanceConfigurationsTableCreateCompanionBuilder = AppearanceConfigurationsCompanion Function({ Value id, required String themeMode, + Value palette, + Value timelineRulerLayout, }); typedef $$AppearanceConfigurationsTableUpdateCompanionBuilder = AppearanceConfigurationsCompanion Function({ Value id, Value themeMode, + Value palette, + Value timelineRulerLayout, }); class $$AppearanceConfigurationsTableFilterComposer @@ -4938,6 +5050,16 @@ class $$AppearanceConfigurationsTableFilterComposer column: $table.themeMode, builder: (column) => ColumnFilters(column), ); + + ColumnFilters get palette => $composableBuilder( + column: $table.palette, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get timelineRulerLayout => $composableBuilder( + column: $table.timelineRulerLayout, + builder: (column) => ColumnFilters(column), + ); } class $$AppearanceConfigurationsTableOrderingComposer @@ -4958,6 +5080,16 @@ class $$AppearanceConfigurationsTableOrderingComposer column: $table.themeMode, builder: (column) => ColumnOrderings(column), ); + + ColumnOrderings get palette => $composableBuilder( + column: $table.palette, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get timelineRulerLayout => $composableBuilder( + column: $table.timelineRulerLayout, + builder: (column) => ColumnOrderings(column), + ); } class $$AppearanceConfigurationsTableAnnotationComposer @@ -4974,6 +5106,14 @@ class $$AppearanceConfigurationsTableAnnotationComposer GeneratedColumn get themeMode => $composableBuilder(column: $table.themeMode, builder: (column) => column); + + GeneratedColumn get palette => + $composableBuilder(column: $table.palette, builder: (column) => column); + + GeneratedColumn get timelineRulerLayout => $composableBuilder( + column: $table.timelineRulerLayout, + builder: (column) => column, + ); } class $$AppearanceConfigurationsTableTableManager @@ -5020,17 +5160,29 @@ class $$AppearanceConfigurationsTableTableManager $db: db, $table: table, ), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value themeMode = const Value.absent(), - }) => AppearanceConfigurationsCompanion(id: id, themeMode: themeMode), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value themeMode = const Value.absent(), + Value palette = const Value.absent(), + Value timelineRulerLayout = const Value.absent(), + }) => AppearanceConfigurationsCompanion( + id: id, + themeMode: themeMode, + palette: palette, + timelineRulerLayout: timelineRulerLayout, + ), createCompanionCallback: ({ Value id = const Value.absent(), required String themeMode, + Value palette = const Value.absent(), + Value timelineRulerLayout = const Value.absent(), }) => AppearanceConfigurationsCompanion.insert( id: id, themeMode: themeMode, + palette: palette, + timelineRulerLayout: timelineRulerLayout, ), withReferenceMapper: (p0) => p0 .map( diff --git a/lib/persistence/app_settings_repositories.dart b/lib/persistence/app_settings_repositories.dart index 4fd30b8..6f88105 100644 --- a/lib/persistence/app_settings_repositories.dart +++ b/lib/persistence/app_settings_repositories.dart @@ -4,6 +4,7 @@ export '../settings/mcp_settings_value.dart'; export 'settings/agent_settings_repository.dart'; export 'settings/appearance_settings_repository.dart'; +export 'settings/timeline_ruler_settings_repository.dart'; export 'settings/language_settings_repository.dart'; export 'settings/location_settings_repositories.dart'; export 'settings/mcp_settings_repository.dart'; diff --git a/lib/persistence/settings/appearance_settings_repository.dart b/lib/persistence/settings/appearance_settings_repository.dart index 5b7f9c7..9e4d76d 100644 --- a/lib/persistence/settings/appearance_settings_repository.dart +++ b/lib/persistence/settings/appearance_settings_repository.dart @@ -12,6 +12,47 @@ abstract interface class AppearanceSettingsRepository { Future save(AppAppearance mode); } +abstract interface class PaletteSettingsRepository { + Future load(); + Future save(AppPalette palette); +} + +@Riverpod(keepAlive: true) +PaletteSettingsRepository paletteSettingsRepository(Ref ref) => + DriftPaletteSettingsRepository(ref.watch(appDatabaseProvider)); + +class DriftPaletteSettingsRepository implements PaletteSettingsRepository { + DriftPaletteSettingsRepository(this._database); + + final AppDatabase _database; + + @override + Future load() async { + final row = await (_database.select( + _database.appearanceConfigurations, + )..where((table) => table.id.equals(0))).getSingleOrNull(); + return AppPalette.values.firstWhere( + (palette) => palette.name == row?.palette, + orElse: () => AppPalette.graphite, + ); + } + + @override + Future save(AppPalette palette) => _database + .into(_database.appearanceConfigurations) + .insert( + AppearanceConfigurationsCompanion.insert( + id: const Value(0), + themeMode: AppAppearance.system.name, + palette: Value(palette.name), + ), + onConflict: DoUpdate( + (_) => + AppearanceConfigurationsCompanion(palette: Value(palette.name)), + ), + ); +} + @Riverpod(keepAlive: true) AppearanceSettingsRepository appearanceSettingsRepository(Ref ref) => DriftAppearanceSettingsRepository(ref.watch(appDatabaseProvider)); diff --git a/lib/persistence/settings/appearance_settings_repository.g.dart b/lib/persistence/settings/appearance_settings_repository.g.dart index b856cd5..3355854 100644 --- a/lib/persistence/settings/appearance_settings_repository.g.dart +++ b/lib/persistence/settings/appearance_settings_repository.g.dart @@ -9,6 +9,54 @@ part of 'appearance_settings_repository.dart'; // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint, type=warning +@ProviderFor(paletteSettingsRepository) +final paletteSettingsRepositoryProvider = PaletteSettingsRepositoryProvider._(); + +final class PaletteSettingsRepositoryProvider + extends + $FunctionalProvider< + PaletteSettingsRepository, + PaletteSettingsRepository, + PaletteSettingsRepository + > + with $Provider { + PaletteSettingsRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'paletteSettingsRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$paletteSettingsRepositoryHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + PaletteSettingsRepository create(Ref ref) { + return paletteSettingsRepository(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(PaletteSettingsRepository value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$paletteSettingsRepositoryHash() => + r'18bcf6637d1435a1bb724f4ddedb1489dfb286cd'; + @ProviderFor(appearanceSettingsRepository) final appearanceSettingsRepositoryProvider = AppearanceSettingsRepositoryProvider._(); diff --git a/lib/persistence/settings/timeline_ruler_settings_repository.dart b/lib/persistence/settings/timeline_ruler_settings_repository.dart new file mode 100644 index 0000000..54cb875 --- /dev/null +++ b/lib/persistence/settings/timeline_ruler_settings_repository.dart @@ -0,0 +1,50 @@ +import 'package:cutdex_sdk/timeline_ui.dart' show TimelineRulerTimecodeLayout; +import 'package:drift/drift.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +import '../app_database.dart'; + +part 'timeline_ruler_settings_repository.g.dart'; + +abstract interface class TimelineRulerSettingsRepository { + Future load(); + Future save(TimelineRulerTimecodeLayout layout); +} + +@Riverpod(keepAlive: true) +TimelineRulerSettingsRepository timelineRulerSettingsRepository(Ref ref) => + DriftTimelineRulerSettingsRepository(ref.watch(appDatabaseProvider)); + +class DriftTimelineRulerSettingsRepository + implements TimelineRulerSettingsRepository { + DriftTimelineRulerSettingsRepository(this._database); + + final AppDatabase _database; + + @override + Future load() async { + final row = await (_database.select( + _database.appearanceConfigurations, + )..where((table) => table.id.equals(0))).getSingleOrNull(); + return TimelineRulerTimecodeLayout.values.firstWhere( + (layout) => layout.name == row?.timelineRulerLayout, + orElse: () => TimelineRulerTimecodeLayout.inline, + ); + } + + @override + Future save(TimelineRulerTimecodeLayout layout) => _database + .into(_database.appearanceConfigurations) + .insert( + AppearanceConfigurationsCompanion.insert( + id: const Value(0), + themeMode: 'system', + timelineRulerLayout: Value(layout.name), + ), + onConflict: DoUpdate( + (_) => AppearanceConfigurationsCompanion( + timelineRulerLayout: Value(layout.name), + ), + ), + ); +} diff --git a/lib/persistence/settings/timeline_ruler_settings_repository.g.dart b/lib/persistence/settings/timeline_ruler_settings_repository.g.dart new file mode 100644 index 0000000..b65c8ba --- /dev/null +++ b/lib/persistence/settings/timeline_ruler_settings_repository.g.dart @@ -0,0 +1,61 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'timeline_ruler_settings_repository.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(timelineRulerSettingsRepository) +final timelineRulerSettingsRepositoryProvider = + TimelineRulerSettingsRepositoryProvider._(); + +final class TimelineRulerSettingsRepositoryProvider + extends + $FunctionalProvider< + TimelineRulerSettingsRepository, + TimelineRulerSettingsRepository, + TimelineRulerSettingsRepository + > + with $Provider { + TimelineRulerSettingsRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'timelineRulerSettingsRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$timelineRulerSettingsRepositoryHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + TimelineRulerSettingsRepository create(Ref ref) { + return timelineRulerSettingsRepository(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(TimelineRulerSettingsRepository value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider( + value, + ), + ); + } +} + +String _$timelineRulerSettingsRepositoryHash() => + r'227f35f52834150a6f7d33126388dd37114ce43f'; diff --git a/lib/settings/appearance.dart b/lib/settings/appearance.dart index 084a9ca..83cd82c 100644 --- a/lib/settings/appearance.dart +++ b/lib/settings/appearance.dart @@ -1 +1,3 @@ +export 'package:cutdex_ui/theme.dart' show AppPalette; + enum AppAppearance { system, penLight, penDark } diff --git a/lib/shared/layout/workspace_layout_metrics.dart b/lib/shared/layout/workspace_layout_metrics.dart index cd47c86..936905e 100644 --- a/lib/shared/layout/workspace_layout_metrics.dart +++ b/lib/shared/layout/workspace_layout_metrics.dart @@ -1,20 +1,22 @@ abstract final class WorkspaceLayoutMetrics { - static const desktopSpacing = 1.0; + static const desktopSpacing = 6.0; + static const desktopOuterSpacing = 6.0; static const desktopResizeSlop = 2.0; static const desktopResizeHitExtent = desktopSpacing + 2 * desktopResizeSlop; static const dualPaneMinimumWidth = 840.0; - static const sidebarDefaultWidth = 260.0; - static const sidebarMinimumWidth = 240.0; - static const sidebarWidthLimit = 360.0; + static const sidebarDefaultWidth = 240.0; + static const sidebarMinimumWidth = 220.0; + static const sidebarWidthLimit = 320.0; static const contentMinimumWidth = 320.0; - static const timelineDefaultHeightFraction = 0.4; - static const timelineMinimumHeight = 160.0; + static const timelineDefaultHeightFraction = 0.36; + static const timelineMinimumHeight = 220.0; + static const previewMinimumHeight = 180.0; static const mediaPanelWidth = 260.0; - static const propertiesPanelWidth = 320.0; - static const previewMinimumWidth = 160.0; + static const propertiesPanelWidth = 260.0; + static const previewMinimumWidth = 320.0; static double sidebarMaximumWidth(double availableWidth) => (availableWidth - contentMinimumWidth) diff --git a/lib/shared/state/operation_scope.dart b/lib/shared/state/operation_scope.dart new file mode 100644 index 0000000..b825e2d --- /dev/null +++ b/lib/shared/state/operation_scope.dart @@ -0,0 +1,37 @@ +/// Invalidates pending UI work when its owner changes context or starts anew. +class OperationScope { + OperationScope(this._context); + + T _context; + int _revision = 0; + bool _disposed = false; + + /// Updates the context, invalidating work from its previous binding. + /// + /// Returning to an earlier context does not reactivate its pending work. + void bind(T context) { + if (context == _context) return; + _context = context; + invalidate(); + } + + /// Captures the current binding without cancelling other work in it. + bool Function() capture() { + final revision = _revision; + return () => !_disposed && revision == _revision; + } + + /// Starts a new intent, superseding earlier intents in this scope. + bool Function() begin() { + invalidate(); + return capture(); + } + + void invalidate() => _revision++; + + /// Invalidates all captured work permanently. + void dispose() { + _disposed = true; + invalidate(); + } +} diff --git a/lib/shared/theme/composer_style.dart b/lib/shared/theme/composer_style.dart index c952ca0..77d6e06 100644 --- a/lib/shared/theme/composer_style.dart +++ b/lib/shared/theme/composer_style.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../layout/composer_layout.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:cutdex_ui/theme.dart'; @@ -42,7 +43,6 @@ abstract final class AppComposerStyle { horizontal: 8, vertical: 4, ); - static const menuSeparatorThickness = 1.0; static const menuEmptyPadding = EdgeInsets.all(12); static InputDecoration inputDecoration( @@ -92,7 +92,10 @@ abstract final class AppComposerStyle { }) { return InputDecoration( hintText: hintText, - prefixIcon: const Icon(Icons.search, size: ComposerLayout.menuIconSize), + prefixIcon: const Icon( + AppIcons.search, + size: ComposerLayout.menuIconSize, + ), prefixIconConstraints: const BoxConstraints( minWidth: ComposerLayout.controlSize, minHeight: ComposerLayout.controlSize, diff --git a/lib/shared/widgets/error_notification_host.dart b/lib/shared/widgets/error_notification_host.dart index bc1a8af..9e369c9 100644 --- a/lib/shared/widgets/error_notification_host.dart +++ b/lib/shared/widgets/error_notification_host.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:collection'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -8,9 +9,24 @@ import '../../errors/app_failure.dart'; import '../../l10n/l10n.dart'; class ErrorNotification { - const ErrorNotification({required this.content, this.details}); + const ErrorNotification({required this.content, this.details}) + : isError = true, + actionLabel = null, + onAction = null; + + const ErrorNotification.message({ + required this.content, + this.actionLabel, + this.onAction, + }) : assert((actionLabel == null) == (onAction == null)), + details = null, + isError = false; + final Widget content; final String? details; + final bool isError; + final String? actionLabel; + final VoidCallback? onAction; String get copyText { String textOf(Widget widget) { @@ -33,7 +49,7 @@ class ErrorNotification { } } -/// One error queue above navigation and dialogs, independent of local scaffolds. +/// One notification queue above navigation and dialogs, independent of scaffolds. class ErrorNotificationHost extends StatefulWidget { const ErrorNotificationHost({super.key, required this.child}); final Widget child; @@ -61,6 +77,18 @@ class ErrorNotificationHostState extends State { if (_current == null) _next(); } + void showMessage({ + required Widget content, + String? actionLabel, + VoidCallback? onAction, + }) => show( + ErrorNotification.message( + content: content, + actionLabel: actionLabel, + onAction: onAction, + ), + ); + void showFailure(AppFailure failure, String message) => show( ErrorNotification( content: Text(message), @@ -75,7 +103,7 @@ class ErrorNotificationHostState extends State { void _startTimer() { _timer?.cancel(); if (_current != null && !_hovered) { - _timer = Timer(const Duration(seconds: 8), dismiss); + _timer = Timer(Duration(seconds: _current!.isError ? 8 : 4), dismiss); } } @@ -83,6 +111,7 @@ class ErrorNotificationHostState extends State { setState(() { _current = _pending.isEmpty ? null : _pending.removeFirst(); _copied = false; + _hovered = false; }); _startTimer(); } @@ -146,7 +175,11 @@ class ErrorNotificationHostState extends State { _startTimer(); }, child: Material( - key: const Key('global-error-notification'), + key: Key( + current.isError + ? 'global-error-notification' + : 'global-message-notification', + ), elevation: 8, color: Theme.of(context).colorScheme.surfaceContainerHigh, borderRadius: BorderRadius.circular(12), @@ -160,8 +193,10 @@ class ErrorNotificationHostState extends State { child: Row( children: [ Icon( - Icons.error_outline, - color: Theme.of(context).colorScheme.error, + current.isError ? AppIcons.error : AppIcons.success, + color: current.isError + ? Theme.of(context).colorScheme.error + : Theme.of(context).colorScheme.primary, size: 20, ), const SizedBox(width: 8), @@ -173,22 +208,35 @@ class ErrorNotificationHostState extends State { ), ), ), - IconButton( - key: const Key('copy-error-button'), - tooltip: MaterialLocalizations.of(context) - .copyButtonLabel, - onPressed: _copy, - icon: Icon( - _copied ? Icons.check : Icons.copy, - size: 18, + if (current.actionLabel case final label?) + TextButton( + onPressed: () { + dismiss(); + current.onAction!(); + }, + child: Text(label), + ), + if (current.isError) + IconButton( + key: const Key('copy-error-button'), + tooltip: MaterialLocalizations.of(context) + .copyButtonLabel, + onPressed: _copy, + icon: Icon( + _copied ? AppIcons.check : AppIcons.copy, + size: 18, + ), ), - ), IconButton( - key: const Key('close-error-button'), + key: Key( + current.isError + ? 'close-error-button' + : 'close-message-button', + ), tooltip: MaterialLocalizations.of(context) .closeButtonTooltip, onPressed: dismiss, - icon: const Icon(Icons.close, size: 18), + icon: const Icon(AppIcons.close, size: 18), ), ], ), diff --git a/lib/shared/widgets/listenable_selector.dart b/lib/shared/widgets/listenable_selector.dart index 1d20916..e24ec52 100644 --- a/lib/shared/widgets/listenable_selector.dart +++ b/lib/shared/widgets/listenable_selector.dart @@ -7,8 +7,11 @@ class ListenableSelector extends StatefulWidget { required this.listenable, required this.select, required this.builder, + this.pauseWhenHidden = true, }); + /// Hidden presentation pauses observation, while its owner continues work. + final bool pauseWhenHidden; final Listenable? listenable; final T Function() select; final Widget Function(BuildContext context, T value) builder; @@ -19,36 +22,82 @@ class ListenableSelector extends StatefulWidget { class _ListenableSelectorState extends State> { late T _value; + bool _listening = false; + bool _visible = true; + bool _active = true; @override void initState() { super.initState(); _value = widget.select(); - widget.listenable?.addListener(_changed); + _syncListener(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + _visible = !widget.pauseWhenHidden || TickerMode.valuesOf(context).enabled; + if (!_active) return; + _syncListener(); + _value = widget.select(); + } + + void _syncListener() { + final observe = _active && _visible && widget.listenable != null; + if (observe == _listening) return; + _listening = observe; + if (observe) { + widget.listenable!.addListener(_changed); + } else { + widget.listenable?.removeListener(_changed); + } } @override void didUpdateWidget(covariant ListenableSelector oldWidget) { super.didUpdateWidget(oldWidget); if (oldWidget.listenable != widget.listenable) { - oldWidget.listenable?.removeListener(_changed); - widget.listenable?.addListener(_changed); + if (_listening) oldWidget.listenable?.removeListener(_changed); + _listening = false; } + _visible = !widget.pauseWhenHidden || TickerMode.valuesOf(context).enabled; + if (!_active) return; + _syncListener(); _value = widget.select(); } void _changed() { + if (!_active || !_listening) return; final value = widget.select(); if (value == _value) return; setState(() => _value = value); } @override - Widget build(BuildContext context) => widget.builder(context, _value); + Widget build(BuildContext context) { + if (!_active) { + // GlobalKey activation precedes installation of the new widget. Resume + // here, once select is bound to the current owner rather than the old one. + _active = true; + _value = widget.select(); + _syncListener(); + } + return widget.builder(context, _value); + } + + @override + void deactivate() { + // Replacement widgets can notify before the old subtree is disposed. + // Its selector may read an owner's context/ref, which is already inactive. + _active = false; + _syncListener(); + super.deactivate(); + } @override void dispose() { - widget.listenable?.removeListener(_changed); + _active = false; + _syncListener(); super.dispose(); } } diff --git a/lib/shared/widgets/presentation_list.dart b/lib/shared/widgets/presentation_list.dart new file mode 100644 index 0000000..d04f80e --- /dev/null +++ b/lib/shared/widgets/presentation_list.dart @@ -0,0 +1,18 @@ +import 'package:flutter/foundation.dart'; + +/// Immutable list value for selecting membership/order separately from updates. +@immutable +class PresentationList extends Iterable { + PresentationList(Iterable values) : _values = List.unmodifiable(values); + final List _values; + + @override + Iterator get iterator => _values.iterator; + + @override + bool operator ==(Object other) => + other is PresentationList && listEquals(_values, other._values); + + @override + int get hashCode => Object.hashAll(_values); +} diff --git a/lib/shared/widgets/workspace_card.dart b/lib/shared/widgets/workspace_card.dart index f8de14c..4e6c621 100644 --- a/lib/shared/widgets/workspace_card.dart +++ b/lib/shared/widgets/workspace_card.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class WorkspaceCard extends StatefulWidget { const WorkspaceCard({super.key, required this.child}); - static const radius = 12.0; + static const radius = 8.0; static const borderWidth = 1.0; final Widget child; diff --git a/lib/shared/widgets/workspace_resize_handle.dart b/lib/shared/widgets/workspace_resize_handle.dart index 6d72c33..e531d86 100644 --- a/lib/shared/widgets/workspace_resize_handle.dart +++ b/lib/shared/widgets/workspace_resize_handle.dart @@ -9,12 +9,14 @@ class WorkspaceResizeHandle extends StatefulWidget { required this.initialValue, required this.onResize, this.direction = 1, + this.onStart, this.onEnd, }); final Axis axis; final double initialValue; final double direction; + final VoidCallback? onStart; final ValueChanged onResize; final VoidCallback? onEnd; @@ -37,6 +39,7 @@ class _WorkspaceResizeHandleState extends State { void _start(DragStartDetails details) { _startPosition = _coordinate(details.globalPosition); _startValue = widget.initialValue; + widget.onStart?.call(); _releaseCursor(); final cursor = _cursor; _cursorOverlay = OverlayEntry( diff --git a/lib/workspace/persistence/project_workspace.dart b/lib/workspace/persistence/project_workspace.dart index e54d433..7e474ac 100644 --- a/lib/workspace/persistence/project_workspace.dart +++ b/lib/workspace/persistence/project_workspace.dart @@ -130,6 +130,11 @@ class ProjectWorkspace { _project = null; } + Future deactivateProject() => _run(() async { + await _retireProject(); + await _trimWarmProjects(); + }); + Future _trimWarmProjects() async { while (_warmProjects.length > 2) { final file = _warmProjects.removeAt(0); @@ -261,7 +266,7 @@ class ProjectWorkspace { retained ?? (name == null ? await ProjectFile.open(directory) - : await ProjectFile.create( + : await _createProjectFile( directory, name: name, initialTimeline: _newTimelineDocument( @@ -307,6 +312,26 @@ class ProjectWorkspace { } }); + Future _createProjectFile( + Directory directory, { + required String name, + required TimelineDocument initialTimeline, + }) async { + try { + return await ProjectFile.create( + directory, + name: name, + initialTimeline: initialTimeline, + ); + } on ProjectFileException catch (error) { + if (error.code != ProjectFileError.conflict) rethrow; + throw AppException( + AppErrorCode.projectAlreadyExists, + diagnostic: error.toString(), + ); + } + } + /// Reads timelines from any project without installing it as the active one. /// /// This intentionally shares the workspace queue with [open] and all active diff --git a/lib/workspace/preview_controller_registry.dart b/lib/workspace/preview_controller_registry.dart index 844d9d2..3fe38ea 100644 --- a/lib/workspace/preview_controller_registry.dart +++ b/lib/workspace/preview_controller_registry.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:cutdex_sdk/preview.dart'; +import 'package:flutter/foundation.dart'; import 'package:cutdex_sdk/runtime.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -24,14 +25,57 @@ PreviewControllerRegistry previewControllerRegistry(Ref ref) { /// Owns native preview controllers independently of the currently visible /// timeline. Prepared controllers make timeline selection a synchronous swap. final class PreviewControllerRegistry { - PreviewControllerRegistry(this._runtime, {this._onChanged}); + PreviewControllerRegistry( + this._runtime, { + this._onChanged, + this.maximumCachedControllers = 4, + }) : assert(maximumCachedControllers > 0); + final int maximumCachedControllers; final CutdexRuntime _runtime; final void Function()? _onChanged; final _controllers = <(String, String), PreviewController>{}; final _preparing = <(String, String), Future>{}; + final _leases = <(String, String), int>{}; bool _disposed = false; + /// Mounted providers retain their controller; idle entries are evictable. + VoidCallback retain((String, String) ids) { + if (_disposed) throw StateError('Preview registry is closed'); + _leases[ids] = (_leases[ids] ?? 0) + 1; + var released = false; + return () { + if (released || _disposed) return; + released = true; + final count = (_leases[ids] ?? 1) - 1; + if (count == 0) { + _leases.remove(ids); + final controller = _controllers[ids]; + if (controller != null) { + unawaited( + controller.pauseForCanvasInteraction().catchError((Object _) {}), + ); + } + } else { + _leases[ids] = count; + } + _trimCache(); + }; + } + + void _trimCache() { + if (_disposed) return; + while (_controllers.length > maximumCachedControllers) { + final oldest = _controllers.keys + .where( + (ids) => !_preparing.containsKey(ids) && (_leases[ids] ?? 0) == 0, + ) + .firstOrNull; + if (oldest == null) return; + unawaited(invalidate(oldest).catchError((Object _) {})); + } + } + PreviewController? cached((String, String) ids) => _controllers[ids]; FutureOr prepare( @@ -46,7 +90,12 @@ final class PreviewControllerRegistry { final pending = _preparing[ids]; if (pending != null) return pending; final cached = _controllers[ids]; - if (cached != null) return cached; + if (cached != null) { + // Map insertion order is the access order for bounded idle entries. + _controllers.remove(ids); + _controllers[ids] = cached; + return cached; + } final future = _initialize(ids, timeline); _preparing[ids] = future; return future; @@ -82,6 +131,7 @@ final class PreviewControllerRegistry { rethrow; } finally { _preparing.remove(ids); + _trimCache(); } } @@ -114,6 +164,7 @@ final class PreviewControllerRegistry { final controllers = _controllers.values.toList(); _controllers.clear(); _preparing.clear(); + _leases.clear(); for (final controller in controllers) { unawaited(controller.close().catchError((Object _) {})); } diff --git a/lib/workspace/projects.dart b/lib/workspace/projects.dart index 4739948..ef7d816 100644 --- a/lib/workspace/projects.dart +++ b/lib/workspace/projects.dart @@ -23,6 +23,7 @@ import 'media_import.dart'; import 'timeline_session.dart'; import 'background_task_registry.dart'; import 'timeline_view_state.dart'; +import 'view_settings.dart'; import 'preview_controller_registry.dart'; import 'package:cutdex_sdk/editor.dart'; @@ -200,6 +201,19 @@ class Projects extends _$Projects { } } + Future closeActiveProject() => _perform(() async { + await _workspace.deactivateProject(); + if (!ref.mounted) return; + state = AsyncData( + state.requireValue.copyWith( + activeProject: null, + timeline: null, + timelines: const [], + assets: const [], + ), + ); + }); + Future open( String path, { String? name, @@ -278,6 +292,8 @@ class Projects extends _$Projects { if (selectedDocument != null) { await _prepareTimeline(active.id, selectedDocument); } + // Publish content and its saved layout together to avoid a default-layout frame. + await ref.read(projectViewSettingsProvider(active.id).future); checkCurrent(); await ref .read(previewControllerRegistryProvider) @@ -327,6 +343,27 @@ class Projects extends _$Projects { } }); + /// Checks destination occupancy without creating or changing any files. + /// Creation still checks again to protect against concurrent changes. + Future validateNewProjectName(String name) async { + try { + final root = await ref + .read(projectLocationSettingsRepositoryProvider) + .load(); + if (root == null || root.trim().isEmpty) return null; + final destination = p.join(root, '${name.trim()}.cutdex'); + if (await FileSystemEntity.type(destination, followLinks: false) != + FileSystemEntityType.notFound) { + return const AppFailure(AppErrorCode.projectAlreadyExists); + } + } on ProjectLocationUnavailableException { + // The creation flow presents location failures with a settings action. + } on FileSystemException { + // Let creation report the access failure through its normal error path. + } + return null; + } + Future createProject( String name, { required String initialTimelineName, diff --git a/lib/workspace/projects.g.dart b/lib/workspace/projects.g.dart index 71459f6..330c797 100644 --- a/lib/workspace/projects.g.dart +++ b/lib/workspace/projects.g.dart @@ -33,7 +33,7 @@ final class ProjectsProvider Projects create() => Projects(); } -String _$projectsHash() => r'ecadd6625f90f179184942fe492eac7edb6e21c6'; +String _$projectsHash() => r'daffbd0c3f4c8058f0fd53378611a2031770796f'; abstract class _$Projects extends $AsyncNotifier { FutureOr build(); diff --git a/lib/workspace/workspace_session_scope.dart b/lib/workspace/workspace_session_scope.dart index b85cea2..f0636ad 100644 --- a/lib/workspace/workspace_session_scope.dart +++ b/lib/workspace/workspace_session_scope.dart @@ -22,10 +22,10 @@ class WorkspaceSessionScope extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final projectId = state.activeProject?.id; final timelineId = state.timeline?.id; - if (projectId != null && - timelineId != null && - state.openingTimelineId == null) { - ref.watch(editorTimelineProvider(projectId, timelineId)); + if (projectId != null && timelineId != null) { + ref.watch( + editorTimelineProvider(projectId, timelineId).select((_) => null), + ); } final selection = ref.watch(conversationSelectionProvider(projectId)); if (projectId != null) { @@ -34,7 +34,7 @@ class WorkspaceSessionScope extends ConsumerWidget { projectId, conversationId: selection.selectedId, draftKey: selection.selectedId == null ? selection.draftKey : null, - ), + ).select((_) => null), ); } return child; diff --git a/packages/cutdex_native/README.md b/packages/cutdex_native/README.md index 8e571f1..b3df287 100644 --- a/packages/cutdex_native/README.md +++ b/packages/cutdex_native/README.md @@ -6,6 +6,7 @@ Cutdex workspace 内部 Flutter 原生插件,暂不发布。 | --- | --- | --- | | 窗口标题栏、拖动区域与关闭请求拦截 | 支持 | 支持 | | 本地文件拖放区域 | 支持 | 支持 | +| 附着主窗口的异步文件选择弹窗 | 支持 | 由应用使用 Filegate | | 原生上下文菜单 | 支持 | 由 UI 包回退为 Flutter 菜单 | | 原生窗口全屏会话 | 支持 | 未提供 | @@ -23,6 +24,8 @@ macOS 宿主窗口继承 `CutdexNativeWindow`,导入 `cutdex_native` 后按 Fl ## 文件拖放 +`NativeFilePicker.pickFiles` 在 macOS 使用主窗口的异步 `NSOpenPanel` sheet,支持多选和扩展名过滤,返回本地路径;取消返回空列表。窗口不存在或已有弹窗时返回平台异常。原生选择器不进入 `runModal` 的同步嵌套事件循环,导入与聊天附件共用此入口。 + `NativeFileDropRegion` 接收稳定的 `regionId`、`NativeDropConfiguration`、启用状态与回调,回调中的文件是原始路径列表。扩展名白名单与数量上限由调用方提供。 两端均拒绝目录和不存在的文件,并在落下时重新检查文件引用。 @@ -51,6 +54,7 @@ macOS 标题栏手势使用真实 AppKit 响应链,文件引用策略使用临 python3 tool/build.py macos --mode debug --flavor development bash packages/cutdex_native/tool/macos/test_header_control_gestures.sh bash packages/cutdex_native/tool/macos/test_file_drop_policy.sh +bash packages/cutdex_native/tool/macos/test_file_picker.sh ``` Windows 标题栏回归验证真实 HWND、命中区域、最大化、DPI 与标题栏恢复;先准备 Flutter C++ wrapper: diff --git a/packages/cutdex_native/lib/cutdex_native.dart b/packages/cutdex_native/lib/cutdex_native.dart index f0d0198..873a9f1 100644 --- a/packages/cutdex_native/lib/cutdex_native.dart +++ b/packages/cutdex_native/lib/cutdex_native.dart @@ -4,6 +4,7 @@ export 'src/window_chrome_session.dart'; export 'src/window_header_layout.dart'; export 'src/fullscreen.dart'; export 'src/file_drop.dart'; +export 'src/file_picker.dart'; export 'src/file_drop_region.dart'; export 'src/context_menu.dart'; export 'src/device_info.dart'; diff --git a/packages/cutdex_native/lib/src/file_picker.dart b/packages/cutdex_native/lib/src/file_picker.dart new file mode 100644 index 0000000..b94984b --- /dev/null +++ b/packages/cutdex_native/lib/src/file_picker.dart @@ -0,0 +1,16 @@ +import 'package:flutter/services.dart'; + +/// Selects local files in a sheet attached to the macOS host window. +abstract final class NativeFilePicker { + static const _channel = MethodChannel('cutdex_native/file_picker'); + + /// Returns an empty list when the user cancels the selection. + static Future> pickFiles({ + required List allowedExtensions, + }) async { + final paths = await _channel.invokeListMethod('pickFiles', { + 'allowedExtensions': allowedExtensions, + }); + return paths ?? const []; + } +} diff --git a/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativePlugin.swift b/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativePlugin.swift index 67d91d4..7e74623 100644 --- a/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativePlugin.swift +++ b/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativePlugin.swift @@ -5,12 +5,14 @@ public final class CutdexNativePlugin: NSObject, FlutterPlugin { private let view: NSView private let messenger: FlutterBinaryMessenger private let menu: NativeContextMenuBridge + private let filePicker: NativeFilePickerBridge private var drops: [String: NativeFileDropView] = [:] private init(view: NSView, messenger: FlutterBinaryMessenger) { self.view = view self.messenger = messenger menu = NativeContextMenuBridge(view: view, messenger: messenger) + filePicker = NativeFilePickerBridge(view: view) super.init() (view.window as? CutdexNativeWindow)?.configureNative(messenger: messenger) } @@ -23,9 +25,15 @@ public final class CutdexNativePlugin: NSObject, FlutterPlugin { registrar.addMethodCallDelegate(instance, channel: channel) registrar.addMethodCallDelegate(instance, channel: FlutterMethodChannel( name: "cutdex_native/device_info", binaryMessenger: registrar.messenger)) + registrar.addMethodCallDelegate(instance, channel: FlutterMethodChannel( + name: "cutdex_native/file_picker", binaryMessenger: registrar.messenger)) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + if call.method == "pickFiles" { + filePicker.pickFiles(arguments: call.arguments, result: result) + return + } if call.method == "getApplicationInfo" { result(["appVersion": Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "unknown", "appBuild": Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "unknown"]) diff --git a/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativeWindow.swift b/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativeWindow.swift index 0151caa..eadd435 100644 --- a/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativeWindow.swift +++ b/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/CutdexNativeWindow.swift @@ -304,7 +304,8 @@ open class CutdexNativeWindow: NSWindow { target.mouseDown(with: event) return } - if top >= 0, top < headerHeight, point.x >= 88 { + // Matches the Flutter reservation for the native button group (x=0...68). + if top >= 0, top < headerHeight, point.x >= 68 { if event.clickCount == 2 { switch UserDefaults.standard.string(forKey: "AppleActionOnDoubleClick") { case "Minimize": miniaturize(nil) diff --git a/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/NativeFilePickerBridge.swift b/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/NativeFilePickerBridge.swift new file mode 100644 index 0000000..28fec17 --- /dev/null +++ b/packages/cutdex_native/macos/cutdex_native/Sources/cutdex_native/NativeFilePickerBridge.swift @@ -0,0 +1,55 @@ +import Cocoa +import FlutterMacOS +import UniformTypeIdentifiers + +final class NativeFilePickerBridge { + private weak var view: NSView? + private var activePanel: NSOpenPanel? + private let makePanel: () -> NSOpenPanel + + init(view: NSView, makePanel: @escaping () -> NSOpenPanel = { NSOpenPanel() }) { + self.view = view + self.makePanel = makePanel + } + + func pickFiles(arguments: Any?, result: @escaping FlutterResult) { + DispatchQueue.main.async { [self] in + guard activePanel == nil else { + return result(FlutterError(code: "picker_active", + message: "A file selection is already open.", details: nil)) + } + guard let window = view?.window else { + return result(FlutterError(code: "window_unavailable", + message: "The file picker requires a host window.", details: nil)) + } + guard window.attachedSheet == nil else { + return result(FlutterError(code: "picker_active", + message: "The host window already has an open sheet.", details: nil)) + } + guard let args = arguments as? [String: Any], + let extensions = args["allowedExtensions"] as? [String] else { + return result(FlutterError(code: "invalid_args", + message: "File extensions are required.", details: nil)) + } + let panel = makePanel() + panel.canChooseFiles = true + panel.canChooseDirectories = false + panel.allowsMultipleSelection = true + panel.canCreateDirectories = false + let types = extensions.compactMap { UTType(filenameExtension: $0) } + if !types.isEmpty { + panel.allowedContentTypes = types + panel.allowsOtherFileTypes = false + } + activePanel = panel + // An owned, asynchronous sheet stays with the editor, including fullscreen, + // without entering runModal's nested application event loop. + panel.beginSheetModal(for: window) { [self, panel] response in + DispatchQueue.main.async { [self, panel] in + activePanel = nil + result(response == .OK ? panel.urls.map { $0.path } : nil) + } + } + } + } +} diff --git a/packages/cutdex_native/tool/macos/file_picker_test.swift b/packages/cutdex_native/tool/macos/file_picker_test.swift new file mode 100644 index 0000000..101d13c --- /dev/null +++ b/packages/cutdex_native/tool/macos/file_picker_test.swift @@ -0,0 +1,75 @@ +import Cocoa +import FlutterMacOS + +final class TestOpenPanel: NSOpenPanel { + var owner: NSWindow? + var reply: ((NSApplication.ModalResponse) -> Void)? + override var urls: [URL] { [URL(fileURLWithPath: "/tmp/a b.mp4")] } + override func beginSheetModal(for window: NSWindow, + completionHandler handler: @escaping (NSApplication.ModalResponse) -> Void) { + owner = window + reply = handler + } + override func runModal() -> NSApplication.ModalResponse { + fatalError("The picker must not block the application event loop") + } +} + +@main +struct FilePickerTest { + static func main() { + _ = NSApplication.shared + let window = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 640, height: 480), + styleMask: [.titled], backing: .buffered, defer: false) + let view = NSView() + window.contentView = view + let panel = TestOpenPanel() + let picker = NativeFilePickerBridge(view: view, makePanel: { panel }) + let args = ["allowedExtensions": ["mp4", "wav"]] + + func waitUntil(_ condition: () -> Bool) { + let deadline = Date().addingTimeInterval(2) + while !condition(), Date() < deadline { + RunLoop.current.run(until: Date().addingTimeInterval(0.01)) + } + precondition(condition(), "The asynchronous picker did not respond") + } + + var replies = 0 + var selected: [String]? + picker.pickFiles(arguments: args) { result in + replies += 1 + selected = result as? [String] + } + waitUntil { panel.reply != nil } + precondition(panel.owner === window && replies == 0) + precondition(panel.canChooseFiles && !panel.canChooseDirectories) + precondition(panel.allowsMultipleSelection && !panel.allowedContentTypes.isEmpty) + var duplicateError: FlutterError? + picker.pickFiles(arguments: args) { duplicateError = $0 as? FlutterError } + waitUntil { duplicateError != nil } + precondition(duplicateError?.code == "picker_active" && replies == 0) + // Completion may arrive from AppKit off the main queue. + let reply = panel.reply! + DispatchQueue.global().async { reply(.OK) } + waitUntil { replies == 1 } + precondition(selected == ["/tmp/a b.mp4"]) + + panel.reply = nil + picker.pickFiles(arguments: args) { result in + precondition(Thread.isMainThread && result == nil) + replies += 1 + } + waitUntil { panel.reply != nil } + panel.reply?(.cancel) + waitUntil { replies == 2 } + + let detached = NSView() + let orphanPicker = NativeFilePickerBridge(view: detached) + var missingWindowError: FlutterError? + orphanPicker.pickFiles(arguments: args) { missingWindowError = $0 as? FlutterError } + waitUntil { missingWindowError != nil } + precondition(missingWindowError?.code == "window_unavailable") + print("Native file picker ownership, asynchronous completion, cancellation and busy guards passed") + } +} diff --git a/packages/cutdex_native/tool/macos/test_file_picker.sh b/packages/cutdex_native/tool/macos/test_file_picker.sh new file mode 100644 index 0000000..57c3406 --- /dev/null +++ b/packages/cutdex_native/tool/macos/test_file_picker.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +task_root=$(cd "$(dirname "$0")/../.." && pwd) +task_workspace_root=$(cd "$task_root/../.." && pwd) +task_framework_dir=${1:-"$task_workspace_root/build/macos/Build/Products/Debug-development"} +task_test_dir=$(mktemp -d) +trap 'rm -rf "$task_test_dir"' EXIT HUP INT TERM + +xcrun swiftc -F "$task_framework_dir" -framework FlutterMacOS -framework Cocoa \ + -Xlinker -rpath -Xlinker "$task_framework_dir" \ + "$task_root/macos/cutdex_native/Sources/cutdex_native/NativeFilePickerBridge.swift" \ + "$task_root/tool/macos/file_picker_test.swift" \ + -o "$task_test_dir/file-picker" +"$task_test_dir/file-picker" diff --git a/packages/cutdex_ui/README.md b/packages/cutdex_ui/README.md index a262656..41a26e4 100644 --- a/packages/cutdex_ui/README.md +++ b/packages/cutdex_ui/README.md @@ -4,7 +4,8 @@ Cutdex workspace 内部 Flutter 包,维护通用组件与基础视觉主题, - `theme.dart`:主题、语义颜色、间距与控件尺寸。 - `widgets.dart`:菜单、选择框、对话框、输入控件、标签页、面板、下载进度、滚动渐隐等。 -- `cutdex_ui.dart`:上述两个入口。 +- `icons.dart`:`AppIcons` 及 Phosphor Regular、Fill 静态图标目录。 +- `cutdex_ui.dart`:上述三个入口。 组件通过参数接收文本、数据与回调;应用本地化与项目状态由调用方提供。选择框的空列表文案使用 `emptyLabel`,可搜索选择框同时传入 `searchHint`。对话框默认关闭提示由 Flutter 的 Material 本地化提供,也可传入 `closeLabel`。 @@ -12,6 +13,8 @@ Cutdex workspace 内部 Flutter 包,维护通用组件与基础视觉主题, 原生菜单通过 `cutdex_native` 展示,无法展示时回退到 Flutter 菜单。时间线与编辑器的业务样式由应用维护。 +桌面入口通过 `AppTheme.desktopWorkspaceTheme` 应用 `DesktopControlDensity`,使用 `AppDesktopMetrics` 中的按钮、输入框、面板标题与播放栏尺寸。移动端不继承这套密度。`AppCommandToolbar` 接收分组命令及固定的右侧命令,空间不足时将次要操作收入更多菜单;预览位于 `app_command_toolbar_previews.dart`。 + 在应用根目录执行 `fvm dart tool/flutter_local.dart pub get`;在本包目录执行: ```sh @@ -20,3 +23,41 @@ python3 ../../tool/project_tools.py flutter test ``` 生成的 Freezed 文件随源码提交。测试维护在本包 `test/`,应用接线测试保留在应用中。 + +## 图标 + +图标使用随包打包的 Phosphor 官方字体,由 Flutter `Icon` 渲染,无第三方图标包依赖。 +应用与共享组件优先使用 `AppIcons`,默认 Regular;填充图标使用显式的 `Filled` 名称。 + +```dart +import 'package:cutdex_ui/icons.dart'; + +const Icon(AppIcons.search); +const Icon(AppIcons.folderFilled); +``` + +需要新增项目图标时,在 `lib/src/icons/app_icons.dart` 增加语义映射。完整目录通过 +`PhosphorIconsRegular` 与 `PhosphorIconsFill` 提供,例如 +`PhosphorIconsRegular.filmStrip`。颜色、尺寸及无障碍标签使用 `Icon` 的参数,或由 +`IconTheme` 继承。左右导航箭头和尖括号随 RTL 镜像,播放、撤销/重做及品牌图标保持原方向。 + +两套样式使用独立字体族,不能通过 `fontWeight` 在 Regular 与 Fill 之间切换。 +图标定义均为 `static const IconData`,支持 Flutter release 构建的字体裁剪;不要在运行时 +用 codepoint 创建图标。当前不包含 Duotone。 + +资源来自 [Phosphor web](https://github.com/phosphor-icons/web) 2.1.2,固定提交 +`3d40a3eaa73b25d20d263f0e1e55c9fed3e66809`。来源路径、字体及原始映射 SHA-256 +保存在 `tool/phosphor/catalog.json`,MIT 许可证随资源打包在 +`assets/fonts/PHOSPHOR_LICENSE.txt`。 + +在本包目录执行以下命令,生成过程只依赖 Python 标准库,不联网: + +```sh +python3 tool/generate_icons.py +python3 tool/generate_icons.py --check +``` + +升级时选定上游完整提交 SHA,并执行 `python3 tool/generate_icons.py --update `。 +脚本从同一提交下载 Regular、Fill 字体及映射,保留上游别名,验证两套目录一致,再生成 +Dart 常量。字体、目录快照、生成代码和许可证一起提交。升级后运行图标测试及一次带字体 +裁剪的 release 构建,确认资源可加载、图形正确。 diff --git a/packages/cutdex_ui/assets/fonts/PHOSPHOR_LICENSE.txt b/packages/cutdex_ui/assets/fonts/PHOSPHOR_LICENSE.txt new file mode 100644 index 0000000..c04a19d --- /dev/null +++ b/packages/cutdex_ui/assets/fonts/PHOSPHOR_LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2021 Phosphor Icons + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/cutdex_ui/assets/fonts/PhosphorFill.ttf b/packages/cutdex_ui/assets/fonts/PhosphorFill.ttf new file mode 100644 index 0000000..b02c4cb Binary files /dev/null and b/packages/cutdex_ui/assets/fonts/PhosphorFill.ttf differ diff --git a/packages/cutdex_ui/assets/fonts/PhosphorRegular.ttf b/packages/cutdex_ui/assets/fonts/PhosphorRegular.ttf new file mode 100644 index 0000000..7c1b8a7 Binary files /dev/null and b/packages/cutdex_ui/assets/fonts/PhosphorRegular.ttf differ diff --git a/packages/cutdex_ui/lib/cutdex_ui.dart b/packages/cutdex_ui/lib/cutdex_ui.dart index 82711d5..5705cef 100644 --- a/packages/cutdex_ui/lib/cutdex_ui.dart +++ b/packages/cutdex_ui/lib/cutdex_ui.dart @@ -1,2 +1,3 @@ +export 'icons.dart'; export 'theme.dart'; export 'widgets.dart'; diff --git a/packages/cutdex_ui/lib/icons.dart b/packages/cutdex_ui/lib/icons.dart new file mode 100644 index 0000000..853b827 --- /dev/null +++ b/packages/cutdex_ui/lib/icons.dart @@ -0,0 +1,2 @@ +export 'src/icons/app_icons.dart'; +export 'src/icons/phosphor_icons.g.dart'; diff --git a/packages/cutdex_ui/lib/src/icons/app_icons.dart b/packages/cutdex_ui/lib/src/icons/app_icons.dart new file mode 100644 index 0000000..2152103 --- /dev/null +++ b/packages/cutdex_ui/lib/src/icons/app_icons.dart @@ -0,0 +1,109 @@ +import 'package:flutter/widgets.dart'; + +import 'phosphor_icons.g.dart'; + +/// Shared Cutdex icons, using Regular by default and explicit Fill variants. +@staticIconProvider +abstract final class AppIcons { + static const IconData close = PhosphorIconsRegular.x; + static const IconData check = PhosphorIconsRegular.check; + static const IconData add = PhosphorIconsRegular.plus; + static const IconData remove = PhosphorIconsRegular.minus; + static const IconData search = PhosphorIconsRegular.magnifyingGlass; + static const IconData settings = PhosphorIconsRegular.gear; + static const IconData appearance = PhosphorIconsRegular.palette; + static const IconData more = PhosphorIconsRegular.dotsThree; + static const IconData expandMore = PhosphorIconsRegular.caretDown; + static const IconData expandLess = PhosphorIconsRegular.caretUp; + static const IconData chevronLeft = PhosphorIconsRegular.caretLeft; + static const IconData chevronRight = PhosphorIconsRegular.caretRight; + static const IconData arrowBack = PhosphorIconsRegular.arrowLeft; + static const IconData arrowForward = PhosphorIconsRegular.arrowRight; + static const IconData arrowUp = PhosphorIconsRegular.arrowUp; + static const IconData arrowDown = PhosphorIconsRegular.arrowDown; + static const IconData sort = PhosphorIconsRegular.sortAscending; + static const IconData play = PhosphorIconsRegular.play; + static const IconData pause = PhosphorIconsRegular.pause; + static const IconData stop = PhosphorIconsRegular.stop; + static const IconData undo = PhosphorIconsRegular.arrowUUpLeft; + static const IconData redo = PhosphorIconsRegular.arrowUUpRight; + static const IconData refresh = PhosphorIconsRegular.arrowsClockwise; + static const IconData reset = PhosphorIconsRegular.arrowCounterClockwise; + static const IconData angle = PhosphorIconsRegular.angle; + static const IconData seekStart = PhosphorIconsRegular.skipBack; + static const IconData previousFrame = PhosphorIconsRegular.caretLineLeft; + static const IconData nextFrame = PhosphorIconsRegular.caretLineRight; + static const IconData cut = PhosphorIconsRegular.scissors; + static const IconData delete = PhosphorIconsRegular.trash; + static const IconData edit = PhosphorIconsRegular.pencilSimple; + static const IconData rename = PhosphorIconsRegular.textbox; + static const IconData copy = PhosphorIconsRegular.copy; + static const IconData folder = PhosphorIconsRegular.folder; + static const IconData folderOpen = PhosphorIconsRegular.folderOpen; + static const IconData folderUnavailable = PhosphorIconsRegular.folderDashed; + static const IconData file = PhosphorIconsRegular.file; + static const IconData attachment = PhosphorIconsRegular.paperclip; + static const IconData video = PhosphorIconsRegular.filmStrip; + static const IconData image = PhosphorIconsRegular.image; + static const IconData audio = PhosphorIconsRegular.musicNotes; + static const IconData audioFile = PhosphorIconsRegular.fileAudio; + static const IconData imageUnavailable = PhosphorIconsRegular.imageBroken; + static const IconData mediaLibrary = PhosphorIconsRegular.images; + static const IconData videoLibrary = PhosphorIconsRegular.filmReel; + static const IconData timeline = PhosphorIconsRegular.rows; + static const IconData audioWaveform = PhosphorIconsRegular.waveform; + static const IconData removeBackground = PhosphorIconsRegular.userMinus; + static const IconData subtitles = PhosphorIconsRegular.subtitles; + static const IconData textWrap = PhosphorIconsRegular.arrowElbowDownLeft; + static const IconData volume = PhosphorIconsRegular.speakerHigh; + static const IconData mute = PhosphorIconsRegular.speakerSlash; + static const IconData visible = PhosphorIconsRegular.eye; + static const IconData hidden = PhosphorIconsRegular.eyeSlash; + static const IconData lock = PhosphorIconsRegular.lock; + static const IconData unlock = PhosphorIconsRegular.lockOpen; + static const IconData fullscreen = PhosphorIconsRegular.arrowsOut; + static const IconData exitFullscreen = PhosphorIconsRegular.arrowsIn; + static const IconData fitContent = PhosphorIconsRegular.cornersIn; + static const IconData menu = PhosphorIconsRegular.list; + static const IconData sidebar = PhosphorIconsRegular.sidebarSimple; + static const IconData splitVertical = + PhosphorIconsRegular.squareSplitVertical; + static const IconData listView = PhosphorIconsRegular.listBullets; + static const IconData gridView = PhosphorIconsRegular.squaresFour; + static const IconData collapseVertical = + PhosphorIconsRegular.arrowsInLineVertical; + static const IconData dragHandle = PhosphorIconsRegular.dotsSixVertical; + static const IconData windowRestore = PhosphorIconsRegular.copy; + static const IconData chat = PhosphorIconsRegular.chatCircle; + static const IconData home = PhosphorIconsRegular.house; + static const IconData conversations = PhosphorIconsRegular.chatsCircle; + static const IconData assistant = PhosphorIconsRegular.sparkle; + static const IconData model = PhosphorIconsRegular.brain; + static const IconData lightning = PhosphorIconsRegular.lightning; + static const IconData terminal = PhosphorIconsRegular.terminalWindow; + static const IconData tune = PhosphorIconsRegular.slidersHorizontal; + static const IconData error = PhosphorIconsRegular.warningCircle; + static const IconData success = PhosphorIconsRegular.checkCircle; + static const IconData info = PhosphorIconsRegular.info; + static const IconData pin = PhosphorIconsRegular.pushPin; + static const IconData pinFilled = PhosphorIconsFill.pushPin; + static const IconData square = PhosphorIconsRegular.square; + static const IconData squareFilled = PhosphorIconsFill.square; + static const IconData circle = PhosphorIconsRegular.circle; + static const IconData maskRegion = PhosphorIconsRegular.frameCorners; + static const IconData maskIntersect = PhosphorIconsRegular.intersectSquare; + static const IconData alignLeft = PhosphorIconsRegular.alignLeft; + static const IconData alignRight = PhosphorIconsRegular.alignRight; + static const IconData alignHorizontalCenter = + PhosphorIconsRegular.alignCenterHorizontal; + static const IconData alignTop = PhosphorIconsRegular.alignTop; + static const IconData alignBottom = PhosphorIconsRegular.alignBottom; + static const IconData alignVerticalCenter = + PhosphorIconsRegular.alignCenterVertical; + static const IconData download = PhosphorIconsRegular.downloadSimple; + static const IconData upload = PhosphorIconsRegular.uploadSimple; + static const IconData star = PhosphorIconsRegular.star; + static const IconData folderFilled = PhosphorIconsFill.folder; + static const IconData starFilled = PhosphorIconsFill.star; + static const IconData lockFilled = PhosphorIconsFill.lock; +} diff --git a/packages/cutdex_ui/lib/src/icons/phosphor_icons.g.dart b/packages/cutdex_ui/lib/src/icons/phosphor_icons.g.dart new file mode 100644 index 0000000..c16d7e1 --- /dev/null +++ b/packages/cutdex_ui/lib/src/icons/phosphor_icons.g.dart @@ -0,0 +1,15326 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND. +// Run: python3 tool/generate_icons.py (from packages/cutdex_ui). +// Phosphor web 2.1.2 @ 3d40a3eaa73b25d20d263f0e1e55c9fed3e66809 +import 'package:flutter/widgets.dart'; + +/// Phosphor Regular icons from the pinned font catalog. +@staticIconProvider +abstract final class PhosphorIconsRegular { + static const IconData acorn = IconData( + 0xeb9a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData activity = IconData( + 0xe000, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData addressBook = IconData( + 0xe6f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData addressBookTabs = IconData( + 0xee4e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airTrafficControl = IconData( + 0xecd8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airplane = IconData( + 0xe002, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneInFlight = IconData( + 0xe4fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneLanding = IconData( + 0xe502, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneTakeoff = IconData( + 0xe504, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneTaxiing = IconData( + 0xe500, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneTilt = IconData( + 0xe5d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData airplay = IconData( + 0xe004, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alarm = IconData( + 0xe006, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alien = IconData( + 0xe8a6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignBottom = IconData( + 0xe506, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignBottomSimple = IconData( + 0xeb0c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterHorizontal = IconData( + 0xe50a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterHorizontalSimple = IconData( + 0xeb0e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterVertical = IconData( + 0xe50c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterVerticalSimple = IconData( + 0xeb10, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignLeft = IconData( + 0xe50e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignLeftSimple = IconData( + 0xeaee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignRight = IconData( + 0xe510, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignRightSimple = IconData( + 0xeb12, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignTop = IconData( + 0xe512, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData alignTopSimple = IconData( + 0xeb14, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData amazonLogo = IconData( + 0xe96c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ambulance = IconData( + 0xe572, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData anchor = IconData( + 0xe514, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData anchorSimple = IconData( + 0xe5d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData androidLogo = IconData( + 0xe008, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData angle = IconData( + 0xe7bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData angularLogo = IconData( + 0xeb80, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData aperture = IconData( + 0xe00a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData appStoreLogo = IconData( + 0xe974, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData appWindow = IconData( + 0xe5da, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData appleLogo = IconData( + 0xe516, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData applePodcastsLogo = IconData( + 0xeb96, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData approximateEquals = IconData( + 0xedaa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData archive = IconData( + 0xe00c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData archiveBox = IconData( + 0xe00e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData archiveTray = IconData( + 0xe010, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData armchair = IconData( + 0xe012, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowArcLeft = IconData( + 0xe014, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowArcRight = IconData( + 0xe016, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDoubleUpLeft = IconData( + 0xe03a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDoubleUpRight = IconData( + 0xe03c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDownLeft = IconData( + 0xe018, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDownRight = IconData( + 0xe01a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendLeftDown = IconData( + 0xe01c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendLeftUp = IconData( + 0xe01e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendRightDown = IconData( + 0xe020, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendRightUp = IconData( + 0xe022, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendUpLeft = IconData( + 0xe024, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendUpRight = IconData( + 0xe026, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleDown = IconData( + 0xe028, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleDownLeft = IconData( + 0xe02a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleDownRight = IconData( + 0xe02c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleLeft = IconData( + 0xe05a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleRight = IconData( + 0xe02e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleUp = IconData( + 0xe030, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleUpLeft = IconData( + 0xe032, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleUpRight = IconData( + 0xe034, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowClockwise = IconData( + 0xe036, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCounterClockwise = IconData( + 0xe038, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowDown = IconData( + 0xe03e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowDownLeft = IconData( + 0xe040, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowDownRight = IconData( + 0xe042, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowDownLeft = IconData( + 0xe044, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowDownRight = IconData( + 0xe046, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowLeft = IconData( + 0xe048, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowLeftDown = IconData( + 0xe04a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowLeftUp = IconData( + 0xe04c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowRight = IconData( + 0xe04e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowRightDown = IconData( + 0xe050, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowRightUp = IconData( + 0xe052, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowUpLeft = IconData( + 0xe054, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowUpRight = IconData( + 0xe056, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatDown = IconData( + 0xe518, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLeft = IconData( + 0xe51a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineDown = IconData( + 0xe51c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineLeft = IconData( + 0xe51e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineRight = IconData( + 0xe520, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineUp = IconData( + 0xe522, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesDown = IconData( + 0xe524, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesLeft = IconData( + 0xe526, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesRight = IconData( + 0xe528, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesUp = IconData( + 0xe52a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatRight = IconData( + 0xe52c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatUp = IconData( + 0xe52e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLeft = IconData( + 0xe058, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData arrowLineDown = IconData( + 0xe05c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineDownLeft = IconData( + 0xe05e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineDownRight = IconData( + 0xe060, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineLeft = IconData( + 0xe062, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineRight = IconData( + 0xe064, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineUp = IconData( + 0xe066, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineUpLeft = IconData( + 0xe068, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineUpRight = IconData( + 0xe06a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowRight = IconData( + 0xe06c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData arrowSquareDown = IconData( + 0xe06e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareDownLeft = IconData( + 0xe070, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareDownRight = IconData( + 0xe072, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareIn = IconData( + 0xe5dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareLeft = IconData( + 0xe074, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareOut = IconData( + 0xe5de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareRight = IconData( + 0xe076, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareUp = IconData( + 0xe078, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareUpLeft = IconData( + 0xe07a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareUpRight = IconData( + 0xe07c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUDownLeft = IconData( + 0xe07e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUDownRight = IconData( + 0xe080, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowULeftDown = IconData( + 0xe082, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowULeftUp = IconData( + 0xe084, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowURightDown = IconData( + 0xe086, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowURightUp = IconData( + 0xe088, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUUpLeft = IconData( + 0xe08a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUUpRight = IconData( + 0xe08c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUp = IconData( + 0xe08e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUpLeft = IconData( + 0xe090, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUpRight = IconData( + 0xe092, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsClockwise = IconData( + 0xe094, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsCounterClockwise = IconData( + 0xe096, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsDownUp = IconData( + 0xe098, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsHorizontal = IconData( + 0xeb06, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsIn = IconData( + 0xe09a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInCardinal = IconData( + 0xe09c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInLineHorizontal = IconData( + 0xe530, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInLineVertical = IconData( + 0xe532, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInSimple = IconData( + 0xe09e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsLeftRight = IconData( + 0xe0a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsMerge = IconData( + 0xed3e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOut = IconData( + 0xe0a2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutCardinal = IconData( + 0xe0a4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutLineHorizontal = IconData( + 0xe534, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutLineVertical = IconData( + 0xe536, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutSimple = IconData( + 0xe0a6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsSplit = IconData( + 0xed3c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsVertical = IconData( + 0xeb04, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData article = IconData( + 0xe0a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData articleMedium = IconData( + 0xe5e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData articleNyTimes = IconData( + 0xe5e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData asclepius = IconData( + 0xee34, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData asterisk = IconData( + 0xe0aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData asteriskSimple = IconData( + 0xe832, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData at = IconData( + 0xe0ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData atom = IconData( + 0xe5e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData avocado = IconData( + 0xee04, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData axe = IconData( + 0xe9fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData baby = IconData( + 0xe774, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData babyCarriage = IconData( + 0xe818, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData backpack = IconData( + 0xe922, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData backspace = IconData( + 0xe0ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bag = IconData( + 0xe0b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bagSimple = IconData( + 0xe5e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData balloon = IconData( + 0xe76c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bandaids = IconData( + 0xe0b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bank = IconData( + 0xe0b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData barbell = IconData( + 0xe0b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData barcode = IconData( + 0xe0b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData barn = IconData( + 0xec72, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData barricade = IconData( + 0xe948, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData baseball = IconData( + 0xe71a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData baseballCap = IconData( + 0xea28, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData baseballHelmet = IconData( + 0xee4a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData basket = IconData( + 0xe964, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData basketball = IconData( + 0xe724, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bathtub = IconData( + 0xe81e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryCharging = IconData( + 0xe0ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryChargingVertical = IconData( + 0xe0bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryEmpty = IconData( + 0xe0be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryFull = IconData( + 0xe0c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryHigh = IconData( + 0xe0c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryLow = IconData( + 0xe0c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryMedium = IconData( + 0xe0c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryPlus = IconData( + 0xe808, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryPlusVertical = IconData( + 0xec50, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalEmpty = IconData( + 0xe7c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalFull = IconData( + 0xe7c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalHigh = IconData( + 0xe7c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalLow = IconData( + 0xe7be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalMedium = IconData( + 0xe7c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryWarning = IconData( + 0xe0c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryWarningVertical = IconData( + 0xe0ca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData beachBall = IconData( + 0xed24, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData beanie = IconData( + 0xea2a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bed = IconData( + 0xe0cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData beerBottle = IconData( + 0xe7b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData beerStein = IconData( + 0xeb62, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData behanceLogo = IconData( + 0xe7f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bell = IconData( + 0xe0ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bellRinging = IconData( + 0xe5e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimple = IconData( + 0xe0d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimpleRinging = IconData( + 0xe5ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimpleSlash = IconData( + 0xe0d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimpleZ = IconData( + 0xe5ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSlash = IconData( + 0xe0d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bellZ = IconData( + 0xe5ee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData belt = IconData( + 0xea2c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bezierCurve = IconData( + 0xeb00, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bicycle = IconData( + 0xe0d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData binary = IconData( + 0xee60, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData binoculars = IconData( + 0xea64, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData biohazard = IconData( + 0xe9e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bird = IconData( + 0xe72c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData blueprint = IconData( + 0xeda0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetooth = IconData( + 0xe0da, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetoothConnected = IconData( + 0xe0dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetoothSlash = IconData( + 0xe0de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetoothX = IconData( + 0xe0e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData boat = IconData( + 0xe786, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bomb = IconData( + 0xee0a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bone = IconData( + 0xe7f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData book = IconData( + 0xe0e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookBookmark = IconData( + 0xe0e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookOpen = IconData( + 0xe0e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookOpenText = IconData( + 0xe8f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookOpenUser = IconData( + 0xede0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmark = IconData( + 0xe0e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmarkSimple = IconData( + 0xe0ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmarks = IconData( + 0xe0ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmarksSimple = IconData( + 0xe5f0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData books = IconData( + 0xe758, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData boot = IconData( + 0xecca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData boules = IconData( + 0xe722, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData boundingBox = IconData( + 0xe6ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bowlFood = IconData( + 0xeaa4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bowlSteam = IconData( + 0xe8e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bowlingBall = IconData( + 0xea34, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData boxArrowDown = IconData( + 0xe00e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData boxArrowUp = IconData( + 0xee54, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData boxingGlove = IconData( + 0xea36, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsAngle = IconData( + 0xe862, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsCurly = IconData( + 0xe860, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsRound = IconData( + 0xe864, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsSquare = IconData( + 0xe85e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData brain = IconData( + 0xe74e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData brandy = IconData( + 0xe6b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bread = IconData( + 0xe81c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bridge = IconData( + 0xea68, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData briefcase = IconData( + 0xe0ee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData briefcaseMetal = IconData( + 0xe5f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData broadcast = IconData( + 0xe0f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData broom = IconData( + 0xec54, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData browser = IconData( + 0xe0f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData browsers = IconData( + 0xe0f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bug = IconData( + 0xe5f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bugBeetle = IconData( + 0xe5f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bugDroid = IconData( + 0xe5f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData building = IconData( + 0xe100, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData buildingApartment = IconData( + 0xe0fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData buildingOffice = IconData( + 0xe0ff, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData buildings = IconData( + 0xe102, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bulldozer = IconData( + 0xec6c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData bus = IconData( + 0xe106, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData butterfly = IconData( + 0xea6e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cableCar = IconData( + 0xe49c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cactus = IconData( + 0xe918, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caduceus = IconData( + 0xee34, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cake = IconData( + 0xe780, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calculator = IconData( + 0xe538, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendar = IconData( + 0xe108, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarBlank = IconData( + 0xe10a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarCheck = IconData( + 0xe712, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarDot = IconData( + 0xe7b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarDots = IconData( + 0xe7b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarHeart = IconData( + 0xe8b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarMinus = IconData( + 0xea14, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarPlus = IconData( + 0xe714, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarSlash = IconData( + 0xea12, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarStar = IconData( + 0xe8b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarX = IconData( + 0xe10c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData callBell = IconData( + 0xe7de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData camera = IconData( + 0xe10e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cameraPlus = IconData( + 0xec58, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cameraRotate = IconData( + 0xe7a4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cameraSlash = IconData( + 0xe110, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData campfire = IconData( + 0xe9d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData car = IconData( + 0xe112, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData carBattery = IconData( + 0xee30, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData carProfile = IconData( + 0xe8cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData carSimple = IconData( + 0xe114, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cardholder = IconData( + 0xe5fa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cards = IconData( + 0xe0f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cardsThree = IconData( + 0xee50, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleDown = IconData( + 0xe116, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleLeft = IconData( + 0xe118, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleRight = IconData( + 0xe11a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleUp = IconData( + 0xe11c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDown = IconData( + 0xe11e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleLeft = IconData( + 0xe120, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleRight = IconData( + 0xe122, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleUp = IconData( + 0xe124, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleUpDown = IconData( + 0xe13e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretDoubleDown = IconData( + 0xe126, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretDoubleLeft = IconData( + 0xe128, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretDoubleRight = IconData( + 0xe12a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretDoubleUp = IconData( + 0xe12c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretDown = IconData( + 0xe136, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLeft = IconData( + 0xe138, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretLineDown = IconData( + 0xe134, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLineLeft = IconData( + 0xe132, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLineRight = IconData( + 0xe130, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLineUp = IconData( + 0xe12e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretRight = IconData( + 0xe13a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretUp = IconData( + 0xe13c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData caretUpDown = IconData( + 0xe140, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData carrot = IconData( + 0xed38, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cashRegister = IconData( + 0xed80, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cassetteTape = IconData( + 0xed2e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData castleTurret = IconData( + 0xe9d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cat = IconData( + 0xe748, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalFull = IconData( + 0xe142, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalHigh = IconData( + 0xe144, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalLow = IconData( + 0xe146, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalMedium = IconData( + 0xe148, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalNone = IconData( + 0xe14a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalSlash = IconData( + 0xe14c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalX = IconData( + 0xe14e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cellTower = IconData( + 0xebaa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData certificate = IconData( + 0xe766, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chair = IconData( + 0xe950, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chalkboard = IconData( + 0xe5fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chalkboardSimple = IconData( + 0xe5fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chalkboardTeacher = IconData( + 0xe600, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData champagne = IconData( + 0xeaca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chargingStation = IconData( + 0xe8d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartBar = IconData( + 0xe150, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartBarHorizontal = IconData( + 0xe152, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartDonut = IconData( + 0xeaa6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartLine = IconData( + 0xe154, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartLineDown = IconData( + 0xe8b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartLineUp = IconData( + 0xe156, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartPie = IconData( + 0xe158, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartPieSlice = IconData( + 0xe15a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartPolar = IconData( + 0xeaa8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chartScatter = IconData( + 0xeaac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chat = IconData( + 0xe15c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCentered = IconData( + 0xe160, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCenteredDots = IconData( + 0xe164, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCenteredSlash = IconData( + 0xe162, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCenteredText = IconData( + 0xe166, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircle = IconData( + 0xe168, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircleDots = IconData( + 0xe16c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircleSlash = IconData( + 0xe16a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircleText = IconData( + 0xe16e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatDots = IconData( + 0xe170, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatSlash = IconData( + 0xe15e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardrop = IconData( + 0xe172, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardropDots = IconData( + 0xe176, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardropSlash = IconData( + 0xe174, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardropText = IconData( + 0xe178, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatText = IconData( + 0xe17a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chats = IconData( + 0xe17c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatsCircle = IconData( + 0xe17e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chatsTeardrop = IconData( + 0xe180, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData check = IconData( + 0xe182, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData checkCircle = IconData( + 0xe184, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData checkFat = IconData( + 0xeba6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData checkSquare = IconData( + 0xe186, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData checkSquareOffset = IconData( + 0xe188, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData checkerboard = IconData( + 0xe8c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData checks = IconData( + 0xe53a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cheers = IconData( + 0xea4a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cheese = IconData( + 0xe9fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData chefHat = IconData( + 0xed8e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cherries = IconData( + 0xe830, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData church = IconData( + 0xecea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cigarette = IconData( + 0xed90, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cigaretteSlash = IconData( + 0xed92, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circle = IconData( + 0xe18a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleDashed = IconData( + 0xe602, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleHalf = IconData( + 0xe18c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleHalfTilt = IconData( + 0xe18e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleNotch = IconData( + 0xeb44, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavy = IconData( + 0xe604, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavyCheck = IconData( + 0xe606, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavyQuestion = IconData( + 0xe608, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavyWarning = IconData( + 0xe60c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circlesFour = IconData( + 0xe190, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circlesThree = IconData( + 0xe192, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circlesThreePlus = IconData( + 0xe194, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData circuitry = IconData( + 0xe9c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData city = IconData( + 0xea6a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clipboard = IconData( + 0xe196, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clipboardText = IconData( + 0xe198, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clock = IconData( + 0xe19a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clockAfternoon = IconData( + 0xe19c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clockClockwise = IconData( + 0xe19e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clockCountdown = IconData( + 0xed2c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clockCounterClockwise = IconData( + 0xe1a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clockUser = IconData( + 0xedec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData closedCaptioning = IconData( + 0xe1a4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloud = IconData( + 0xe1aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudArrowDown = IconData( + 0xe1ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudArrowUp = IconData( + 0xe1ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudCheck = IconData( + 0xe1b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudFog = IconData( + 0xe53c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudLightning = IconData( + 0xe1b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudMoon = IconData( + 0xe53e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudRain = IconData( + 0xe1b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudSlash = IconData( + 0xe1b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudSnow = IconData( + 0xe1b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudSun = IconData( + 0xe540, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudWarning = IconData( + 0xea98, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudX = IconData( + 0xea96, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData clover = IconData( + 0xedc8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData club = IconData( + 0xe1ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData coatHanger = IconData( + 0xe7fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData codaLogo = IconData( + 0xe7ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData code = IconData( + 0xe1bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData codeBlock = IconData( + 0xeafe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData codeSimple = IconData( + 0xe1be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData codepenLogo = IconData( + 0xe978, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData codesandboxLogo = IconData( + 0xea06, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData coffee = IconData( + 0xe1c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData coffeeBean = IconData( + 0xe1c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData coin = IconData( + 0xe60e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData coinVertical = IconData( + 0xeb48, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData coins = IconData( + 0xe78e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData columns = IconData( + 0xe546, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData columnsPlusLeft = IconData( + 0xe544, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData columnsPlusRight = IconData( + 0xe542, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData command = IconData( + 0xe1c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData compass = IconData( + 0xe1c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData compassRose = IconData( + 0xe1c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData compassTool = IconData( + 0xea0e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData computerTower = IconData( + 0xe548, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData confetti = IconData( + 0xe81a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData contactlessPayment = IconData( + 0xed42, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData control = IconData( + 0xeca6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cookie = IconData( + 0xe6ca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cookingPot = IconData( + 0xe764, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData copy = IconData( + 0xe1ca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData copySimple = IconData( + 0xe1cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData copyleft = IconData( + 0xe86a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData copyright = IconData( + 0xe54a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cornersIn = IconData( + 0xe1ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cornersOut = IconData( + 0xe1d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData couch = IconData( + 0xe7f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData courtBasketball = IconData( + 0xee36, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cow = IconData( + 0xeabe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cowboyHat = IconData( + 0xed12, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cpu = IconData( + 0xe610, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData crane = IconData( + 0xed48, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData craneTower = IconData( + 0xed49, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData creditCard = IconData( + 0xe1d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cricket = IconData( + 0xee12, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData crop = IconData( + 0xe1d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cross = IconData( + 0xe8a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData crosshair = IconData( + 0xe1d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData crosshairSimple = IconData( + 0xe1d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData crown = IconData( + 0xe614, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData crownCross = IconData( + 0xee5e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData crownSimple = IconData( + 0xe616, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cube = IconData( + 0xe1da, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cubeFocus = IconData( + 0xed0a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cubeTransparent = IconData( + 0xec7c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyBtc = IconData( + 0xe618, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyCircleDollar = IconData( + 0xe54c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyCny = IconData( + 0xe54e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyDollar = IconData( + 0xe550, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyDollarSimple = IconData( + 0xe552, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyEth = IconData( + 0xeada, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyEur = IconData( + 0xe554, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyGbp = IconData( + 0xe556, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyInr = IconData( + 0xe558, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyJpy = IconData( + 0xe55a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyKrw = IconData( + 0xe55c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyKzt = IconData( + 0xec4c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyNgn = IconData( + 0xeb52, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyRub = IconData( + 0xe55e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cursor = IconData( + 0xe1dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cursorClick = IconData( + 0xe7c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cursorText = IconData( + 0xe7d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData cylinder = IconData( + 0xe8fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData database = IconData( + 0xe1de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData desk = IconData( + 0xed16, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData desktop = IconData( + 0xe560, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData desktopTower = IconData( + 0xe562, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData detective = IconData( + 0xe83e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData devToLogo = IconData( + 0xed0e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobile = IconData( + 0xe1e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobileCamera = IconData( + 0xe1e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobileSlash = IconData( + 0xee46, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobileSpeaker = IconData( + 0xe1e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceRotate = IconData( + 0xedf2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceTablet = IconData( + 0xe1e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceTabletCamera = IconData( + 0xe1e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceTabletSpeaker = IconData( + 0xe1ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData devices = IconData( + 0xeba4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diamond = IconData( + 0xe1ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diamondsFour = IconData( + 0xe8f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diceFive = IconData( + 0xe1ee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diceFour = IconData( + 0xe1f0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diceOne = IconData( + 0xe1f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diceSix = IconData( + 0xe1f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diceThree = IconData( + 0xe1f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData diceTwo = IconData( + 0xe1f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData disc = IconData( + 0xe564, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData discoBall = IconData( + 0xed98, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData discordLogo = IconData( + 0xe61a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData divide = IconData( + 0xe1fa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dna = IconData( + 0xe924, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dog = IconData( + 0xe74a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData door = IconData( + 0xe61c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData doorOpen = IconData( + 0xe7e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dot = IconData( + 0xecde, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotOutline = IconData( + 0xece0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsNine = IconData( + 0xe1fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsSix = IconData( + 0xe794, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsSixVertical = IconData( + 0xeae2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThree = IconData( + 0xe1fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeCircle = IconData( + 0xe200, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeCircleVertical = IconData( + 0xe202, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeOutline = IconData( + 0xe204, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeOutlineVertical = IconData( + 0xe206, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeVertical = IconData( + 0xe208, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData download = IconData( + 0xe20a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData downloadSimple = IconData( + 0xe20c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dress = IconData( + 0xea7e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dresser = IconData( + 0xe94e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dribbbleLogo = IconData( + 0xe20e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData drone = IconData( + 0xed74, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData drop = IconData( + 0xe210, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dropHalf = IconData( + 0xe566, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dropHalfBottom = IconData( + 0xeb40, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dropSimple = IconData( + 0xee32, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dropSlash = IconData( + 0xe954, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData dropboxLogo = IconData( + 0xe7d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ear = IconData( + 0xe70c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData earSlash = IconData( + 0xe70e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData egg = IconData( + 0xe812, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eggCrack = IconData( + 0xeb64, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eject = IconData( + 0xe212, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ejectSimple = IconData( + 0xe6ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData elevator = IconData( + 0xecc0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData empty = IconData( + 0xedbc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData engine = IconData( + 0xea80, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData envelope = IconData( + 0xe214, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData envelopeOpen = IconData( + 0xe216, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData envelopeSimple = IconData( + 0xe218, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData envelopeSimpleOpen = IconData( + 0xe21a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData equalizer = IconData( + 0xebbc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData equals = IconData( + 0xe21c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eraser = IconData( + 0xe21e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData escalatorDown = IconData( + 0xecba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData escalatorUp = IconData( + 0xecbc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData exam = IconData( + 0xe742, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData exclamationMark = IconData( + 0xee44, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData exclude = IconData( + 0xe882, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData excludeSquare = IconData( + 0xe880, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData export = IconData( + 0xeaf0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eye = IconData( + 0xe220, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eyeClosed = IconData( + 0xe222, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eyeSlash = IconData( + 0xe224, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eyedropper = IconData( + 0xe568, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eyedropperSample = IconData( + 0xeac4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eyeglasses = IconData( + 0xe7ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData eyes = IconData( + 0xee5c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData faceMask = IconData( + 0xe56a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData facebookLogo = IconData( + 0xe226, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData factory = IconData( + 0xe760, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData faders = IconData( + 0xe228, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fadersHorizontal = IconData( + 0xe22a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData falloutShelter = IconData( + 0xe9de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fan = IconData( + 0xe9f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData farm = IconData( + 0xec70, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fastForward = IconData( + 0xe6a6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fastForwardCircle = IconData( + 0xe22c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData feather = IconData( + 0xe9c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fediverseLogo = IconData( + 0xed66, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData figmaLogo = IconData( + 0xe22e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData file = IconData( + 0xe230, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileArchive = IconData( + 0xeb2a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileArrowDown = IconData( + 0xe232, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileArrowUp = IconData( + 0xe61e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileAudio = IconData( + 0xea20, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileC = IconData( + 0xeb32, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCSharp = IconData( + 0xeb30, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCloud = IconData( + 0xe95e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCode = IconData( + 0xe914, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCpp = IconData( + 0xeb2e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCss = IconData( + 0xeb34, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCsv = IconData( + 0xeb1c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileDashed = IconData( + 0xe704, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileDoc = IconData( + 0xeb1e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileDotted = IconData( + 0xe704, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileHtml = IconData( + 0xeb38, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileImage = IconData( + 0xea24, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileIni = IconData( + 0xeb33, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileJpg = IconData( + 0xeb1a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileJs = IconData( + 0xeb24, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileJsx = IconData( + 0xeb3a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileLock = IconData( + 0xe95c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileMagnifyingGlass = IconData( + 0xe238, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileMd = IconData( + 0xed50, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileMinus = IconData( + 0xe234, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filePdf = IconData( + 0xe702, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filePlus = IconData( + 0xe236, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filePng = IconData( + 0xeb18, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filePpt = IconData( + 0xeb20, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filePy = IconData( + 0xeb2c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileRs = IconData( + 0xeb28, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileSearch = IconData( + 0xe238, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileSql = IconData( + 0xed4e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileSvg = IconData( + 0xed08, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileText = IconData( + 0xe23a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileTs = IconData( + 0xeb26, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileTsx = IconData( + 0xeb3c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileTxt = IconData( + 0xeb35, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileVideo = IconData( + 0xea22, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileVue = IconData( + 0xeb3e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileX = IconData( + 0xe23c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileXls = IconData( + 0xeb22, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fileZip = IconData( + 0xe958, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData files = IconData( + 0xe710, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filmReel = IconData( + 0xe8c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filmScript = IconData( + 0xeb50, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filmSlate = IconData( + 0xe8c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData filmStrip = IconData( + 0xe792, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fingerprint = IconData( + 0xe23e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fingerprintSimple = IconData( + 0xe240, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData finnTheHuman = IconData( + 0xe56c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fire = IconData( + 0xe242, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fireExtinguisher = IconData( + 0xe9e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fireSimple = IconData( + 0xe620, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fireTruck = IconData( + 0xe574, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData firstAid = IconData( + 0xe56e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData firstAidKit = IconData( + 0xe570, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fish = IconData( + 0xe728, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fishSimple = IconData( + 0xe72a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flag = IconData( + 0xe244, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flagBanner = IconData( + 0xe622, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flagBannerFold = IconData( + 0xecf2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flagCheckered = IconData( + 0xea38, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flagPennant = IconData( + 0xecf0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flame = IconData( + 0xe624, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flashlight = IconData( + 0xe246, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flask = IconData( + 0xe79e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flipHorizontal = IconData( + 0xed6a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flipVertical = IconData( + 0xed6c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData floppyDisk = IconData( + 0xe248, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData floppyDiskBack = IconData( + 0xeaf4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flowArrow = IconData( + 0xe6ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flower = IconData( + 0xe75e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flowerLotus = IconData( + 0xe6cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flowerTulip = IconData( + 0xeacc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData flyingSaucer = IconData( + 0xeb4a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folder = IconData( + 0xe24a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderDashed = IconData( + 0xe8f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderDotted = IconData( + 0xe8f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderLock = IconData( + 0xea3c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderMinus = IconData( + 0xe254, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotch = IconData( + 0xe24a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotchMinus = IconData( + 0xe254, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotchOpen = IconData( + 0xe256, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotchPlus = IconData( + 0xe258, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderOpen = IconData( + 0xe256, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderPlus = IconData( + 0xe258, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimple = IconData( + 0xe25a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleDashed = IconData( + 0xec2a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleDotted = IconData( + 0xec2a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleLock = IconData( + 0xeb5e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleMinus = IconData( + 0xe25c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimplePlus = IconData( + 0xe25e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleStar = IconData( + 0xec2e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleUser = IconData( + 0xeb60, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderStar = IconData( + 0xea86, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folderUser = IconData( + 0xeb46, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData folders = IconData( + 0xe260, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData football = IconData( + 0xe718, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData footballHelmet = IconData( + 0xee4c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData footprints = IconData( + 0xea88, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData forkKnife = IconData( + 0xe262, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData fourK = IconData( + 0xea5c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData frameCorners = IconData( + 0xe626, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData framerLogo = IconData( + 0xe264, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData function = IconData( + 0xebe4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData funnel = IconData( + 0xe266, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData funnelSimple = IconData( + 0xe268, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData funnelSimpleX = IconData( + 0xe26a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData funnelX = IconData( + 0xe26c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gameController = IconData( + 0xe26e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData garage = IconData( + 0xecd6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gasCan = IconData( + 0xe8ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gasPump = IconData( + 0xe768, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gauge = IconData( + 0xe628, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gavel = IconData( + 0xea32, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gear = IconData( + 0xe270, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gearFine = IconData( + 0xe87c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gearSix = IconData( + 0xe272, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData genderFemale = IconData( + 0xe6e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData genderIntersex = IconData( + 0xe6e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData genderMale = IconData( + 0xe6e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData genderNeuter = IconData( + 0xe6ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData genderNonbinary = IconData( + 0xe6e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData genderTransgender = IconData( + 0xe6e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ghost = IconData( + 0xe62a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gif = IconData( + 0xe274, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gift = IconData( + 0xe276, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitBranch = IconData( + 0xe278, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitCommit = IconData( + 0xe27a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitDiff = IconData( + 0xe27c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitFork = IconData( + 0xe27e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitMerge = IconData( + 0xe280, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitPullRequest = IconData( + 0xe282, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData githubLogo = IconData( + 0xe576, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitlabLogo = IconData( + 0xe694, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gitlabLogoSimple = IconData( + 0xe696, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData globe = IconData( + 0xe288, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData globeHemisphereEast = IconData( + 0xe28a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData globeHemisphereWest = IconData( + 0xe28c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData globeSimple = IconData( + 0xe28e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData globeSimpleX = IconData( + 0xe284, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData globeStand = IconData( + 0xe290, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData globeX = IconData( + 0xe286, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData goggles = IconData( + 0xecb4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData golf = IconData( + 0xea3e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData goodreadsLogo = IconData( + 0xed10, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData googleCardboardLogo = IconData( + 0xe7b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData googleChromeLogo = IconData( + 0xe976, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData googleDriveLogo = IconData( + 0xe8f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData googleLogo = IconData( + 0xe292, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData googlePhotosLogo = IconData( + 0xeb92, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData googlePlayLogo = IconData( + 0xe294, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData googlePodcastsLogo = IconData( + 0xeb94, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gps = IconData( + 0xedd8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gpsFix = IconData( + 0xedd6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gpsSlash = IconData( + 0xedd4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gradient = IconData( + 0xeb42, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData graduationCap = IconData( + 0xe62c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData grains = IconData( + 0xec68, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData grainsSlash = IconData( + 0xec6a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData graph = IconData( + 0xeb58, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData graphicsCard = IconData( + 0xe612, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData greaterThan = IconData( + 0xedc4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData greaterThanOrEqual = IconData( + 0xeda2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gridFour = IconData( + 0xe296, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData gridNine = IconData( + 0xec8c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData guitar = IconData( + 0xea8a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hairDryer = IconData( + 0xea66, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hamburger = IconData( + 0xe790, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hammer = IconData( + 0xe80e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hand = IconData( + 0xe298, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handArrowDown = IconData( + 0xea4e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handArrowUp = IconData( + 0xee5a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handCoins = IconData( + 0xea8c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handDeposit = IconData( + 0xee82, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handEye = IconData( + 0xea4c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handFist = IconData( + 0xe57a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handGrabbing = IconData( + 0xe57c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handHeart = IconData( + 0xe810, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handPalm = IconData( + 0xe57e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handPeace = IconData( + 0xe7cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handPointing = IconData( + 0xe29a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handSoap = IconData( + 0xe630, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handSwipeLeft = IconData( + 0xec94, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handSwipeRight = IconData( + 0xec92, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handTap = IconData( + 0xec90, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handWaving = IconData( + 0xe580, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handWithdraw = IconData( + 0xee80, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handbag = IconData( + 0xe29c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handbagSimple = IconData( + 0xe62e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handsClapping = IconData( + 0xe6a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handsPraying = IconData( + 0xecc8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData handshake = IconData( + 0xe582, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hardDrive = IconData( + 0xe29e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hardDrives = IconData( + 0xe2a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hardHat = IconData( + 0xed46, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hash = IconData( + 0xe2a2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hashStraight = IconData( + 0xe2a4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData headCircuit = IconData( + 0xe7d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData headlights = IconData( + 0xe6fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData headphones = IconData( + 0xe2a6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData headset = IconData( + 0xe584, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData heart = IconData( + 0xe2a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData heartBreak = IconData( + 0xebe8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData heartHalf = IconData( + 0xec48, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData heartStraight = IconData( + 0xe2aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData heartStraightBreak = IconData( + 0xeb98, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData heartbeat = IconData( + 0xe2ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hexagon = IconData( + 0xe2ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData highDefinition = IconData( + 0xea8e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData highHeel = IconData( + 0xe8e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData highlighter = IconData( + 0xec76, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData highlighterCircle = IconData( + 0xe632, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hockey = IconData( + 0xec86, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hoodie = IconData( + 0xecd0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData horse = IconData( + 0xe2b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hospital = IconData( + 0xe844, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglass = IconData( + 0xe2b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassHigh = IconData( + 0xe2b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassLow = IconData( + 0xe2b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassMedium = IconData( + 0xe2b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimple = IconData( + 0xe2ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimpleHigh = IconData( + 0xe2bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimpleLow = IconData( + 0xe2be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimpleMedium = IconData( + 0xe2c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData house = IconData( + 0xe2c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData houseLine = IconData( + 0xe2c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData houseSimple = IconData( + 0xe2c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData hurricane = IconData( + 0xe88e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData iceCream = IconData( + 0xe804, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData identificationBadge = IconData( + 0xe6f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData identificationCard = IconData( + 0xe2c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData image = IconData( + 0xe2ca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData imageBroken = IconData( + 0xe7a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData imageSquare = IconData( + 0xe2cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData images = IconData( + 0xe836, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData imagesSquare = IconData( + 0xe834, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData infinity = IconData( + 0xe634, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData info = IconData( + 0xe2ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData instagramLogo = IconData( + 0xe2d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData intersect = IconData( + 0xe2d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData intersectSquare = IconData( + 0xe87a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData intersectThree = IconData( + 0xecc4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData intersection = IconData( + 0xedba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData invoice = IconData( + 0xee42, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData island = IconData( + 0xee06, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData jar = IconData( + 0xe7e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData jarLabel = IconData( + 0xe7e1, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData jeep = IconData( + 0xe2d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData joystick = IconData( + 0xea5e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData kanban = IconData( + 0xeb54, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData key = IconData( + 0xe2d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData keyReturn = IconData( + 0xe782, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData keyboard = IconData( + 0xe2d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData keyhole = IconData( + 0xea78, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData knife = IconData( + 0xe636, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ladder = IconData( + 0xe9e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ladderSimple = IconData( + 0xec26, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lamp = IconData( + 0xe638, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lampPendant = IconData( + 0xee2e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData laptop = IconData( + 0xe586, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lasso = IconData( + 0xedc6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lastfmLogo = IconData( + 0xe842, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData layout = IconData( + 0xe6d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData leaf = IconData( + 0xe2da, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lectern = IconData( + 0xe95a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lego = IconData( + 0xe8c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData legoSmiley = IconData( + 0xe8c7, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lemniscate = IconData( + 0xe634, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lessThan = IconData( + 0xedac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lessThanOrEqual = IconData( + 0xeda4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData letterCircleH = IconData( + 0xebf8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData letterCircleP = IconData( + 0xec08, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData letterCircleV = IconData( + 0xec14, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lifebuoy = IconData( + 0xe63a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lightbulb = IconData( + 0xe2dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lightbulbFilament = IconData( + 0xe63c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lighthouse = IconData( + 0xe9f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lightning = IconData( + 0xe2de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lightningA = IconData( + 0xea84, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lightningSlash = IconData( + 0xe2e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lineSegment = IconData( + 0xe6d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lineSegments = IconData( + 0xe6d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lineVertical = IconData( + 0xed70, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData link = IconData( + 0xe2e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linkBreak = IconData( + 0xe2e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimple = IconData( + 0xe2e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimpleBreak = IconData( + 0xe2e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimpleHorizontal = IconData( + 0xe2ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimpleHorizontalBreak = IconData( + 0xe2ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linkedinLogo = IconData( + 0xe2ee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linktreeLogo = IconData( + 0xedee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData linuxLogo = IconData( + 0xeb02, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData list = IconData( + 0xe2f0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listBullets = IconData( + 0xe2f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listChecks = IconData( + 0xeadc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listDashes = IconData( + 0xe2f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listHeart = IconData( + 0xebde, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listMagnifyingGlass = IconData( + 0xebe0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listNumbers = IconData( + 0xe2f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listPlus = IconData( + 0xe2f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData listStar = IconData( + 0xebdc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lock = IconData( + 0xe2fa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockKey = IconData( + 0xe2fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockKeyOpen = IconData( + 0xe300, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockLaminated = IconData( + 0xe302, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockLaminatedOpen = IconData( + 0xe304, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockOpen = IconData( + 0xe306, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockSimple = IconData( + 0xe308, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockSimpleOpen = IconData( + 0xe30a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData lockers = IconData( + 0xecb8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData log = IconData( + 0xed82, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData magicWand = IconData( + 0xe6b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData magnet = IconData( + 0xe680, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData magnetStraight = IconData( + 0xe682, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData magnifyingGlass = IconData( + 0xe30c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData magnifyingGlassMinus = IconData( + 0xe30e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData magnifyingGlassPlus = IconData( + 0xe310, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mailbox = IconData( + 0xec1e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPin = IconData( + 0xe316, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinArea = IconData( + 0xee3a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinLine = IconData( + 0xe318, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinPlus = IconData( + 0xe314, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinSimple = IconData( + 0xee3e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinSimpleArea = IconData( + 0xee3c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinSimpleLine = IconData( + 0xee38, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mapTrifold = IconData( + 0xe31a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData markdownLogo = IconData( + 0xe508, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData markerCircle = IconData( + 0xe640, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData martini = IconData( + 0xe31c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData maskHappy = IconData( + 0xe9f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData maskSad = IconData( + 0xeb9e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mastodonLogo = IconData( + 0xed68, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mathOperations = IconData( + 0xe31e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData matrixLogo = IconData( + 0xed64, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData medal = IconData( + 0xe320, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData medalMilitary = IconData( + 0xecfc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mediumLogo = IconData( + 0xe322, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData megaphone = IconData( + 0xe324, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData megaphoneSimple = IconData( + 0xe642, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData memberOf = IconData( + 0xedc2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData memory = IconData( + 0xe9c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData messengerLogo = IconData( + 0xe6d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData metaLogo = IconData( + 0xed02, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData meteor = IconData( + 0xe9ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData metronome = IconData( + 0xec8e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microphone = IconData( + 0xe326, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microphoneSlash = IconData( + 0xe328, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microphoneStage = IconData( + 0xe75c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microscope = IconData( + 0xec7a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftExcelLogo = IconData( + 0xeb6c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftOutlookLogo = IconData( + 0xeb70, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftPowerpointLogo = IconData( + 0xeace, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftTeamsLogo = IconData( + 0xeb66, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftWordLogo = IconData( + 0xeb6a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData minus = IconData( + 0xe32a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData minusCircle = IconData( + 0xe32c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData minusSquare = IconData( + 0xed4c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData money = IconData( + 0xe588, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData moneyWavy = IconData( + 0xee68, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData monitor = IconData( + 0xe32e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData monitorArrowUp = IconData( + 0xe58a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData monitorPlay = IconData( + 0xe58c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData moon = IconData( + 0xe330, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData moonStars = IconData( + 0xe58e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData moped = IconData( + 0xe824, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mopedFront = IconData( + 0xe822, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mosque = IconData( + 0xecee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData motorcycle = IconData( + 0xe80a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mountains = IconData( + 0xe7ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mouse = IconData( + 0xe33a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseLeftClick = IconData( + 0xe334, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseMiddleClick = IconData( + 0xe338, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseRightClick = IconData( + 0xe336, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseScroll = IconData( + 0xe332, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseSimple = IconData( + 0xe644, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNote = IconData( + 0xe33c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNoteSimple = IconData( + 0xe33e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotes = IconData( + 0xe340, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotesMinus = IconData( + 0xee0c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotesPlus = IconData( + 0xeb7c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotesSimple = IconData( + 0xe342, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData navigationArrow = IconData( + 0xeade, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData needle = IconData( + 0xe82e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData network = IconData( + 0xedde, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData networkSlash = IconData( + 0xeddc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData networkX = IconData( + 0xedda, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData newspaper = IconData( + 0xe344, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData newspaperClipping = IconData( + 0xe346, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notEquals = IconData( + 0xeda6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notMemberOf = IconData( + 0xedae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notSubsetOf = IconData( + 0xedb0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notSupersetOf = IconData( + 0xedb2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notches = IconData( + 0xed3a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData note = IconData( + 0xe348, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData noteBlank = IconData( + 0xe34a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notePencil = IconData( + 0xe34c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notebook = IconData( + 0xe34e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notepad = IconData( + 0xe63e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notification = IconData( + 0xe6fa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData notionLogo = IconData( + 0xe9a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData nuclearPlant = IconData( + 0xed7c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleEight = IconData( + 0xe352, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleFive = IconData( + 0xe358, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleFour = IconData( + 0xe35e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleNine = IconData( + 0xe364, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleOne = IconData( + 0xe36a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleSeven = IconData( + 0xe370, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleSix = IconData( + 0xe376, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleThree = IconData( + 0xe37c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleTwo = IconData( + 0xe382, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleZero = IconData( + 0xe388, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberEight = IconData( + 0xe350, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberFive = IconData( + 0xe356, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberFour = IconData( + 0xe35c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberNine = IconData( + 0xe362, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberOne = IconData( + 0xe368, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSeven = IconData( + 0xe36e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSix = IconData( + 0xe374, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareEight = IconData( + 0xe354, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareFive = IconData( + 0xe35a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareFour = IconData( + 0xe360, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareNine = IconData( + 0xe366, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareOne = IconData( + 0xe36c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareSeven = IconData( + 0xe372, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareSix = IconData( + 0xe378, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareThree = IconData( + 0xe37e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareTwo = IconData( + 0xe384, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareZero = IconData( + 0xe38a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberThree = IconData( + 0xe37a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberTwo = IconData( + 0xe380, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numberZero = IconData( + 0xe386, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData numpad = IconData( + 0xe3c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData nut = IconData( + 0xe38c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData nyTimesLogo = IconData( + 0xe646, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData octagon = IconData( + 0xe38e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData officeChair = IconData( + 0xea46, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData onigiri = IconData( + 0xee2c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData openAiLogo = IconData( + 0xe7d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData option = IconData( + 0xe8a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData orange = IconData( + 0xee40, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData orangeSlice = IconData( + 0xed36, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData oven = IconData( + 0xed8c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData package = IconData( + 0xe390, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBrush = IconData( + 0xe6f0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBrushBroad = IconData( + 0xe590, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBrushHousehold = IconData( + 0xe6f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBucket = IconData( + 0xe392, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paintRoller = IconData( + 0xe6f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData palette = IconData( + 0xe6c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData panorama = IconData( + 0xeaa2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pants = IconData( + 0xec88, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paperPlane = IconData( + 0xe394, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paperPlaneRight = IconData( + 0xe396, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paperPlaneTilt = IconData( + 0xe398, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paperclip = IconData( + 0xe39a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paperclipHorizontal = IconData( + 0xe592, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData parachute = IconData( + 0xea7c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paragraph = IconData( + 0xe960, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData parallelogram = IconData( + 0xecc6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData park = IconData( + 0xecb2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData password = IconData( + 0xe752, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData path = IconData( + 0xe39c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData patreonLogo = IconData( + 0xe98a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pause = IconData( + 0xe39e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pauseCircle = IconData( + 0xe3a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pawPrint = IconData( + 0xe648, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData paypalLogo = IconData( + 0xe98c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData peace = IconData( + 0xe3a2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pen = IconData( + 0xe3aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData penNib = IconData( + 0xe3ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData penNibStraight = IconData( + 0xe64a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencil = IconData( + 0xe3ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilCircle = IconData( + 0xe3b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilLine = IconData( + 0xe3b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilRuler = IconData( + 0xe906, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSimple = IconData( + 0xe3b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSimpleLine = IconData( + 0xebc6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSimpleSlash = IconData( + 0xecf6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSlash = IconData( + 0xecf8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pentagon = IconData( + 0xec7e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pentagram = IconData( + 0xec5c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pepper = IconData( + 0xe94a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData percent = IconData( + 0xe3b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData person = IconData( + 0xe3a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personArmsSpread = IconData( + 0xecfe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimple = IconData( + 0xe72e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleBike = IconData( + 0xe734, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleCircle = IconData( + 0xee58, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleHike = IconData( + 0xed54, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleRun = IconData( + 0xe730, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleSki = IconData( + 0xe71c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleSnowboard = IconData( + 0xe71e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleSwim = IconData( + 0xe736, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleTaiChi = IconData( + 0xed5c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleThrow = IconData( + 0xe732, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleWalk = IconData( + 0xe73a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData perspective = IconData( + 0xebe6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phone = IconData( + 0xe3b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneCall = IconData( + 0xe3ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneDisconnect = IconData( + 0xe3bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneIncoming = IconData( + 0xe3be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneList = IconData( + 0xe3cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneOutgoing = IconData( + 0xe3c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phonePause = IconData( + 0xe3ca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phonePlus = IconData( + 0xec56, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneSlash = IconData( + 0xe3c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneTransfer = IconData( + 0xe3c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneX = IconData( + 0xe3c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData phosphorLogo = IconData( + 0xe3ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pi = IconData( + 0xec80, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pianoKeys = IconData( + 0xe9c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData picnicTable = IconData( + 0xee26, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pictureInPicture = IconData( + 0xe64c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData piggyBank = IconData( + 0xea04, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pill = IconData( + 0xe700, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pingPong = IconData( + 0xea42, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pintGlass = IconData( + 0xedd0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pinterestLogo = IconData( + 0xe64e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pinwheel = IconData( + 0xeb9c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pipe = IconData( + 0xed86, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pipeWrench = IconData( + 0xed88, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pixLogo = IconData( + 0xecc2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pizza = IconData( + 0xe796, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData placeholder = IconData( + 0xe650, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData planet = IconData( + 0xe652, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plant = IconData( + 0xebae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData play = IconData( + 0xe3d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData playCircle = IconData( + 0xe3d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData playPause = IconData( + 0xe8be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData playlist = IconData( + 0xe6aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plug = IconData( + 0xe946, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plugCharging = IconData( + 0xeb5c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plugs = IconData( + 0xeb56, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plugsConnected = IconData( + 0xeb5a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plus = IconData( + 0xe3d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plusCircle = IconData( + 0xe3d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plusMinus = IconData( + 0xe3d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData plusSquare = IconData( + 0xed4a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pokerChip = IconData( + 0xe594, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData policeCar = IconData( + 0xec4a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData polygon = IconData( + 0xe6d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData popcorn = IconData( + 0xeb4e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData popsicle = IconData( + 0xebbe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pottedPlant = IconData( + 0xec22, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData power = IconData( + 0xe3da, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData prescription = IconData( + 0xe7a2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData presentation = IconData( + 0xe654, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData presentationChart = IconData( + 0xe656, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData printer = IconData( + 0xe3dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData prohibit = IconData( + 0xe3de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData prohibitInset = IconData( + 0xe3e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData projectorScreen = IconData( + 0xe658, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData projectorScreenChart = IconData( + 0xe65a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pulse = IconData( + 0xe000, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPin = IconData( + 0xe3e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPinSimple = IconData( + 0xe65c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPinSimpleSlash = IconData( + 0xe65e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPinSlash = IconData( + 0xe3e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData puzzlePiece = IconData( + 0xe596, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData qrCode = IconData( + 0xe3e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData question = IconData( + 0xe3e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData questionMark = IconData( + 0xe3e9, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData queue = IconData( + 0xe6ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData quotes = IconData( + 0xe660, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rabbit = IconData( + 0xeac2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData racquet = IconData( + 0xee02, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData radical = IconData( + 0xe3ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData radio = IconData( + 0xe77e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData radioButton = IconData( + 0xeb08, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData radioactive = IconData( + 0xe9dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rainbow = IconData( + 0xe598, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rainbowCloud = IconData( + 0xe59a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ranking = IconData( + 0xed62, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData readCvLogo = IconData( + 0xed0c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData receipt = IconData( + 0xe3ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData receiptX = IconData( + 0xed40, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData record = IconData( + 0xe3ee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rectangle = IconData( + 0xe3f0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rectangleDashed = IconData( + 0xe3f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData recycle = IconData( + 0xe75a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData redditLogo = IconData( + 0xe59c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData repeat = IconData( + 0xe3f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData repeatOnce = IconData( + 0xe3f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData replitLogo = IconData( + 0xeb8a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData resize = IconData( + 0xed6e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rewind = IconData( + 0xe6a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rewindCircle = IconData( + 0xe3fa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData roadHorizon = IconData( + 0xe838, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData robot = IconData( + 0xe762, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rocket = IconData( + 0xe3fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rocketLaunch = IconData( + 0xe3fe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rows = IconData( + 0xe5a2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rowsPlusBottom = IconData( + 0xe59e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rowsPlusTop = IconData( + 0xe5a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rss = IconData( + 0xe400, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rssSimple = IconData( + 0xe402, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData rug = IconData( + 0xea1a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ruler = IconData( + 0xe6b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sailboat = IconData( + 0xe78a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scales = IconData( + 0xe750, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scan = IconData( + 0xebb6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scanSmiley = IconData( + 0xebb4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scissors = IconData( + 0xeae0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scooter = IconData( + 0xe820, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData screencast = IconData( + 0xe404, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData screwdriver = IconData( + 0xe86e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scribble = IconData( + 0xe806, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scribbleLoop = IconData( + 0xe662, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData scroll = IconData( + 0xeb7a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData seal = IconData( + 0xe604, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sealCheck = IconData( + 0xe606, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sealPercent = IconData( + 0xe60a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sealQuestion = IconData( + 0xe608, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sealWarning = IconData( + 0xe60c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData seat = IconData( + 0xeb8e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData seatbelt = IconData( + 0xedfe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData securityCamera = IconData( + 0xeca4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData selection = IconData( + 0xe69a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionAll = IconData( + 0xe746, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionBackground = IconData( + 0xeaf8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionForeground = IconData( + 0xeaf6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionInverse = IconData( + 0xe744, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionPlus = IconData( + 0xe69c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionSlash = IconData( + 0xe69e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shapes = IconData( + 0xec5e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData share = IconData( + 0xe406, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shareFat = IconData( + 0xed52, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shareNetwork = IconData( + 0xe408, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shield = IconData( + 0xe40a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldCheck = IconData( + 0xe40c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldCheckered = IconData( + 0xe708, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldChevron = IconData( + 0xe40e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldPlus = IconData( + 0xe706, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldSlash = IconData( + 0xe410, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldStar = IconData( + 0xec34, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldWarning = IconData( + 0xe412, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shippingContainer = IconData( + 0xe78c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shirtFolded = IconData( + 0xea92, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shootingStar = IconData( + 0xecfa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingBag = IconData( + 0xe416, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingBagOpen = IconData( + 0xe418, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingCart = IconData( + 0xe41e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingCartSimple = IconData( + 0xe420, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shovel = IconData( + 0xe9e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shower = IconData( + 0xe776, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shrimp = IconData( + 0xeab4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shuffle = IconData( + 0xe422, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shuffleAngular = IconData( + 0xe424, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData shuffleSimple = IconData( + 0xe426, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sidebar = IconData( + 0xeab6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sidebarSimple = IconData( + 0xec24, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sigma = IconData( + 0xeab8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData signIn = IconData( + 0xe428, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData signOut = IconData( + 0xe42a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData signature = IconData( + 0xebac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData signpost = IconData( + 0xe89c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData simCard = IconData( + 0xe664, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData siren = IconData( + 0xe9b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sketchLogo = IconData( + 0xe42c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData skipBack = IconData( + 0xe5a4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData skipBackCircle = IconData( + 0xe42e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData skipForward = IconData( + 0xe5a6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData skipForwardCircle = IconData( + 0xe430, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData skull = IconData( + 0xe916, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData skypeLogo = IconData( + 0xe8dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData slackLogo = IconData( + 0xe5a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sliders = IconData( + 0xe432, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData slidersHorizontal = IconData( + 0xe434, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData slideshow = IconData( + 0xed32, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smiley = IconData( + 0xe436, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyAngry = IconData( + 0xec62, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyBlank = IconData( + 0xe438, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyMeh = IconData( + 0xe43a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyMelting = IconData( + 0xee56, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyNervous = IconData( + 0xe43c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileySad = IconData( + 0xe43e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileySticker = IconData( + 0xe440, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyWink = IconData( + 0xe666, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyXEyes = IconData( + 0xe442, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData snapchatLogo = IconData( + 0xe668, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sneaker = IconData( + 0xe80c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sneakerMove = IconData( + 0xed60, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData snowflake = IconData( + 0xe5aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData soccerBall = IconData( + 0xe716, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sock = IconData( + 0xecce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData solarPanel = IconData( + 0xed7a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData solarRoof = IconData( + 0xed7b, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sortAscending = IconData( + 0xe444, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sortDescending = IconData( + 0xe446, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData soundcloudLogo = IconData( + 0xe8de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData spade = IconData( + 0xe448, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sparkle = IconData( + 0xe6a2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerHifi = IconData( + 0xea08, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerHigh = IconData( + 0xe44a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerLow = IconData( + 0xe44c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerNone = IconData( + 0xe44e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleHigh = IconData( + 0xe450, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleLow = IconData( + 0xe452, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleNone = IconData( + 0xe454, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleSlash = IconData( + 0xe456, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleX = IconData( + 0xe458, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSlash = IconData( + 0xe45a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerX = IconData( + 0xe45c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData speedometer = IconData( + 0xee74, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sphere = IconData( + 0xee66, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData spinner = IconData( + 0xe66a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData spinnerBall = IconData( + 0xee28, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData spinnerGap = IconData( + 0xe66c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData spiral = IconData( + 0xe9fa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData splitHorizontal = IconData( + 0xe872, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData splitVertical = IconData( + 0xe876, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData spotifyLogo = IconData( + 0xe66e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sprayBottle = IconData( + 0xe7e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData square = IconData( + 0xe45e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData squareHalf = IconData( + 0xe462, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData squareHalfBottom = IconData( + 0xeb16, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData squareLogo = IconData( + 0xe690, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData squareSplitHorizontal = IconData( + 0xe870, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData squareSplitVertical = IconData( + 0xe874, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData squaresFour = IconData( + 0xe464, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stack = IconData( + 0xe466, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stackMinus = IconData( + 0xedf4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stackOverflowLogo = IconData( + 0xeb78, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stackPlus = IconData( + 0xedf6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stackSimple = IconData( + 0xe468, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stairs = IconData( + 0xe8ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stamp = IconData( + 0xea48, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData standardDefinition = IconData( + 0xea90, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData star = IconData( + 0xe46a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData starAndCrescent = IconData( + 0xecf4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData starFour = IconData( + 0xe6a4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData starHalf = IconData( + 0xe70a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData starOfDavid = IconData( + 0xe89e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData steamLogo = IconData( + 0xead4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData steeringWheel = IconData( + 0xe9ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData steps = IconData( + 0xecbe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stethoscope = IconData( + 0xe7ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sticker = IconData( + 0xe5ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stool = IconData( + 0xea44, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stop = IconData( + 0xe46c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stopCircle = IconData( + 0xe46e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData storefront = IconData( + 0xe470, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData strategy = IconData( + 0xea3a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData stripeLogo = IconData( + 0xe698, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData student = IconData( + 0xe73e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData subsetOf = IconData( + 0xedc0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData subsetProperOf = IconData( + 0xedb6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData subtitles = IconData( + 0xe1a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData subtitlesSlash = IconData( + 0xe1a6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData subtract = IconData( + 0xebd6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData subtractSquare = IconData( + 0xebd4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData subway = IconData( + 0xe498, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData suitcase = IconData( + 0xe5ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData suitcaseRolling = IconData( + 0xe9b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData suitcaseSimple = IconData( + 0xe5b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sun = IconData( + 0xe472, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sunDim = IconData( + 0xe474, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sunHorizon = IconData( + 0xe5b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sunglasses = IconData( + 0xe816, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData supersetOf = IconData( + 0xedb8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData supersetProperOf = IconData( + 0xedb4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData swap = IconData( + 0xe83c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData swatches = IconData( + 0xe5b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData swimmingPool = IconData( + 0xecb6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData sword = IconData( + 0xe5ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData synagogue = IconData( + 0xecec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData syringe = IconData( + 0xe968, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tShirt = IconData( + 0xe670, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData table = IconData( + 0xe476, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tabs = IconData( + 0xe778, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tag = IconData( + 0xe478, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tagChevron = IconData( + 0xe672, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tagSimple = IconData( + 0xe47a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData target = IconData( + 0xe47c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData taxi = IconData( + 0xe902, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData teaBag = IconData( + 0xe8e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData telegramLogo = IconData( + 0xe5bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData television = IconData( + 0xe754, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData televisionSimple = IconData( + 0xeae6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tennisBall = IconData( + 0xe720, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tent = IconData( + 0xe8ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData terminal = IconData( + 0xe47e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData terminalWindow = IconData( + 0xeae8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData testTube = IconData( + 0xe7a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textAUnderline = IconData( + 0xed34, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textAa = IconData( + 0xe6ee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignCenter = IconData( + 0xe480, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignJustify = IconData( + 0xe482, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignLeft = IconData( + 0xe484, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignRight = IconData( + 0xe486, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textB = IconData( + 0xe5be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textBolder = IconData( + 0xe5be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textColumns = IconData( + 0xec96, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textH = IconData( + 0xe6ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textHFive = IconData( + 0xe6c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textHFour = IconData( + 0xe6c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textHOne = IconData( + 0xe6bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textHSix = IconData( + 0xe6c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textHThree = IconData( + 0xe6c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textHTwo = IconData( + 0xe6be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textIndent = IconData( + 0xea1e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textItalic = IconData( + 0xe5c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textOutdent = IconData( + 0xea1c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textStrikethrough = IconData( + 0xe5c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textSubscript = IconData( + 0xec98, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textSuperscript = IconData( + 0xec9a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textT = IconData( + 0xe48a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textTSlash = IconData( + 0xe488, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textUnderline = IconData( + 0xe5c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData textbox = IconData( + 0xeb0a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometer = IconData( + 0xe5c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometerCold = IconData( + 0xe5c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometerHot = IconData( + 0xe5ca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometerSimple = IconData( + 0xe5cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData threadsLogo = IconData( + 0xed9e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData threeD = IconData( + 0xea5a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData thumbsDown = IconData( + 0xe48c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData thumbsUp = IconData( + 0xe48e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData ticket = IconData( + 0xe490, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tidalLogo = IconData( + 0xed1c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tiktokLogo = IconData( + 0xeaf2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tilde = IconData( + 0xeda8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData timer = IconData( + 0xe492, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tipJar = IconData( + 0xe7e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tipi = IconData( + 0xed30, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tire = IconData( + 0xedd2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData toggleLeft = IconData( + 0xe674, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData toggleRight = IconData( + 0xe676, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData toilet = IconData( + 0xe79a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData toiletPaper = IconData( + 0xe79c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData toolbox = IconData( + 0xeca0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tooth = IconData( + 0xe9cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tornado = IconData( + 0xe88c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tote = IconData( + 0xe494, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData toteSimple = IconData( + 0xe678, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData towel = IconData( + 0xede6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tractor = IconData( + 0xec6e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trademark = IconData( + 0xe9f0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trademarkRegistered = IconData( + 0xe3f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trafficCone = IconData( + 0xe9a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trafficSign = IconData( + 0xe67a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trafficSignal = IconData( + 0xe9aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData train = IconData( + 0xe496, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trainRegional = IconData( + 0xe49e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trainSimple = IconData( + 0xe4a0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tram = IconData( + 0xe9ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData translate = IconData( + 0xe4a2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trash = IconData( + 0xe4a6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trashSimple = IconData( + 0xe4a8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tray = IconData( + 0xe4aa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trayArrowDown = IconData( + 0xe010, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trayArrowUp = IconData( + 0xee52, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData treasureChest = IconData( + 0xede2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tree = IconData( + 0xe6da, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData treeEvergreen = IconData( + 0xe6dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData treePalm = IconData( + 0xe91a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData treeStructure = IconData( + 0xe67c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData treeView = IconData( + 0xee48, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trendDown = IconData( + 0xe4ac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trendUp = IconData( + 0xe4ae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData triangle = IconData( + 0xe4b0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData triangleDashed = IconData( + 0xe4b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trolley = IconData( + 0xe5b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trolleySuitcase = IconData( + 0xe5b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData trophy = IconData( + 0xe67e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData truck = IconData( + 0xe4b4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData truckTrailer = IconData( + 0xe4b6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData tumblrLogo = IconData( + 0xe8d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData twitchLogo = IconData( + 0xe5ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData twitterLogo = IconData( + 0xe4ba, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData umbrella = IconData( + 0xe684, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData umbrellaSimple = IconData( + 0xe686, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData union = IconData( + 0xedbe, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData unite = IconData( + 0xe87e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData uniteSquare = IconData( + 0xe878, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData upload = IconData( + 0xe4be, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData uploadSimple = IconData( + 0xe4c0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData usb = IconData( + 0xe956, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData user = IconData( + 0xe4c2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userCheck = IconData( + 0xeafa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircle = IconData( + 0xe4c4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleCheck = IconData( + 0xec38, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleDashed = IconData( + 0xec36, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleGear = IconData( + 0xe4c6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleMinus = IconData( + 0xe4c8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userCirclePlus = IconData( + 0xe4ca, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userFocus = IconData( + 0xe6fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userGear = IconData( + 0xe4cc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userList = IconData( + 0xe73c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userMinus = IconData( + 0xe4ce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userPlus = IconData( + 0xe4d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userRectangle = IconData( + 0xe4d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userSound = IconData( + 0xeca8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userSquare = IconData( + 0xe4d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData userSwitch = IconData( + 0xe756, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData users = IconData( + 0xe4d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData usersFour = IconData( + 0xe68c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData usersThree = IconData( + 0xe68e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData van = IconData( + 0xe826, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData vault = IconData( + 0xe76e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData vectorThree = IconData( + 0xee62, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData vectorTwo = IconData( + 0xee64, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData vibrate = IconData( + 0xe4d8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData video = IconData( + 0xe740, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData videoCamera = IconData( + 0xe4da, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData videoCameraSlash = IconData( + 0xe4dc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData videoConference = IconData( + 0xedce, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData vignette = IconData( + 0xeba2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData vinylRecord = IconData( + 0xecac, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData virtualReality = IconData( + 0xe7b8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData virus = IconData( + 0xe7d6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData visor = IconData( + 0xee2a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData voicemail = IconData( + 0xe4de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData volleyball = IconData( + 0xe726, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wall = IconData( + 0xe688, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wallet = IconData( + 0xe68a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData warehouse = IconData( + 0xecd4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData warning = IconData( + 0xe4e0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData warningCircle = IconData( + 0xe4e2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData warningDiamond = IconData( + 0xe7fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData warningOctagon = IconData( + 0xe4e4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData washingMachine = IconData( + 0xede8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData watch = IconData( + 0xe4e6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData waveSawtooth = IconData( + 0xea9c, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData waveSine = IconData( + 0xea9a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData waveSquare = IconData( + 0xea9e, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData waveTriangle = IconData( + 0xeaa0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData waveform = IconData( + 0xe802, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData waveformSlash = IconData( + 0xe800, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData waves = IconData( + 0xe6de, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData webcam = IconData( + 0xe9b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData webcamSlash = IconData( + 0xecdc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData webhooksLogo = IconData( + 0xecae, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wechatLogo = IconData( + 0xe8d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData whatsappLogo = IconData( + 0xe5d0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wheelchair = IconData( + 0xe4e8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wheelchairMotion = IconData( + 0xe89a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiHigh = IconData( + 0xe4ea, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiLow = IconData( + 0xe4ec, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiMedium = IconData( + 0xe4ee, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiNone = IconData( + 0xe4f0, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiSlash = IconData( + 0xe4f2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiX = IconData( + 0xe4f4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wind = IconData( + 0xe5d2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData windmill = IconData( + 0xe9f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData windowsLogo = IconData( + 0xe692, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wine = IconData( + 0xe6b2, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData wrench = IconData( + 0xe5d4, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData x = IconData( + 0xe4f6, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData xCircle = IconData( + 0xe4f8, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData xLogo = IconData( + 0xe4bc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData xSquare = IconData( + 0xe4fa, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData yarn = IconData( + 0xed9a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData yinYang = IconData( + 0xe92a, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); + static const IconData youtubeLogo = IconData( + 0xe4fc, + fontFamily: 'PhosphorRegular', + fontPackage: 'cutdex_ui', + ); +} + +/// Phosphor Fill icons from the pinned font catalog. +@staticIconProvider +abstract final class PhosphorIconsFill { + static const IconData acorn = IconData( + 0xeb9a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData activity = IconData( + 0xe000, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData addressBook = IconData( + 0xe6f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData addressBookTabs = IconData( + 0xee4e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airTrafficControl = IconData( + 0xecd8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airplane = IconData( + 0xe002, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneInFlight = IconData( + 0xe4fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneLanding = IconData( + 0xe502, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneTakeoff = IconData( + 0xe504, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneTaxiing = IconData( + 0xe500, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airplaneTilt = IconData( + 0xe5d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData airplay = IconData( + 0xe004, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alarm = IconData( + 0xe006, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alien = IconData( + 0xe8a6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignBottom = IconData( + 0xe506, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignBottomSimple = IconData( + 0xeb0c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterHorizontal = IconData( + 0xe50a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterHorizontalSimple = IconData( + 0xeb0e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterVertical = IconData( + 0xe50c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignCenterVerticalSimple = IconData( + 0xeb10, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignLeft = IconData( + 0xe50e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignLeftSimple = IconData( + 0xeaee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignRight = IconData( + 0xe510, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignRightSimple = IconData( + 0xeb12, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignTop = IconData( + 0xe512, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData alignTopSimple = IconData( + 0xeb14, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData amazonLogo = IconData( + 0xe96c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ambulance = IconData( + 0xe572, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData anchor = IconData( + 0xe514, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData anchorSimple = IconData( + 0xe5d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData androidLogo = IconData( + 0xe008, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData angle = IconData( + 0xe7bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData angularLogo = IconData( + 0xeb80, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData aperture = IconData( + 0xe00a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData appStoreLogo = IconData( + 0xe974, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData appWindow = IconData( + 0xe5da, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData appleLogo = IconData( + 0xe516, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData applePodcastsLogo = IconData( + 0xeb96, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData approximateEquals = IconData( + 0xedaa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData archive = IconData( + 0xe00c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData archiveBox = IconData( + 0xe00e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData archiveTray = IconData( + 0xe010, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData armchair = IconData( + 0xe012, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowArcLeft = IconData( + 0xe014, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowArcRight = IconData( + 0xe016, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDoubleUpLeft = IconData( + 0xe03a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDoubleUpRight = IconData( + 0xe03c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDownLeft = IconData( + 0xe018, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendDownRight = IconData( + 0xe01a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendLeftDown = IconData( + 0xe01c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendLeftUp = IconData( + 0xe01e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendRightDown = IconData( + 0xe020, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendRightUp = IconData( + 0xe022, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendUpLeft = IconData( + 0xe024, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowBendUpRight = IconData( + 0xe026, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleDown = IconData( + 0xe028, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleDownLeft = IconData( + 0xe02a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleDownRight = IconData( + 0xe02c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleLeft = IconData( + 0xe05a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleRight = IconData( + 0xe02e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleUp = IconData( + 0xe030, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleUpLeft = IconData( + 0xe032, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCircleUpRight = IconData( + 0xe034, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowClockwise = IconData( + 0xe036, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowCounterClockwise = IconData( + 0xe038, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowDown = IconData( + 0xe03e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowDownLeft = IconData( + 0xe040, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowDownRight = IconData( + 0xe042, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowDownLeft = IconData( + 0xe044, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowDownRight = IconData( + 0xe046, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowLeft = IconData( + 0xe048, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowLeftDown = IconData( + 0xe04a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowLeftUp = IconData( + 0xe04c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowRight = IconData( + 0xe04e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowRightDown = IconData( + 0xe050, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowRightUp = IconData( + 0xe052, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowUpLeft = IconData( + 0xe054, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowElbowUpRight = IconData( + 0xe056, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatDown = IconData( + 0xe518, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLeft = IconData( + 0xe51a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineDown = IconData( + 0xe51c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineLeft = IconData( + 0xe51e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineRight = IconData( + 0xe520, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLineUp = IconData( + 0xe522, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesDown = IconData( + 0xe524, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesLeft = IconData( + 0xe526, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesRight = IconData( + 0xe528, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatLinesUp = IconData( + 0xe52a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatRight = IconData( + 0xe52c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowFatUp = IconData( + 0xe52e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLeft = IconData( + 0xe058, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData arrowLineDown = IconData( + 0xe05c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineDownLeft = IconData( + 0xe05e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineDownRight = IconData( + 0xe060, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineLeft = IconData( + 0xe062, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineRight = IconData( + 0xe064, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineUp = IconData( + 0xe066, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineUpLeft = IconData( + 0xe068, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowLineUpRight = IconData( + 0xe06a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowRight = IconData( + 0xe06c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData arrowSquareDown = IconData( + 0xe06e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareDownLeft = IconData( + 0xe070, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareDownRight = IconData( + 0xe072, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareIn = IconData( + 0xe5dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareLeft = IconData( + 0xe074, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareOut = IconData( + 0xe5de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareRight = IconData( + 0xe076, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareUp = IconData( + 0xe078, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareUpLeft = IconData( + 0xe07a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowSquareUpRight = IconData( + 0xe07c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUDownLeft = IconData( + 0xe07e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUDownRight = IconData( + 0xe080, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowULeftDown = IconData( + 0xe082, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowULeftUp = IconData( + 0xe084, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowURightDown = IconData( + 0xe086, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowURightUp = IconData( + 0xe088, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUUpLeft = IconData( + 0xe08a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUUpRight = IconData( + 0xe08c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUp = IconData( + 0xe08e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUpLeft = IconData( + 0xe090, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowUpRight = IconData( + 0xe092, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsClockwise = IconData( + 0xe094, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsCounterClockwise = IconData( + 0xe096, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsDownUp = IconData( + 0xe098, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsHorizontal = IconData( + 0xeb06, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsIn = IconData( + 0xe09a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInCardinal = IconData( + 0xe09c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInLineHorizontal = IconData( + 0xe530, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInLineVertical = IconData( + 0xe532, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsInSimple = IconData( + 0xe09e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsLeftRight = IconData( + 0xe0a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsMerge = IconData( + 0xed3e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOut = IconData( + 0xe0a2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutCardinal = IconData( + 0xe0a4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutLineHorizontal = IconData( + 0xe534, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutLineVertical = IconData( + 0xe536, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsOutSimple = IconData( + 0xe0a6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsSplit = IconData( + 0xed3c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData arrowsVertical = IconData( + 0xeb04, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData article = IconData( + 0xe0a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData articleMedium = IconData( + 0xe5e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData articleNyTimes = IconData( + 0xe5e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData asclepius = IconData( + 0xee34, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData asterisk = IconData( + 0xe0aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData asteriskSimple = IconData( + 0xe832, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData at = IconData( + 0xe0ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData atom = IconData( + 0xe5e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData avocado = IconData( + 0xee04, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData axe = IconData( + 0xe9fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData baby = IconData( + 0xe774, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData babyCarriage = IconData( + 0xe818, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData backpack = IconData( + 0xe922, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData backspace = IconData( + 0xe0ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bag = IconData( + 0xe0b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bagSimple = IconData( + 0xe5e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData balloon = IconData( + 0xe76c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bandaids = IconData( + 0xe0b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bank = IconData( + 0xe0b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData barbell = IconData( + 0xe0b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData barcode = IconData( + 0xe0b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData barn = IconData( + 0xec72, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData barricade = IconData( + 0xe948, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData baseball = IconData( + 0xe71a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData baseballCap = IconData( + 0xea28, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData baseballHelmet = IconData( + 0xee4a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData basket = IconData( + 0xe964, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData basketball = IconData( + 0xe724, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bathtub = IconData( + 0xe81e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryCharging = IconData( + 0xe0ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryChargingVertical = IconData( + 0xe0bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryEmpty = IconData( + 0xe0be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryFull = IconData( + 0xe0c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryHigh = IconData( + 0xe0c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryLow = IconData( + 0xe0c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryMedium = IconData( + 0xe0c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryPlus = IconData( + 0xe808, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryPlusVertical = IconData( + 0xec50, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalEmpty = IconData( + 0xe7c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalFull = IconData( + 0xe7c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalHigh = IconData( + 0xe7c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalLow = IconData( + 0xe7be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryVerticalMedium = IconData( + 0xe7c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryWarning = IconData( + 0xe0c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData batteryWarningVertical = IconData( + 0xe0ca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData beachBall = IconData( + 0xed24, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData beanie = IconData( + 0xea2a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bed = IconData( + 0xe0cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData beerBottle = IconData( + 0xe7b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData beerStein = IconData( + 0xeb62, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData behanceLogo = IconData( + 0xe7f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bell = IconData( + 0xe0ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bellRinging = IconData( + 0xe5e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimple = IconData( + 0xe0d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimpleRinging = IconData( + 0xe5ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimpleSlash = IconData( + 0xe0d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSimpleZ = IconData( + 0xe5ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bellSlash = IconData( + 0xe0d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bellZ = IconData( + 0xe5ee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData belt = IconData( + 0xea2c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bezierCurve = IconData( + 0xeb00, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bicycle = IconData( + 0xe0d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData binary = IconData( + 0xee60, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData binoculars = IconData( + 0xea64, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData biohazard = IconData( + 0xe9e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bird = IconData( + 0xe72c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData blueprint = IconData( + 0xeda0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetooth = IconData( + 0xe0da, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetoothConnected = IconData( + 0xe0dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetoothSlash = IconData( + 0xe0de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bluetoothX = IconData( + 0xe0e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData boat = IconData( + 0xe786, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bomb = IconData( + 0xee0a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bone = IconData( + 0xe7f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData book = IconData( + 0xe0e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookBookmark = IconData( + 0xe0e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookOpen = IconData( + 0xe0e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookOpenText = IconData( + 0xe8f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookOpenUser = IconData( + 0xede0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmark = IconData( + 0xe0e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmarkSimple = IconData( + 0xe0ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmarks = IconData( + 0xe0ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bookmarksSimple = IconData( + 0xe5f0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData books = IconData( + 0xe758, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData boot = IconData( + 0xecca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData boules = IconData( + 0xe722, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData boundingBox = IconData( + 0xe6ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bowlFood = IconData( + 0xeaa4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bowlSteam = IconData( + 0xe8e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bowlingBall = IconData( + 0xea34, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData boxArrowDown = IconData( + 0xe00e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData boxArrowUp = IconData( + 0xee54, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData boxingGlove = IconData( + 0xea36, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsAngle = IconData( + 0xe862, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsCurly = IconData( + 0xe860, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsRound = IconData( + 0xe864, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bracketsSquare = IconData( + 0xe85e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData brain = IconData( + 0xe74e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData brandy = IconData( + 0xe6b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bread = IconData( + 0xe81c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bridge = IconData( + 0xea68, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData briefcase = IconData( + 0xe0ee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData briefcaseMetal = IconData( + 0xe5f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData broadcast = IconData( + 0xe0f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData broom = IconData( + 0xec54, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData browser = IconData( + 0xe0f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData browsers = IconData( + 0xe0f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bug = IconData( + 0xe5f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bugBeetle = IconData( + 0xe5f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bugDroid = IconData( + 0xe5f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData building = IconData( + 0xe100, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData buildingApartment = IconData( + 0xe0fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData buildingOffice = IconData( + 0xe0ff, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData buildings = IconData( + 0xe102, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bulldozer = IconData( + 0xec6c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData bus = IconData( + 0xe106, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData butterfly = IconData( + 0xea6e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cableCar = IconData( + 0xe49c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cactus = IconData( + 0xe918, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caduceus = IconData( + 0xee34, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cake = IconData( + 0xe780, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calculator = IconData( + 0xe538, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendar = IconData( + 0xe108, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarBlank = IconData( + 0xe10a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarCheck = IconData( + 0xe712, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarDot = IconData( + 0xe7b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarDots = IconData( + 0xe7b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarHeart = IconData( + 0xe8b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarMinus = IconData( + 0xea14, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarPlus = IconData( + 0xe714, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarSlash = IconData( + 0xea12, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarStar = IconData( + 0xe8b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData calendarX = IconData( + 0xe10c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData callBell = IconData( + 0xe7de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData camera = IconData( + 0xe10e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cameraPlus = IconData( + 0xec58, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cameraRotate = IconData( + 0xe7a4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cameraSlash = IconData( + 0xe110, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData campfire = IconData( + 0xe9d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData car = IconData( + 0xe112, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData carBattery = IconData( + 0xee30, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData carProfile = IconData( + 0xe8cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData carSimple = IconData( + 0xe114, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cardholder = IconData( + 0xe5fa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cards = IconData( + 0xe0f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cardsThree = IconData( + 0xee50, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleDown = IconData( + 0xe116, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleLeft = IconData( + 0xe118, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleRight = IconData( + 0xe11a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDoubleUp = IconData( + 0xe11c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleDown = IconData( + 0xe11e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleLeft = IconData( + 0xe120, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleRight = IconData( + 0xe122, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleUp = IconData( + 0xe124, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretCircleUpDown = IconData( + 0xe13e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretDoubleDown = IconData( + 0xe126, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretDoubleLeft = IconData( + 0xe128, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretDoubleRight = IconData( + 0xe12a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretDoubleUp = IconData( + 0xe12c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretDown = IconData( + 0xe136, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLeft = IconData( + 0xe138, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretLineDown = IconData( + 0xe134, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLineLeft = IconData( + 0xe132, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLineRight = IconData( + 0xe130, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretLineUp = IconData( + 0xe12e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretRight = IconData( + 0xe13a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + matchTextDirection: true, + ); + static const IconData caretUp = IconData( + 0xe13c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData caretUpDown = IconData( + 0xe140, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData carrot = IconData( + 0xed38, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cashRegister = IconData( + 0xed80, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cassetteTape = IconData( + 0xed2e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData castleTurret = IconData( + 0xe9d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cat = IconData( + 0xe748, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalFull = IconData( + 0xe142, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalHigh = IconData( + 0xe144, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalLow = IconData( + 0xe146, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalMedium = IconData( + 0xe148, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalNone = IconData( + 0xe14a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalSlash = IconData( + 0xe14c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellSignalX = IconData( + 0xe14e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cellTower = IconData( + 0xebaa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData certificate = IconData( + 0xe766, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chair = IconData( + 0xe950, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chalkboard = IconData( + 0xe5fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chalkboardSimple = IconData( + 0xe5fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chalkboardTeacher = IconData( + 0xe600, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData champagne = IconData( + 0xeaca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chargingStation = IconData( + 0xe8d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartBar = IconData( + 0xe150, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartBarHorizontal = IconData( + 0xe152, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartDonut = IconData( + 0xeaa6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartLine = IconData( + 0xe154, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartLineDown = IconData( + 0xe8b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartLineUp = IconData( + 0xe156, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartPie = IconData( + 0xe158, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartPieSlice = IconData( + 0xe15a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartPolar = IconData( + 0xeaa8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chartScatter = IconData( + 0xeaac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chat = IconData( + 0xe15c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCentered = IconData( + 0xe160, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCenteredDots = IconData( + 0xe164, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCenteredSlash = IconData( + 0xe162, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCenteredText = IconData( + 0xe166, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircle = IconData( + 0xe168, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircleDots = IconData( + 0xe16c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircleSlash = IconData( + 0xe16a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatCircleText = IconData( + 0xe16e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatDots = IconData( + 0xe170, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatSlash = IconData( + 0xe15e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardrop = IconData( + 0xe172, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardropDots = IconData( + 0xe176, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardropSlash = IconData( + 0xe174, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatTeardropText = IconData( + 0xe178, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatText = IconData( + 0xe17a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chats = IconData( + 0xe17c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatsCircle = IconData( + 0xe17e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chatsTeardrop = IconData( + 0xe180, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData check = IconData( + 0xe182, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData checkCircle = IconData( + 0xe184, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData checkFat = IconData( + 0xeba6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData checkSquare = IconData( + 0xe186, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData checkSquareOffset = IconData( + 0xe188, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData checkerboard = IconData( + 0xe8c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData checks = IconData( + 0xe53a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cheers = IconData( + 0xea4a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cheese = IconData( + 0xe9fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData chefHat = IconData( + 0xed8e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cherries = IconData( + 0xe830, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData church = IconData( + 0xecea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cigarette = IconData( + 0xed90, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cigaretteSlash = IconData( + 0xed92, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circle = IconData( + 0xe18a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleDashed = IconData( + 0xe602, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleHalf = IconData( + 0xe18c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleHalfTilt = IconData( + 0xe18e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleNotch = IconData( + 0xeb44, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavy = IconData( + 0xe604, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavyCheck = IconData( + 0xe606, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavyQuestion = IconData( + 0xe608, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circleWavyWarning = IconData( + 0xe60c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circlesFour = IconData( + 0xe190, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circlesThree = IconData( + 0xe192, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circlesThreePlus = IconData( + 0xe194, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData circuitry = IconData( + 0xe9c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData city = IconData( + 0xea6a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clipboard = IconData( + 0xe196, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clipboardText = IconData( + 0xe198, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clock = IconData( + 0xe19a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clockAfternoon = IconData( + 0xe19c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clockClockwise = IconData( + 0xe19e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clockCountdown = IconData( + 0xed2c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clockCounterClockwise = IconData( + 0xe1a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clockUser = IconData( + 0xedec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData closedCaptioning = IconData( + 0xe1a4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloud = IconData( + 0xe1aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudArrowDown = IconData( + 0xe1ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudArrowUp = IconData( + 0xe1ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudCheck = IconData( + 0xe1b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudFog = IconData( + 0xe53c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudLightning = IconData( + 0xe1b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudMoon = IconData( + 0xe53e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudRain = IconData( + 0xe1b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudSlash = IconData( + 0xe1b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudSnow = IconData( + 0xe1b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudSun = IconData( + 0xe540, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudWarning = IconData( + 0xea98, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cloudX = IconData( + 0xea96, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData clover = IconData( + 0xedc8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData club = IconData( + 0xe1ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData coatHanger = IconData( + 0xe7fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData codaLogo = IconData( + 0xe7ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData code = IconData( + 0xe1bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData codeBlock = IconData( + 0xeafe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData codeSimple = IconData( + 0xe1be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData codepenLogo = IconData( + 0xe978, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData codesandboxLogo = IconData( + 0xea06, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData coffee = IconData( + 0xe1c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData coffeeBean = IconData( + 0xe1c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData coin = IconData( + 0xe60e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData coinVertical = IconData( + 0xeb48, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData coins = IconData( + 0xe78e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData columns = IconData( + 0xe546, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData columnsPlusLeft = IconData( + 0xe544, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData columnsPlusRight = IconData( + 0xe542, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData command = IconData( + 0xe1c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData compass = IconData( + 0xe1c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData compassRose = IconData( + 0xe1c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData compassTool = IconData( + 0xea0e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData computerTower = IconData( + 0xe548, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData confetti = IconData( + 0xe81a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData contactlessPayment = IconData( + 0xed42, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData control = IconData( + 0xeca6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cookie = IconData( + 0xe6ca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cookingPot = IconData( + 0xe764, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData copy = IconData( + 0xe1ca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData copySimple = IconData( + 0xe1cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData copyleft = IconData( + 0xe86a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData copyright = IconData( + 0xe54a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cornersIn = IconData( + 0xe1ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cornersOut = IconData( + 0xe1d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData couch = IconData( + 0xe7f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData courtBasketball = IconData( + 0xee36, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cow = IconData( + 0xeabe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cowboyHat = IconData( + 0xed12, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cpu = IconData( + 0xe610, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData crane = IconData( + 0xed48, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData craneTower = IconData( + 0xed49, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData creditCard = IconData( + 0xe1d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cricket = IconData( + 0xee12, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData crop = IconData( + 0xe1d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cross = IconData( + 0xe8a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData crosshair = IconData( + 0xe1d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData crosshairSimple = IconData( + 0xe1d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData crown = IconData( + 0xe614, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData crownCross = IconData( + 0xee5e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData crownSimple = IconData( + 0xe616, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cube = IconData( + 0xe1da, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cubeFocus = IconData( + 0xed0a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cubeTransparent = IconData( + 0xec7c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyBtc = IconData( + 0xe618, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyCircleDollar = IconData( + 0xe54c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyCny = IconData( + 0xe54e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyDollar = IconData( + 0xe550, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyDollarSimple = IconData( + 0xe552, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyEth = IconData( + 0xeada, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyEur = IconData( + 0xe554, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyGbp = IconData( + 0xe556, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyInr = IconData( + 0xe558, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyJpy = IconData( + 0xe55a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyKrw = IconData( + 0xe55c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyKzt = IconData( + 0xec4c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyNgn = IconData( + 0xeb52, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData currencyRub = IconData( + 0xe55e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cursor = IconData( + 0xe1dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cursorClick = IconData( + 0xe7c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cursorText = IconData( + 0xe7d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData cylinder = IconData( + 0xe8fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData database = IconData( + 0xe1de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData desk = IconData( + 0xed16, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData desktop = IconData( + 0xe560, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData desktopTower = IconData( + 0xe562, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData detective = IconData( + 0xe83e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData devToLogo = IconData( + 0xed0e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobile = IconData( + 0xe1e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobileCamera = IconData( + 0xe1e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobileSlash = IconData( + 0xee46, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceMobileSpeaker = IconData( + 0xe1e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceRotate = IconData( + 0xedf2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceTablet = IconData( + 0xe1e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceTabletCamera = IconData( + 0xe1e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData deviceTabletSpeaker = IconData( + 0xe1ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData devices = IconData( + 0xeba4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diamond = IconData( + 0xe1ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diamondsFour = IconData( + 0xe8f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diceFive = IconData( + 0xe1ee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diceFour = IconData( + 0xe1f0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diceOne = IconData( + 0xe1f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diceSix = IconData( + 0xe1f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diceThree = IconData( + 0xe1f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData diceTwo = IconData( + 0xe1f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData disc = IconData( + 0xe564, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData discoBall = IconData( + 0xed98, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData discordLogo = IconData( + 0xe61a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData divide = IconData( + 0xe1fa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dna = IconData( + 0xe924, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dog = IconData( + 0xe74a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData door = IconData( + 0xe61c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData doorOpen = IconData( + 0xe7e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dot = IconData( + 0xecde, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotOutline = IconData( + 0xece0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsNine = IconData( + 0xe1fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsSix = IconData( + 0xe794, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsSixVertical = IconData( + 0xeae2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThree = IconData( + 0xe1fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeCircle = IconData( + 0xe200, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeCircleVertical = IconData( + 0xe202, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeOutline = IconData( + 0xe204, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeOutlineVertical = IconData( + 0xe206, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dotsThreeVertical = IconData( + 0xe208, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData download = IconData( + 0xe20a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData downloadSimple = IconData( + 0xe20c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dress = IconData( + 0xea7e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dresser = IconData( + 0xe94e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dribbbleLogo = IconData( + 0xe20e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData drone = IconData( + 0xed74, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData drop = IconData( + 0xe210, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dropHalf = IconData( + 0xe566, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dropHalfBottom = IconData( + 0xeb40, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dropSimple = IconData( + 0xee32, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dropSlash = IconData( + 0xe954, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData dropboxLogo = IconData( + 0xe7d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ear = IconData( + 0xe70c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData earSlash = IconData( + 0xe70e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData egg = IconData( + 0xe812, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eggCrack = IconData( + 0xeb64, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eject = IconData( + 0xe212, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ejectSimple = IconData( + 0xe6ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData elevator = IconData( + 0xecc0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData empty = IconData( + 0xedbc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData engine = IconData( + 0xea80, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData envelope = IconData( + 0xe214, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData envelopeOpen = IconData( + 0xe216, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData envelopeSimple = IconData( + 0xe218, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData envelopeSimpleOpen = IconData( + 0xe21a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData equalizer = IconData( + 0xebbc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData equals = IconData( + 0xe21c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eraser = IconData( + 0xe21e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData escalatorDown = IconData( + 0xecba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData escalatorUp = IconData( + 0xecbc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData exam = IconData( + 0xe742, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData exclamationMark = IconData( + 0xee44, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData exclude = IconData( + 0xe882, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData excludeSquare = IconData( + 0xe880, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData export = IconData( + 0xeaf0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eye = IconData( + 0xe220, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eyeClosed = IconData( + 0xe222, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eyeSlash = IconData( + 0xe224, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eyedropper = IconData( + 0xe568, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eyedropperSample = IconData( + 0xeac4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eyeglasses = IconData( + 0xe7ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData eyes = IconData( + 0xee5c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData faceMask = IconData( + 0xe56a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData facebookLogo = IconData( + 0xe226, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData factory = IconData( + 0xe760, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData faders = IconData( + 0xe228, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fadersHorizontal = IconData( + 0xe22a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData falloutShelter = IconData( + 0xe9de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fan = IconData( + 0xe9f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData farm = IconData( + 0xec70, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fastForward = IconData( + 0xe6a6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fastForwardCircle = IconData( + 0xe22c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData feather = IconData( + 0xe9c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fediverseLogo = IconData( + 0xed66, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData figmaLogo = IconData( + 0xe22e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData file = IconData( + 0xe230, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileArchive = IconData( + 0xeb2a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileArrowDown = IconData( + 0xe232, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileArrowUp = IconData( + 0xe61e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileAudio = IconData( + 0xea20, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileC = IconData( + 0xeb32, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCSharp = IconData( + 0xeb30, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCloud = IconData( + 0xe95e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCode = IconData( + 0xe914, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCpp = IconData( + 0xeb2e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCss = IconData( + 0xeb34, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileCsv = IconData( + 0xeb1c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileDashed = IconData( + 0xe704, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileDoc = IconData( + 0xeb1e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileDotted = IconData( + 0xe704, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileHtml = IconData( + 0xeb38, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileImage = IconData( + 0xea24, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileIni = IconData( + 0xeb33, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileJpg = IconData( + 0xeb1a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileJs = IconData( + 0xeb24, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileJsx = IconData( + 0xeb3a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileLock = IconData( + 0xe95c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileMagnifyingGlass = IconData( + 0xe238, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileMd = IconData( + 0xed50, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileMinus = IconData( + 0xe234, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filePdf = IconData( + 0xe702, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filePlus = IconData( + 0xe236, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filePng = IconData( + 0xeb18, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filePpt = IconData( + 0xeb20, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filePy = IconData( + 0xeb2c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileRs = IconData( + 0xeb28, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileSearch = IconData( + 0xe238, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileSql = IconData( + 0xed4e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileSvg = IconData( + 0xed08, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileText = IconData( + 0xe23a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileTs = IconData( + 0xeb26, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileTsx = IconData( + 0xeb3c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileTxt = IconData( + 0xeb35, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileVideo = IconData( + 0xea22, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileVue = IconData( + 0xeb3e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileX = IconData( + 0xe23c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileXls = IconData( + 0xeb22, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fileZip = IconData( + 0xe958, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData files = IconData( + 0xe710, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filmReel = IconData( + 0xe8c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filmScript = IconData( + 0xeb50, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filmSlate = IconData( + 0xe8c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData filmStrip = IconData( + 0xe792, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fingerprint = IconData( + 0xe23e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fingerprintSimple = IconData( + 0xe240, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData finnTheHuman = IconData( + 0xe56c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fire = IconData( + 0xe242, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fireExtinguisher = IconData( + 0xe9e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fireSimple = IconData( + 0xe620, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fireTruck = IconData( + 0xe574, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData firstAid = IconData( + 0xe56e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData firstAidKit = IconData( + 0xe570, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fish = IconData( + 0xe728, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fishSimple = IconData( + 0xe72a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flag = IconData( + 0xe244, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flagBanner = IconData( + 0xe622, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flagBannerFold = IconData( + 0xecf2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flagCheckered = IconData( + 0xea38, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flagPennant = IconData( + 0xecf0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flame = IconData( + 0xe624, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flashlight = IconData( + 0xe246, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flask = IconData( + 0xe79e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flipHorizontal = IconData( + 0xed6a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flipVertical = IconData( + 0xed6c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData floppyDisk = IconData( + 0xe248, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData floppyDiskBack = IconData( + 0xeaf4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flowArrow = IconData( + 0xe6ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flower = IconData( + 0xe75e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flowerLotus = IconData( + 0xe6cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flowerTulip = IconData( + 0xeacc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData flyingSaucer = IconData( + 0xeb4a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folder = IconData( + 0xe24a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderDashed = IconData( + 0xe8f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderDotted = IconData( + 0xe8f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderLock = IconData( + 0xea3c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderMinus = IconData( + 0xe254, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotch = IconData( + 0xe24a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotchMinus = IconData( + 0xe254, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotchOpen = IconData( + 0xe256, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderNotchPlus = IconData( + 0xe258, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderOpen = IconData( + 0xe256, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderPlus = IconData( + 0xe258, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimple = IconData( + 0xe25a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleDashed = IconData( + 0xec2a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleDotted = IconData( + 0xec2a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleLock = IconData( + 0xeb5e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleMinus = IconData( + 0xe25c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimplePlus = IconData( + 0xe25e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleStar = IconData( + 0xec2e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderSimpleUser = IconData( + 0xeb60, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderStar = IconData( + 0xea86, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folderUser = IconData( + 0xeb46, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData folders = IconData( + 0xe260, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData football = IconData( + 0xe718, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData footballHelmet = IconData( + 0xee4c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData footprints = IconData( + 0xea88, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData forkKnife = IconData( + 0xe262, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData fourK = IconData( + 0xea5c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData frameCorners = IconData( + 0xe626, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData framerLogo = IconData( + 0xe264, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData function = IconData( + 0xebe4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData funnel = IconData( + 0xe266, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData funnelSimple = IconData( + 0xe268, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData funnelSimpleX = IconData( + 0xe26a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData funnelX = IconData( + 0xe26c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gameController = IconData( + 0xe26e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData garage = IconData( + 0xecd6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gasCan = IconData( + 0xe8ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gasPump = IconData( + 0xe768, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gauge = IconData( + 0xe628, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gavel = IconData( + 0xea32, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gear = IconData( + 0xe270, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gearFine = IconData( + 0xe87c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gearSix = IconData( + 0xe272, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData genderFemale = IconData( + 0xe6e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData genderIntersex = IconData( + 0xe6e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData genderMale = IconData( + 0xe6e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData genderNeuter = IconData( + 0xe6ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData genderNonbinary = IconData( + 0xe6e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData genderTransgender = IconData( + 0xe6e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ghost = IconData( + 0xe62a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gif = IconData( + 0xe274, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gift = IconData( + 0xe276, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitBranch = IconData( + 0xe278, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitCommit = IconData( + 0xe27a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitDiff = IconData( + 0xe27c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitFork = IconData( + 0xe27e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitMerge = IconData( + 0xe280, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitPullRequest = IconData( + 0xe282, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData githubLogo = IconData( + 0xe576, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitlabLogo = IconData( + 0xe694, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gitlabLogoSimple = IconData( + 0xe696, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData globe = IconData( + 0xe288, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData globeHemisphereEast = IconData( + 0xe28a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData globeHemisphereWest = IconData( + 0xe28c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData globeSimple = IconData( + 0xe28e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData globeSimpleX = IconData( + 0xe284, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData globeStand = IconData( + 0xe290, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData globeX = IconData( + 0xe286, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData goggles = IconData( + 0xecb4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData golf = IconData( + 0xea3e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData goodreadsLogo = IconData( + 0xed10, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData googleCardboardLogo = IconData( + 0xe7b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData googleChromeLogo = IconData( + 0xe976, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData googleDriveLogo = IconData( + 0xe8f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData googleLogo = IconData( + 0xe292, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData googlePhotosLogo = IconData( + 0xeb92, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData googlePlayLogo = IconData( + 0xe294, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData googlePodcastsLogo = IconData( + 0xeb94, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gps = IconData( + 0xedd8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gpsFix = IconData( + 0xedd6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gpsSlash = IconData( + 0xedd4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gradient = IconData( + 0xeb42, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData graduationCap = IconData( + 0xe62c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData grains = IconData( + 0xec68, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData grainsSlash = IconData( + 0xec6a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData graph = IconData( + 0xeb58, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData graphicsCard = IconData( + 0xe612, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData greaterThan = IconData( + 0xedc4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData greaterThanOrEqual = IconData( + 0xeda2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gridFour = IconData( + 0xe296, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData gridNine = IconData( + 0xec8c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData guitar = IconData( + 0xea8a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hairDryer = IconData( + 0xea66, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hamburger = IconData( + 0xe790, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hammer = IconData( + 0xe80e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hand = IconData( + 0xe298, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handArrowDown = IconData( + 0xea4e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handArrowUp = IconData( + 0xee5a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handCoins = IconData( + 0xea8c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handDeposit = IconData( + 0xee82, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handEye = IconData( + 0xea4c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handFist = IconData( + 0xe57a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handGrabbing = IconData( + 0xe57c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handHeart = IconData( + 0xe810, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handPalm = IconData( + 0xe57e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handPeace = IconData( + 0xe7cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handPointing = IconData( + 0xe29a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handSoap = IconData( + 0xe630, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handSwipeLeft = IconData( + 0xec94, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handSwipeRight = IconData( + 0xec92, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handTap = IconData( + 0xec90, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handWaving = IconData( + 0xe580, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handWithdraw = IconData( + 0xee80, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handbag = IconData( + 0xe29c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handbagSimple = IconData( + 0xe62e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handsClapping = IconData( + 0xe6a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handsPraying = IconData( + 0xecc8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData handshake = IconData( + 0xe582, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hardDrive = IconData( + 0xe29e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hardDrives = IconData( + 0xe2a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hardHat = IconData( + 0xed46, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hash = IconData( + 0xe2a2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hashStraight = IconData( + 0xe2a4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData headCircuit = IconData( + 0xe7d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData headlights = IconData( + 0xe6fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData headphones = IconData( + 0xe2a6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData headset = IconData( + 0xe584, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData heart = IconData( + 0xe2a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData heartBreak = IconData( + 0xebe8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData heartHalf = IconData( + 0xec48, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData heartStraight = IconData( + 0xe2aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData heartStraightBreak = IconData( + 0xeb98, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData heartbeat = IconData( + 0xe2ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hexagon = IconData( + 0xe2ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData highDefinition = IconData( + 0xea8e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData highHeel = IconData( + 0xe8e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData highlighter = IconData( + 0xec76, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData highlighterCircle = IconData( + 0xe632, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hockey = IconData( + 0xec86, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hoodie = IconData( + 0xecd0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData horse = IconData( + 0xe2b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hospital = IconData( + 0xe844, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglass = IconData( + 0xe2b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassHigh = IconData( + 0xe2b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassLow = IconData( + 0xe2b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassMedium = IconData( + 0xe2b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimple = IconData( + 0xe2ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimpleHigh = IconData( + 0xe2bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimpleLow = IconData( + 0xe2be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hourglassSimpleMedium = IconData( + 0xe2c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData house = IconData( + 0xe2c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData houseLine = IconData( + 0xe2c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData houseSimple = IconData( + 0xe2c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData hurricane = IconData( + 0xe88e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData iceCream = IconData( + 0xe804, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData identificationBadge = IconData( + 0xe6f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData identificationCard = IconData( + 0xe2c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData image = IconData( + 0xe2ca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData imageBroken = IconData( + 0xe7a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData imageSquare = IconData( + 0xe2cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData images = IconData( + 0xe836, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData imagesSquare = IconData( + 0xe834, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData infinity = IconData( + 0xe634, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData info = IconData( + 0xe2ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData instagramLogo = IconData( + 0xe2d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData intersect = IconData( + 0xe2d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData intersectSquare = IconData( + 0xe87a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData intersectThree = IconData( + 0xecc4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData intersection = IconData( + 0xedba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData invoice = IconData( + 0xee42, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData island = IconData( + 0xee06, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData jar = IconData( + 0xe7e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData jarLabel = IconData( + 0xe7e1, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData jeep = IconData( + 0xe2d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData joystick = IconData( + 0xea5e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData kanban = IconData( + 0xeb54, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData key = IconData( + 0xe2d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData keyReturn = IconData( + 0xe782, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData keyboard = IconData( + 0xe2d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData keyhole = IconData( + 0xea78, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData knife = IconData( + 0xe636, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ladder = IconData( + 0xe9e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ladderSimple = IconData( + 0xec26, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lamp = IconData( + 0xe638, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lampPendant = IconData( + 0xee2e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData laptop = IconData( + 0xe586, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lasso = IconData( + 0xedc6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lastfmLogo = IconData( + 0xe842, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData layout = IconData( + 0xe6d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData leaf = IconData( + 0xe2da, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lectern = IconData( + 0xe95a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lego = IconData( + 0xe8c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData legoSmiley = IconData( + 0xe8c7, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lemniscate = IconData( + 0xe634, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lessThan = IconData( + 0xedac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lessThanOrEqual = IconData( + 0xeda4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData letterCircleH = IconData( + 0xebf8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData letterCircleP = IconData( + 0xec08, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData letterCircleV = IconData( + 0xec14, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lifebuoy = IconData( + 0xe63a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lightbulb = IconData( + 0xe2dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lightbulbFilament = IconData( + 0xe63c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lighthouse = IconData( + 0xe9f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lightning = IconData( + 0xe2de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lightningA = IconData( + 0xea84, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lightningSlash = IconData( + 0xe2e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lineSegment = IconData( + 0xe6d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lineSegments = IconData( + 0xe6d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lineVertical = IconData( + 0xed70, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData link = IconData( + 0xe2e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linkBreak = IconData( + 0xe2e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimple = IconData( + 0xe2e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimpleBreak = IconData( + 0xe2e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimpleHorizontal = IconData( + 0xe2ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linkSimpleHorizontalBreak = IconData( + 0xe2ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linkedinLogo = IconData( + 0xe2ee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linktreeLogo = IconData( + 0xedee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData linuxLogo = IconData( + 0xeb02, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData list = IconData( + 0xe2f0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listBullets = IconData( + 0xe2f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listChecks = IconData( + 0xeadc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listDashes = IconData( + 0xe2f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listHeart = IconData( + 0xebde, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listMagnifyingGlass = IconData( + 0xebe0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listNumbers = IconData( + 0xe2f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listPlus = IconData( + 0xe2f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData listStar = IconData( + 0xebdc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lock = IconData( + 0xe2fa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockKey = IconData( + 0xe2fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockKeyOpen = IconData( + 0xe300, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockLaminated = IconData( + 0xe302, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockLaminatedOpen = IconData( + 0xe304, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockOpen = IconData( + 0xe306, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockSimple = IconData( + 0xe308, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockSimpleOpen = IconData( + 0xe30a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData lockers = IconData( + 0xecb8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData log = IconData( + 0xed82, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData magicWand = IconData( + 0xe6b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData magnet = IconData( + 0xe680, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData magnetStraight = IconData( + 0xe682, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData magnifyingGlass = IconData( + 0xe30c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData magnifyingGlassMinus = IconData( + 0xe30e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData magnifyingGlassPlus = IconData( + 0xe310, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mailbox = IconData( + 0xec1e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPin = IconData( + 0xe316, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinArea = IconData( + 0xee3a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinLine = IconData( + 0xe318, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinPlus = IconData( + 0xe314, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinSimple = IconData( + 0xee3e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinSimpleArea = IconData( + 0xee3c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapPinSimpleLine = IconData( + 0xee38, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mapTrifold = IconData( + 0xe31a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData markdownLogo = IconData( + 0xe508, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData markerCircle = IconData( + 0xe640, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData martini = IconData( + 0xe31c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData maskHappy = IconData( + 0xe9f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData maskSad = IconData( + 0xeb9e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mastodonLogo = IconData( + 0xed68, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mathOperations = IconData( + 0xe31e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData matrixLogo = IconData( + 0xed64, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData medal = IconData( + 0xe320, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData medalMilitary = IconData( + 0xecfc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mediumLogo = IconData( + 0xe322, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData megaphone = IconData( + 0xe324, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData megaphoneSimple = IconData( + 0xe642, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData memberOf = IconData( + 0xedc2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData memory = IconData( + 0xe9c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData messengerLogo = IconData( + 0xe6d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData metaLogo = IconData( + 0xed02, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData meteor = IconData( + 0xe9ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData metronome = IconData( + 0xec8e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microphone = IconData( + 0xe326, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microphoneSlash = IconData( + 0xe328, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microphoneStage = IconData( + 0xe75c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microscope = IconData( + 0xec7a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftExcelLogo = IconData( + 0xeb6c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftOutlookLogo = IconData( + 0xeb70, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftPowerpointLogo = IconData( + 0xeace, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftTeamsLogo = IconData( + 0xeb66, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData microsoftWordLogo = IconData( + 0xeb6a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData minus = IconData( + 0xe32a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData minusCircle = IconData( + 0xe32c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData minusSquare = IconData( + 0xed4c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData money = IconData( + 0xe588, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData moneyWavy = IconData( + 0xee68, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData monitor = IconData( + 0xe32e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData monitorArrowUp = IconData( + 0xe58a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData monitorPlay = IconData( + 0xe58c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData moon = IconData( + 0xe330, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData moonStars = IconData( + 0xe58e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData moped = IconData( + 0xe824, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mopedFront = IconData( + 0xe822, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mosque = IconData( + 0xecee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData motorcycle = IconData( + 0xe80a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mountains = IconData( + 0xe7ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mouse = IconData( + 0xe33a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseLeftClick = IconData( + 0xe334, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseMiddleClick = IconData( + 0xe338, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseRightClick = IconData( + 0xe336, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseScroll = IconData( + 0xe332, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData mouseSimple = IconData( + 0xe644, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNote = IconData( + 0xe33c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNoteSimple = IconData( + 0xe33e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotes = IconData( + 0xe340, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotesMinus = IconData( + 0xee0c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotesPlus = IconData( + 0xeb7c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData musicNotesSimple = IconData( + 0xe342, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData navigationArrow = IconData( + 0xeade, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData needle = IconData( + 0xe82e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData network = IconData( + 0xedde, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData networkSlash = IconData( + 0xeddc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData networkX = IconData( + 0xedda, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData newspaper = IconData( + 0xe344, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData newspaperClipping = IconData( + 0xe346, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notEquals = IconData( + 0xeda6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notMemberOf = IconData( + 0xedae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notSubsetOf = IconData( + 0xedb0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notSupersetOf = IconData( + 0xedb2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notches = IconData( + 0xed3a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData note = IconData( + 0xe348, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData noteBlank = IconData( + 0xe34a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notePencil = IconData( + 0xe34c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notebook = IconData( + 0xe34e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notepad = IconData( + 0xe63e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notification = IconData( + 0xe6fa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData notionLogo = IconData( + 0xe9a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData nuclearPlant = IconData( + 0xed7c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleEight = IconData( + 0xe352, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleFive = IconData( + 0xe358, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleFour = IconData( + 0xe35e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleNine = IconData( + 0xe364, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleOne = IconData( + 0xe36a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleSeven = IconData( + 0xe370, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleSix = IconData( + 0xe376, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleThree = IconData( + 0xe37c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleTwo = IconData( + 0xe382, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberCircleZero = IconData( + 0xe388, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberEight = IconData( + 0xe350, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberFive = IconData( + 0xe356, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberFour = IconData( + 0xe35c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberNine = IconData( + 0xe362, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberOne = IconData( + 0xe368, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSeven = IconData( + 0xe36e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSix = IconData( + 0xe374, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareEight = IconData( + 0xe354, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareFive = IconData( + 0xe35a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareFour = IconData( + 0xe360, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareNine = IconData( + 0xe366, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareOne = IconData( + 0xe36c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareSeven = IconData( + 0xe372, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareSix = IconData( + 0xe378, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareThree = IconData( + 0xe37e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareTwo = IconData( + 0xe384, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberSquareZero = IconData( + 0xe38a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberThree = IconData( + 0xe37a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberTwo = IconData( + 0xe380, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numberZero = IconData( + 0xe386, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData numpad = IconData( + 0xe3c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData nut = IconData( + 0xe38c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData nyTimesLogo = IconData( + 0xe646, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData octagon = IconData( + 0xe38e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData officeChair = IconData( + 0xea46, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData onigiri = IconData( + 0xee2c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData openAiLogo = IconData( + 0xe7d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData option = IconData( + 0xe8a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData orange = IconData( + 0xee40, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData orangeSlice = IconData( + 0xed36, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData oven = IconData( + 0xed8c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData package = IconData( + 0xe390, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBrush = IconData( + 0xe6f0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBrushBroad = IconData( + 0xe590, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBrushHousehold = IconData( + 0xe6f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paintBucket = IconData( + 0xe392, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paintRoller = IconData( + 0xe6f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData palette = IconData( + 0xe6c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData panorama = IconData( + 0xeaa2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pants = IconData( + 0xec88, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paperPlane = IconData( + 0xe394, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paperPlaneRight = IconData( + 0xe396, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paperPlaneTilt = IconData( + 0xe398, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paperclip = IconData( + 0xe39a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paperclipHorizontal = IconData( + 0xe592, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData parachute = IconData( + 0xea7c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paragraph = IconData( + 0xe960, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData parallelogram = IconData( + 0xecc6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData park = IconData( + 0xecb2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData password = IconData( + 0xe752, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData path = IconData( + 0xe39c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData patreonLogo = IconData( + 0xe98a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pause = IconData( + 0xe39e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pauseCircle = IconData( + 0xe3a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pawPrint = IconData( + 0xe648, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData paypalLogo = IconData( + 0xe98c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData peace = IconData( + 0xe3a2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pen = IconData( + 0xe3aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData penNib = IconData( + 0xe3ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData penNibStraight = IconData( + 0xe64a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencil = IconData( + 0xe3ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilCircle = IconData( + 0xe3b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilLine = IconData( + 0xe3b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilRuler = IconData( + 0xe906, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSimple = IconData( + 0xe3b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSimpleLine = IconData( + 0xebc6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSimpleSlash = IconData( + 0xecf6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pencilSlash = IconData( + 0xecf8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pentagon = IconData( + 0xec7e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pentagram = IconData( + 0xec5c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pepper = IconData( + 0xe94a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData percent = IconData( + 0xe3b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData person = IconData( + 0xe3a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personArmsSpread = IconData( + 0xecfe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimple = IconData( + 0xe72e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleBike = IconData( + 0xe734, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleCircle = IconData( + 0xee58, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleHike = IconData( + 0xed54, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleRun = IconData( + 0xe730, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleSki = IconData( + 0xe71c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleSnowboard = IconData( + 0xe71e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleSwim = IconData( + 0xe736, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleTaiChi = IconData( + 0xed5c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleThrow = IconData( + 0xe732, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData personSimpleWalk = IconData( + 0xe73a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData perspective = IconData( + 0xebe6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phone = IconData( + 0xe3b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneCall = IconData( + 0xe3ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneDisconnect = IconData( + 0xe3bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneIncoming = IconData( + 0xe3be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneList = IconData( + 0xe3cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneOutgoing = IconData( + 0xe3c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phonePause = IconData( + 0xe3ca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phonePlus = IconData( + 0xec56, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneSlash = IconData( + 0xe3c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneTransfer = IconData( + 0xe3c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phoneX = IconData( + 0xe3c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData phosphorLogo = IconData( + 0xe3ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pi = IconData( + 0xec80, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pianoKeys = IconData( + 0xe9c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData picnicTable = IconData( + 0xee26, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pictureInPicture = IconData( + 0xe64c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData piggyBank = IconData( + 0xea04, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pill = IconData( + 0xe700, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pingPong = IconData( + 0xea42, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pintGlass = IconData( + 0xedd0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pinterestLogo = IconData( + 0xe64e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pinwheel = IconData( + 0xeb9c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pipe = IconData( + 0xed86, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pipeWrench = IconData( + 0xed88, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pixLogo = IconData( + 0xecc2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pizza = IconData( + 0xe796, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData placeholder = IconData( + 0xe650, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData planet = IconData( + 0xe652, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plant = IconData( + 0xebae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData play = IconData( + 0xe3d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData playCircle = IconData( + 0xe3d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData playPause = IconData( + 0xe8be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData playlist = IconData( + 0xe6aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plug = IconData( + 0xe946, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plugCharging = IconData( + 0xeb5c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plugs = IconData( + 0xeb56, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plugsConnected = IconData( + 0xeb5a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plus = IconData( + 0xe3d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plusCircle = IconData( + 0xe3d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plusMinus = IconData( + 0xe3d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData plusSquare = IconData( + 0xed4a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pokerChip = IconData( + 0xe594, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData policeCar = IconData( + 0xec4a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData polygon = IconData( + 0xe6d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData popcorn = IconData( + 0xeb4e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData popsicle = IconData( + 0xebbe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pottedPlant = IconData( + 0xec22, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData power = IconData( + 0xe3da, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData prescription = IconData( + 0xe7a2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData presentation = IconData( + 0xe654, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData presentationChart = IconData( + 0xe656, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData printer = IconData( + 0xe3dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData prohibit = IconData( + 0xe3de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData prohibitInset = IconData( + 0xe3e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData projectorScreen = IconData( + 0xe658, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData projectorScreenChart = IconData( + 0xe65a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pulse = IconData( + 0xe000, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPin = IconData( + 0xe3e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPinSimple = IconData( + 0xe65c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPinSimpleSlash = IconData( + 0xe65e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData pushPinSlash = IconData( + 0xe3e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData puzzlePiece = IconData( + 0xe596, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData qrCode = IconData( + 0xe3e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData question = IconData( + 0xe3e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData questionMark = IconData( + 0xe3e9, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData queue = IconData( + 0xe6ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData quotes = IconData( + 0xe660, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rabbit = IconData( + 0xeac2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData racquet = IconData( + 0xee02, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData radical = IconData( + 0xe3ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData radio = IconData( + 0xe77e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData radioButton = IconData( + 0xeb08, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData radioactive = IconData( + 0xe9dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rainbow = IconData( + 0xe598, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rainbowCloud = IconData( + 0xe59a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ranking = IconData( + 0xed62, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData readCvLogo = IconData( + 0xed0c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData receipt = IconData( + 0xe3ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData receiptX = IconData( + 0xed40, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData record = IconData( + 0xe3ee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rectangle = IconData( + 0xe3f0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rectangleDashed = IconData( + 0xe3f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData recycle = IconData( + 0xe75a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData redditLogo = IconData( + 0xe59c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData repeat = IconData( + 0xe3f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData repeatOnce = IconData( + 0xe3f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData replitLogo = IconData( + 0xeb8a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData resize = IconData( + 0xed6e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rewind = IconData( + 0xe6a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rewindCircle = IconData( + 0xe3fa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData roadHorizon = IconData( + 0xe838, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData robot = IconData( + 0xe762, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rocket = IconData( + 0xe3fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rocketLaunch = IconData( + 0xe3fe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rows = IconData( + 0xe5a2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rowsPlusBottom = IconData( + 0xe59e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rowsPlusTop = IconData( + 0xe5a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rss = IconData( + 0xe400, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rssSimple = IconData( + 0xe402, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData rug = IconData( + 0xea1a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ruler = IconData( + 0xe6b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sailboat = IconData( + 0xe78a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scales = IconData( + 0xe750, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scan = IconData( + 0xebb6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scanSmiley = IconData( + 0xebb4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scissors = IconData( + 0xeae0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scooter = IconData( + 0xe820, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData screencast = IconData( + 0xe404, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData screwdriver = IconData( + 0xe86e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scribble = IconData( + 0xe806, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scribbleLoop = IconData( + 0xe662, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData scroll = IconData( + 0xeb7a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData seal = IconData( + 0xe604, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sealCheck = IconData( + 0xe606, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sealPercent = IconData( + 0xe60a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sealQuestion = IconData( + 0xe608, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sealWarning = IconData( + 0xe60c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData seat = IconData( + 0xeb8e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData seatbelt = IconData( + 0xedfe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData securityCamera = IconData( + 0xeca4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData selection = IconData( + 0xe69a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionAll = IconData( + 0xe746, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionBackground = IconData( + 0xeaf8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionForeground = IconData( + 0xeaf6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionInverse = IconData( + 0xe744, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionPlus = IconData( + 0xe69c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData selectionSlash = IconData( + 0xe69e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shapes = IconData( + 0xec5e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData share = IconData( + 0xe406, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shareFat = IconData( + 0xed52, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shareNetwork = IconData( + 0xe408, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shield = IconData( + 0xe40a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldCheck = IconData( + 0xe40c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldCheckered = IconData( + 0xe708, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldChevron = IconData( + 0xe40e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldPlus = IconData( + 0xe706, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldSlash = IconData( + 0xe410, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldStar = IconData( + 0xec34, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shieldWarning = IconData( + 0xe412, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shippingContainer = IconData( + 0xe78c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shirtFolded = IconData( + 0xea92, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shootingStar = IconData( + 0xecfa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingBag = IconData( + 0xe416, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingBagOpen = IconData( + 0xe418, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingCart = IconData( + 0xe41e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shoppingCartSimple = IconData( + 0xe420, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shovel = IconData( + 0xe9e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shower = IconData( + 0xe776, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shrimp = IconData( + 0xeab4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shuffle = IconData( + 0xe422, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shuffleAngular = IconData( + 0xe424, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData shuffleSimple = IconData( + 0xe426, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sidebar = IconData( + 0xeab6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sidebarSimple = IconData( + 0xec24, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sigma = IconData( + 0xeab8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData signIn = IconData( + 0xe428, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData signOut = IconData( + 0xe42a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData signature = IconData( + 0xebac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData signpost = IconData( + 0xe89c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData simCard = IconData( + 0xe664, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData siren = IconData( + 0xe9b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sketchLogo = IconData( + 0xe42c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData skipBack = IconData( + 0xe5a4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData skipBackCircle = IconData( + 0xe42e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData skipForward = IconData( + 0xe5a6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData skipForwardCircle = IconData( + 0xe430, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData skull = IconData( + 0xe916, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData skypeLogo = IconData( + 0xe8dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData slackLogo = IconData( + 0xe5a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sliders = IconData( + 0xe432, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData slidersHorizontal = IconData( + 0xe434, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData slideshow = IconData( + 0xed32, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smiley = IconData( + 0xe436, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyAngry = IconData( + 0xec62, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyBlank = IconData( + 0xe438, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyMeh = IconData( + 0xe43a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyMelting = IconData( + 0xee56, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyNervous = IconData( + 0xe43c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileySad = IconData( + 0xe43e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileySticker = IconData( + 0xe440, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyWink = IconData( + 0xe666, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData smileyXEyes = IconData( + 0xe442, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData snapchatLogo = IconData( + 0xe668, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sneaker = IconData( + 0xe80c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sneakerMove = IconData( + 0xed60, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData snowflake = IconData( + 0xe5aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData soccerBall = IconData( + 0xe716, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sock = IconData( + 0xecce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData solarPanel = IconData( + 0xed7a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData solarRoof = IconData( + 0xed7b, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sortAscending = IconData( + 0xe444, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sortDescending = IconData( + 0xe446, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData soundcloudLogo = IconData( + 0xe8de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData spade = IconData( + 0xe448, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sparkle = IconData( + 0xe6a2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerHifi = IconData( + 0xea08, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerHigh = IconData( + 0xe44a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerLow = IconData( + 0xe44c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerNone = IconData( + 0xe44e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleHigh = IconData( + 0xe450, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleLow = IconData( + 0xe452, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleNone = IconData( + 0xe454, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleSlash = IconData( + 0xe456, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSimpleX = IconData( + 0xe458, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerSlash = IconData( + 0xe45a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speakerX = IconData( + 0xe45c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData speedometer = IconData( + 0xee74, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sphere = IconData( + 0xee66, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData spinner = IconData( + 0xe66a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData spinnerBall = IconData( + 0xee28, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData spinnerGap = IconData( + 0xe66c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData spiral = IconData( + 0xe9fa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData splitHorizontal = IconData( + 0xe872, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData splitVertical = IconData( + 0xe876, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData spotifyLogo = IconData( + 0xe66e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sprayBottle = IconData( + 0xe7e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData square = IconData( + 0xe45e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData squareHalf = IconData( + 0xe462, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData squareHalfBottom = IconData( + 0xeb16, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData squareLogo = IconData( + 0xe690, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData squareSplitHorizontal = IconData( + 0xe870, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData squareSplitVertical = IconData( + 0xe874, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData squaresFour = IconData( + 0xe464, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stack = IconData( + 0xe466, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stackMinus = IconData( + 0xedf4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stackOverflowLogo = IconData( + 0xeb78, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stackPlus = IconData( + 0xedf6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stackSimple = IconData( + 0xe468, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stairs = IconData( + 0xe8ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stamp = IconData( + 0xea48, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData standardDefinition = IconData( + 0xea90, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData star = IconData( + 0xe46a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData starAndCrescent = IconData( + 0xecf4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData starFour = IconData( + 0xe6a4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData starHalf = IconData( + 0xe70a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData starOfDavid = IconData( + 0xe89e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData steamLogo = IconData( + 0xead4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData steeringWheel = IconData( + 0xe9ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData steps = IconData( + 0xecbe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stethoscope = IconData( + 0xe7ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sticker = IconData( + 0xe5ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stool = IconData( + 0xea44, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stop = IconData( + 0xe46c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stopCircle = IconData( + 0xe46e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData storefront = IconData( + 0xe470, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData strategy = IconData( + 0xea3a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData stripeLogo = IconData( + 0xe698, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData student = IconData( + 0xe73e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData subsetOf = IconData( + 0xedc0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData subsetProperOf = IconData( + 0xedb6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData subtitles = IconData( + 0xe1a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData subtitlesSlash = IconData( + 0xe1a6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData subtract = IconData( + 0xebd6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData subtractSquare = IconData( + 0xebd4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData subway = IconData( + 0xe498, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData suitcase = IconData( + 0xe5ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData suitcaseRolling = IconData( + 0xe9b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData suitcaseSimple = IconData( + 0xe5b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sun = IconData( + 0xe472, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sunDim = IconData( + 0xe474, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sunHorizon = IconData( + 0xe5b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sunglasses = IconData( + 0xe816, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData supersetOf = IconData( + 0xedb8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData supersetProperOf = IconData( + 0xedb4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData swap = IconData( + 0xe83c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData swatches = IconData( + 0xe5b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData swimmingPool = IconData( + 0xecb6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData sword = IconData( + 0xe5ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData synagogue = IconData( + 0xecec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData syringe = IconData( + 0xe968, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tShirt = IconData( + 0xe670, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData table = IconData( + 0xe476, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tabs = IconData( + 0xe778, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tag = IconData( + 0xe478, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tagChevron = IconData( + 0xe672, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tagSimple = IconData( + 0xe47a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData target = IconData( + 0xe47c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData taxi = IconData( + 0xe902, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData teaBag = IconData( + 0xe8e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData telegramLogo = IconData( + 0xe5bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData television = IconData( + 0xe754, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData televisionSimple = IconData( + 0xeae6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tennisBall = IconData( + 0xe720, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tent = IconData( + 0xe8ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData terminal = IconData( + 0xe47e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData terminalWindow = IconData( + 0xeae8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData testTube = IconData( + 0xe7a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textAUnderline = IconData( + 0xed34, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textAa = IconData( + 0xe6ee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignCenter = IconData( + 0xe480, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignJustify = IconData( + 0xe482, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignLeft = IconData( + 0xe484, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textAlignRight = IconData( + 0xe486, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textB = IconData( + 0xe5be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textBolder = IconData( + 0xe5be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textColumns = IconData( + 0xec96, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textH = IconData( + 0xe6ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textHFive = IconData( + 0xe6c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textHFour = IconData( + 0xe6c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textHOne = IconData( + 0xe6bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textHSix = IconData( + 0xe6c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textHThree = IconData( + 0xe6c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textHTwo = IconData( + 0xe6be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textIndent = IconData( + 0xea1e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textItalic = IconData( + 0xe5c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textOutdent = IconData( + 0xea1c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textStrikethrough = IconData( + 0xe5c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textSubscript = IconData( + 0xec98, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textSuperscript = IconData( + 0xec9a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textT = IconData( + 0xe48a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textTSlash = IconData( + 0xe488, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textUnderline = IconData( + 0xe5c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData textbox = IconData( + 0xeb0a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometer = IconData( + 0xe5c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometerCold = IconData( + 0xe5c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometerHot = IconData( + 0xe5ca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData thermometerSimple = IconData( + 0xe5cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData threadsLogo = IconData( + 0xed9e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData threeD = IconData( + 0xea5a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData thumbsDown = IconData( + 0xe48c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData thumbsUp = IconData( + 0xe48e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData ticket = IconData( + 0xe490, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tidalLogo = IconData( + 0xed1c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tiktokLogo = IconData( + 0xeaf2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tilde = IconData( + 0xeda8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData timer = IconData( + 0xe492, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tipJar = IconData( + 0xe7e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tipi = IconData( + 0xed30, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tire = IconData( + 0xedd2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData toggleLeft = IconData( + 0xe674, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData toggleRight = IconData( + 0xe676, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData toilet = IconData( + 0xe79a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData toiletPaper = IconData( + 0xe79c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData toolbox = IconData( + 0xeca0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tooth = IconData( + 0xe9cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tornado = IconData( + 0xe88c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tote = IconData( + 0xe494, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData toteSimple = IconData( + 0xe678, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData towel = IconData( + 0xede6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tractor = IconData( + 0xec6e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trademark = IconData( + 0xe9f0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trademarkRegistered = IconData( + 0xe3f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trafficCone = IconData( + 0xe9a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trafficSign = IconData( + 0xe67a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trafficSignal = IconData( + 0xe9aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData train = IconData( + 0xe496, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trainRegional = IconData( + 0xe49e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trainSimple = IconData( + 0xe4a0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tram = IconData( + 0xe9ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData translate = IconData( + 0xe4a2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trash = IconData( + 0xe4a6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trashSimple = IconData( + 0xe4a8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tray = IconData( + 0xe4aa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trayArrowDown = IconData( + 0xe010, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trayArrowUp = IconData( + 0xee52, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData treasureChest = IconData( + 0xede2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tree = IconData( + 0xe6da, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData treeEvergreen = IconData( + 0xe6dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData treePalm = IconData( + 0xe91a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData treeStructure = IconData( + 0xe67c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData treeView = IconData( + 0xee48, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trendDown = IconData( + 0xe4ac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trendUp = IconData( + 0xe4ae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData triangle = IconData( + 0xe4b0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData triangleDashed = IconData( + 0xe4b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trolley = IconData( + 0xe5b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trolleySuitcase = IconData( + 0xe5b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData trophy = IconData( + 0xe67e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData truck = IconData( + 0xe4b4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData truckTrailer = IconData( + 0xe4b6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData tumblrLogo = IconData( + 0xe8d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData twitchLogo = IconData( + 0xe5ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData twitterLogo = IconData( + 0xe4ba, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData umbrella = IconData( + 0xe684, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData umbrellaSimple = IconData( + 0xe686, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData union = IconData( + 0xedbe, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData unite = IconData( + 0xe87e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData uniteSquare = IconData( + 0xe878, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData upload = IconData( + 0xe4be, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData uploadSimple = IconData( + 0xe4c0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData usb = IconData( + 0xe956, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData user = IconData( + 0xe4c2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userCheck = IconData( + 0xeafa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircle = IconData( + 0xe4c4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleCheck = IconData( + 0xec38, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleDashed = IconData( + 0xec36, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleGear = IconData( + 0xe4c6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userCircleMinus = IconData( + 0xe4c8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userCirclePlus = IconData( + 0xe4ca, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userFocus = IconData( + 0xe6fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userGear = IconData( + 0xe4cc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userList = IconData( + 0xe73c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userMinus = IconData( + 0xe4ce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userPlus = IconData( + 0xe4d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userRectangle = IconData( + 0xe4d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userSound = IconData( + 0xeca8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userSquare = IconData( + 0xe4d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData userSwitch = IconData( + 0xe756, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData users = IconData( + 0xe4d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData usersFour = IconData( + 0xe68c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData usersThree = IconData( + 0xe68e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData van = IconData( + 0xe826, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData vault = IconData( + 0xe76e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData vectorThree = IconData( + 0xee62, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData vectorTwo = IconData( + 0xee64, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData vibrate = IconData( + 0xe4d8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData video = IconData( + 0xe740, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData videoCamera = IconData( + 0xe4da, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData videoCameraSlash = IconData( + 0xe4dc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData videoConference = IconData( + 0xedce, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData vignette = IconData( + 0xeba2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData vinylRecord = IconData( + 0xecac, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData virtualReality = IconData( + 0xe7b8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData virus = IconData( + 0xe7d6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData visor = IconData( + 0xee2a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData voicemail = IconData( + 0xe4de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData volleyball = IconData( + 0xe726, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wall = IconData( + 0xe688, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wallet = IconData( + 0xe68a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData warehouse = IconData( + 0xecd4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData warning = IconData( + 0xe4e0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData warningCircle = IconData( + 0xe4e2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData warningDiamond = IconData( + 0xe7fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData warningOctagon = IconData( + 0xe4e4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData washingMachine = IconData( + 0xede8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData watch = IconData( + 0xe4e6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData waveSawtooth = IconData( + 0xea9c, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData waveSine = IconData( + 0xea9a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData waveSquare = IconData( + 0xea9e, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData waveTriangle = IconData( + 0xeaa0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData waveform = IconData( + 0xe802, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData waveformSlash = IconData( + 0xe800, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData waves = IconData( + 0xe6de, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData webcam = IconData( + 0xe9b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData webcamSlash = IconData( + 0xecdc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData webhooksLogo = IconData( + 0xecae, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wechatLogo = IconData( + 0xe8d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData whatsappLogo = IconData( + 0xe5d0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wheelchair = IconData( + 0xe4e8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wheelchairMotion = IconData( + 0xe89a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiHigh = IconData( + 0xe4ea, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiLow = IconData( + 0xe4ec, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiMedium = IconData( + 0xe4ee, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiNone = IconData( + 0xe4f0, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiSlash = IconData( + 0xe4f2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wifiX = IconData( + 0xe4f4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wind = IconData( + 0xe5d2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData windmill = IconData( + 0xe9f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData windowsLogo = IconData( + 0xe692, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wine = IconData( + 0xe6b2, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData wrench = IconData( + 0xe5d4, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData x = IconData( + 0xe4f6, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData xCircle = IconData( + 0xe4f8, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData xLogo = IconData( + 0xe4bc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData xSquare = IconData( + 0xe4fa, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData yarn = IconData( + 0xed9a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData yinYang = IconData( + 0xe92a, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); + static const IconData youtubeLogo = IconData( + 0xe4fc, + fontFamily: 'PhosphorFill', + fontPackage: 'cutdex_ui', + ); +} diff --git a/packages/cutdex_ui/lib/src/theme/app_palette.dart b/packages/cutdex_ui/lib/src/theme/app_palette.dart new file mode 100644 index 0000000..19f9570 --- /dev/null +++ b/packages/cutdex_ui/lib/src/theme/app_palette.dart @@ -0,0 +1,2 @@ +/// Workspace color families, independent of light or dark appearance. +enum AppPalette { graphite, violet, teal } diff --git a/packages/cutdex_ui/lib/src/theme/app_theme.dart b/packages/cutdex_ui/lib/src/theme/app_theme.dart index 00f136b..7c20beb 100644 --- a/packages/cutdex_ui/lib/src/theme/app_theme.dart +++ b/packages/cutdex_ui/lib/src/theme/app_theme.dart @@ -1,14 +1,234 @@ import 'package:flutter/foundation.dart'; import 'menu_metrics.dart'; +import 'app_palette.dart'; import 'package:flutter/material.dart'; +import '../icons/app_icons.dart'; + /// Workspace semantic colors and Codex desktop typography. abstract final class AppTheme { + /// Applied by the desktop shell only; touch surfaces retain their own scale. + static ThemeData desktopWorkspaceTheme(ThemeData theme) { + if (theme.extension() != null) return theme; + final text = theme.textTheme; + final body = text.bodyMedium!.copyWith(fontSize: 13, height: 20 / 13); + final label = body.copyWith( + fontWeight: FontWeight.w500, + fontVariations: const [FontVariation('wght', 500)], + ); + ButtonStyle? button(ButtonStyle? style) => style?.copyWith( + minimumSize: const WidgetStatePropertyAll( + Size(0, AppDesktopMetrics.button), + ), + padding: const WidgetStatePropertyAll( + EdgeInsets.symmetric(horizontal: 12, vertical: 6), + ), + textStyle: WidgetStatePropertyAll(label), + ); + return theme.copyWith( + extensions: [...theme.extensions.values, const DesktopControlDensity()], + textTheme: text.copyWith( + bodyLarge: body.copyWith(fontSize: 14, height: 20 / 14), + bodyMedium: body, + bodySmall: text.bodySmall?.copyWith(fontSize: 12, height: 16 / 12), + labelLarge: label, + titleSmall: label.copyWith(fontSize: 14, height: 20 / 14), + ), + textButtonTheme: TextButtonThemeData( + style: button(theme.textButtonTheme.style), + ), + filledButtonTheme: FilledButtonThemeData( + style: button(theme.filledButtonTheme.style), + ), + outlinedButtonTheme: OutlinedButtonThemeData( + style: button(theme.outlinedButtonTheme.style), + ), + iconButtonTheme: IconButtonThemeData( + style: theme.iconButtonTheme.style?.copyWith( + minimumSize: const WidgetStatePropertyAll( + Size.square(AppDesktopMetrics.iconButton), + ), + padding: const WidgetStatePropertyAll(EdgeInsets.all(4)), + iconSize: const WidgetStatePropertyAll(16), + ), + ), + inputDecorationTheme: theme.inputDecorationTheme.copyWith( + constraints: const BoxConstraints(minHeight: AppDesktopMetrics.input), + contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), + hintStyle: body.copyWith( + color: theme.inputDecorationTheme.hintStyle?.color, + leadingDistribution: TextLeadingDistribution.even, + ), + ), + ); + } + + static bool isDesktop(BuildContext context) => + Theme.of(context).extension() != null; + + /// Window project navigation uses quiet neutral surfaces in every palette. + static ButtonStyle projectTabStyle( + BuildContext context, { + required bool selected, + }) { + final theme = Theme.of(context); + final colors = theme.colorScheme; + return ButtonStyle( + minimumSize: const WidgetStatePropertyAll( + Size(0, AppProjectTabMetrics.height), + ), + maximumSize: const WidgetStatePropertyAll( + Size(double.infinity, AppProjectTabMetrics.height), + ), + visualDensity: VisualDensity.standard, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: const WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(AppProjectTabMetrics.radius), + ), + ), + ), + padding: const WidgetStatePropertyAll( + EdgeInsets.symmetric(horizontal: 8), + ), + textStyle: WidgetStatePropertyAll( + theme.textTheme.labelLarge?.copyWith( + fontSize: 13, + height: 1.3, + fontWeight: selected ? FontWeight.w500 : FontWeight.w400, + fontVariations: [FontVariation('wght', selected ? 500 : 400)], + ), + ), + foregroundColor: WidgetStateProperty.resolveWith( + (states) => states.contains(WidgetState.disabled) + ? colors.onSurface.withValues(alpha: .38) + : selected + ? colors.onSurface + : colors.onSurfaceVariant, + ), + backgroundColor: WidgetStateProperty.resolveWith( + (states) => colors.onSurface.withValues( + alpha: states.contains(WidgetState.pressed) + ? .12 + : selected + ? .08 + : states.contains(WidgetState.hovered) || + states.contains(WidgetState.focused) + ? .05 + : 0, + ), + ), + overlayColor: const WidgetStatePropertyAll(Colors.transparent), + ); + } + + static ButtonStyle projectTabActionStyle( + BuildContext context, { + double size = AppProjectTabMetrics.height, + }) => IconButton.styleFrom( + fixedSize: Size.square(size), + minimumSize: Size.square(size), + maximumSize: Size.square(size), + visualDensity: VisualDensity.standard, + padding: EdgeInsets.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + foregroundColor: Theme.of(context).colorScheme.onSurfaceVariant, + backgroundColor: Colors.transparent, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(AppProjectTabMetrics.radius), + ), + ), + ); + + /// Tab navigation sits one surface level above the timeline commands. + static Color timelineTabsBackground(BuildContext context) { + final colors = Theme.of(context).colorScheme; + return isDesktop(context) ? colors.surfaceContainerLow : colors.surface; + } + + /// Rounded document tabs keep selection distinct from editing commands. + static ButtonStyle timelineTabStyle( + BuildContext context, { + required bool selected, + }) { + final theme = Theme.of(context); + final desktop = isDesktop(context); + final colors = theme.colorScheme; + final height = desktop ? AppDesktopMetrics.timelineTabControl : 20.0; + return ButtonStyle( + minimumSize: WidgetStatePropertyAll(Size(0, height)), + maximumSize: WidgetStatePropertyAll(Size(double.infinity, height)), + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: desktop + ? const WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(AppDesktopMetrics.timelineTabRadius), + ), + ), + ) + : null, + textStyle: WidgetStatePropertyAll( + theme.textTheme.labelLarge?.copyWith( + fontSize: desktop ? 13 : 12, + height: 1.3, + fontWeight: desktop && selected ? FontWeight.w500 : FontWeight.w400, + fontVariations: desktop + ? [FontVariation('wght', selected ? 500 : 400)] + : null, + ), + ), + padding: const WidgetStatePropertyAll( + EdgeInsets.symmetric(horizontal: AppSpacing.small), + ), + foregroundColor: WidgetStatePropertyAll( + selected + ? desktop + ? colors.primary + : colors.onSurface + : colors.onSurfaceVariant, + ), + backgroundColor: WidgetStatePropertyAll( + selected + ? desktop + ? colors.primary.withValues(alpha: .12) + : colors.onSurface.withValues(alpha: .05) + : Colors.transparent, + ), + overlayColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.hovered) || + states.contains(WidgetState.focused) || + states.contains(WidgetState.pressed)) { + return colors.onSurface.withValues(alpha: .078); + } + return Colors.transparent; + }), + ); + } + + static ButtonStyle get timelineTabActionStyle => IconButton.styleFrom( + fixedSize: const Size.square(AppDesktopMetrics.timelineTabControl), + minimumSize: const Size.square(AppDesktopMetrics.timelineTabControl), + maximumSize: const Size.square(AppDesktopMetrics.timelineTabControl), + padding: EdgeInsets.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(AppDesktopMetrics.timelineTabRadius), + ), + ), + ); + static ThemeData get penLight => _build(AppColors.penLight); static ThemeData get penDark => _build(AppColors.penDark); + static ThemeData forPalette(AppPalette palette, Brightness brightness) => + _build(AppColors.forPalette(palette, brightness)); + /// Media canvas controls keep a dark palette in either workspace appearance. static ThemeData get previewCanvasTheme => penDark; @@ -70,7 +290,7 @@ abstract final class AppTheme { static Color settingsSidebarBackground(BuildContext context) { final theme = Theme.of(context); return theme.brightness == Brightness.dark - ? AppColors.penDark.settingsSidebar + ? AppColors.of(theme).settingsSidebar : theme.colorScheme.surfaceContainer; } @@ -124,6 +344,16 @@ abstract final class AppTheme { static Color sidebarDividerColor(BuildContext context) => Theme.of(context).dividerColor; + /// Keeps boundaries visible on the brighter floating composer surface. + static Color floatingDialogDividerColor(BuildContext context) { + final theme = Theme.of(context); + if (theme.brightness != Brightness.dark) return theme.dividerColor; + return Color.alphaBlend( + theme.colorScheme.onSurface.withValues(alpha: .16), + AppSurfaces.of(context).composerBackground, + ); + } + /// Side panels keep their Material children on the same surface. static ThemeData panelTheme(ThemeData theme) { final background = theme.colorScheme.surfaceContainerLow; @@ -137,14 +367,42 @@ abstract final class AppTheme { final divider = theme.dividerColor; return theme.copyWith( dividerColor: divider, - dividerTheme: DividerThemeData(color: divider, thickness: 1, space: 1), + dividerTheme: theme.dividerTheme.copyWith(color: divider, space: 1), ); } - /// Inspector controls share the desktop UI type scale. + /// Desktop inspectors use a denser scale than dialogs and settings. static ThemeData propertiesPanelTheme(ThemeData theme) { + final desktop = theme.extension() != null; final colors = theme.colorScheme; - final panelText = theme.textTheme; + final panelText = desktop + ? theme.textTheme.copyWith( + bodyMedium: theme.textTheme.bodyMedium?.copyWith( + fontSize: 13, + height: 20 / 13, + leadingDistribution: TextLeadingDistribution.even, + ), + bodySmall: theme.textTheme.bodySmall?.copyWith( + fontSize: 12, + height: 16 / 12, + leadingDistribution: TextLeadingDistribution.even, + ), + ) + : theme.textTheme; + final actionSize = desktop + ? AppInspectorMetrics.action + : AppControlSize.propertyControl; + ButtonStyle? buttonStyle(ButtonStyle? style) => style?.copyWith( + textStyle: WidgetStatePropertyAll(panelText.labelLarge), + minimumSize: desktop + ? const WidgetStatePropertyAll(Size(0, AppInspectorMetrics.input)) + : style.minimumSize, + padding: desktop + ? const WidgetStatePropertyAll( + EdgeInsets.symmetric(horizontal: 8, vertical: 4), + ) + : style.padding, + ); final panelColors = colors.copyWith(surface: colors.surfaceContainerLow); final composerBackground = theme .extension()! @@ -157,58 +415,87 @@ abstract final class AppTheme { borderSide: BorderSide.none, ); return theme.copyWith( + extensions: [ + ...theme.extensions.values, + if (desktop) const InspectorControlDensity(), + ], canvasColor: colors.surfaceContainerLow, colorScheme: panelColors, textTheme: panelText, primaryTextTheme: panelText, inputDecorationTheme: theme.inputDecorationTheme.copyWith( - constraints: const BoxConstraints( - minHeight: AppControlSize.propertyControl, + constraints: BoxConstraints( + minHeight: desktop + ? AppInspectorMetrics.input + : AppControlSize.propertyControl, ), - contentPadding: const EdgeInsets.symmetric( + contentPadding: EdgeInsets.symmetric( horizontal: AppSpacing.controlHorizontal, vertical: AppSpacing.tiny, ), fillColor: composerBackground, - hintStyle: panelText.bodyMedium?.copyWith(color: hintColor), + hintStyle: panelText.bodyMedium?.copyWith( + color: hintColor, + leadingDistribution: TextLeadingDistribution.even, + ), border: inputShape, enabledBorder: inputShape, disabledBorder: inputShape, - focusedBorder: inputShape, + focusedBorder: AppColors.of(theme)._legacy + ? inputShape + : inputShape.copyWith( + borderSide: BorderSide(color: colors.primary), + ), errorBorder: inputShape, focusedErrorBorder: inputShape, ), iconButtonTheme: IconButtonThemeData( style: theme.iconButtonTheme.style?.copyWith( - minimumSize: const WidgetStatePropertyAll( - Size.square(AppControlSize.propertyControl), - ), - maximumSize: const WidgetStatePropertyAll( - Size.square(AppControlSize.propertyControl), - ), - fixedSize: const WidgetStatePropertyAll( - Size.square(AppControlSize.propertyControl), - ), + minimumSize: WidgetStatePropertyAll(Size.square(actionSize)), + maximumSize: WidgetStatePropertyAll(Size.square(actionSize)), + fixedSize: WidgetStatePropertyAll(Size.square(actionSize)), ), ), textButtonTheme: TextButtonThemeData( - style: theme.textButtonTheme.style?.copyWith( - textStyle: WidgetStatePropertyAll(panelText.labelLarge), - ), + style: buttonStyle(theme.textButtonTheme.style), ), filledButtonTheme: FilledButtonThemeData( - style: theme.filledButtonTheme.style?.copyWith( - textStyle: WidgetStatePropertyAll(panelText.labelLarge), - ), + style: buttonStyle(theme.filledButtonTheme.style), ), outlinedButtonTheme: OutlinedButtonThemeData( - style: theme.outlinedButtonTheme.style?.copyWith( - textStyle: WidgetStatePropertyAll(panelText.labelLarge), - ), + style: buttonStyle(theme.outlinedButtonTheme.style), ), ); } + static bool isCompactInspector(BuildContext context) => + Theme.of(context).extension() != null; + + static EdgeInsets propertySectionPadding(BuildContext context) => + isDesktop(context) + ? const EdgeInsets.symmetric( + horizontal: AppInspectorMetrics.padding, + vertical: AppInspectorMetrics.groupGap / 2, + ) + : AppSpacing.panelSection; + + static double propertyRowGap(BuildContext context) => + isDesktop(context) ? AppInspectorMetrics.rowGap : AppSpacing.small; + + static double propertyInputHeight(BuildContext context) => isDesktop(context) + ? AppInspectorMetrics.input + : AppControlSize.propertyControl; + + static TextStyle propertyLabelStyle(BuildContext context) { + final theme = Theme.of(context); + return theme.textTheme.bodyMedium!.copyWith( + fontSize: isCompactInspector(context) ? 12 : null, + height: isCompactInspector(context) ? 16 / 12 : null, + leadingDistribution: TextLeadingDistribution.even, + color: theme.colorScheme.onSurfaceVariant, + ); + } + static TextStyle toolbarTextStyle(BuildContext context) => Theme.of(context).textTheme.bodyMedium! .copyWith(fontSize: 13, height: 18 / 13); @@ -231,6 +518,11 @@ abstract final class AppTheme { ); static ThemeData dialogContentTheme(ThemeData theme) { + final inputText = theme.textTheme.bodyMedium!.copyWith( + fontSize: 14, + height: 20 / 14, + leadingDistribution: TextLeadingDistribution.even, + ); const buttonSize = WidgetStatePropertyAll(Size(0, 32)); const buttonPadding = WidgetStatePropertyAll( EdgeInsets.symmetric(horizontal: 16, vertical: AppSpacing.gap), @@ -243,32 +535,35 @@ abstract final class AppTheme { borderRadius: BorderRadius.circular(AppRadius.large), borderSide: BorderSide( color: dark - ? AppColors.penDark.dialogBorder + ? AppColors.of(theme).dialogBorder : theme.colorScheme.outlineVariant, ), ); return theme.copyWith( - textTheme: theme.textTheme.copyWith( - bodyMedium: theme.textTheme.bodyMedium?.copyWith( - fontSize: 14, - height: 20 / 14, - ), + extensions: theme.extensions.values.where( + (value) => value is! InspectorControlDensity, ), + textTheme: theme.textTheme.copyWith(bodyMedium: inputText), inputDecorationTheme: theme.inputDecorationTheme.copyWith( constraints: const BoxConstraints(minHeight: 36), - fillColor: dark - ? AppColors.penDark.dialogInputBackground + fillColor: dark || !AppColors.of(theme)._legacy + ? AppColors.of(theme).dialogInputBackground : theme.colorScheme.surface, contentPadding: const EdgeInsets.symmetric( horizontal: 10, vertical: AppSpacing.small, ), + hintStyle: inputText.copyWith( + color: + theme.inputDecorationTheme.hintStyle?.color ?? + theme.colorScheme.onSurfaceVariant, + ), border: inputBorder, enabledBorder: inputBorder, focusedBorder: inputBorder.copyWith( borderSide: BorderSide( color: dark - ? AppColors.penDark.dialogFocusBorder + ? AppColors.of(theme).dialogFocusBorder : theme.colorScheme.outline, ), ), @@ -303,7 +598,7 @@ abstract final class AppTheme { final colors = base.colorScheme; final text = base.textTheme; final border = dark - ? AppColors.penDark.settingsBorder + ? AppColors.of(theme).settingsBorder : colors.outlineVariant; final body = text.bodyMedium!.copyWith( fontSize: 13, @@ -313,29 +608,38 @@ abstract final class AppTheme { fontVariations: const [FontVariation('wght', 400)], ); ButtonStyle? control(ButtonStyle? style) => style?.copyWith( - minimumSize: const WidgetStatePropertyAll( - Size(0, AppSettingsMetrics.controlHeight), + minimumSize: WidgetStatePropertyAll( + Size( + 0, + theme.extension() != null + ? AppDesktopMetrics.button + : AppSettingsMetrics.controlHeight, + ), ), padding: const WidgetStatePropertyAll( EdgeInsets.symmetric(horizontal: 10, vertical: 5), ), textStyle: WidgetStatePropertyAll(body), iconSize: const WidgetStatePropertyAll(16), - shape: const WidgetStatePropertyAll( + shape: WidgetStatePropertyAll( RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), + borderRadius: BorderRadius.all( + Radius.circular( + theme.extension() != null ? 6 : 10, + ), + ), ), ), ); return base.copyWith( colorScheme: colors.copyWith( - surface: dark ? AppColors.penDark.background : colors.surface, + surface: dark ? AppColors.of(theme).background : colors.surface, surfaceContainer: dark - ? AppColors.penDark.settingsContainer + ? AppColors.of(theme).settingsContainer : colors.surfaceContainer, outlineVariant: border, ), - dividerTheme: base.dividerTheme.copyWith(color: border, thickness: 1), + dividerTheme: base.dividerTheme.copyWith(color: base.dividerColor), textTheme: text.copyWith( bodyMedium: body, labelLarge: body, @@ -354,18 +658,26 @@ abstract final class AppTheme { filledButtonTheme: FilledButtonThemeData( style: control(base.filledButtonTheme.style)?.copyWith( backgroundColor: WidgetStateProperty.resolveWith( - (states) => colors.onSurface.withValues( - alpha: states.contains(WidgetState.disabled) ? .3 : 1, - ), + (states) => + (AppColors.of(theme)._legacy + ? colors.onSurface + : colors.primary) + .withValues( + alpha: states.contains(WidgetState.disabled) ? .3 : 1, + ), + ), + foregroundColor: WidgetStatePropertyAll( + AppColors.of(theme)._legacy ? colors.surface : colors.onPrimary, ), - foregroundColor: WidgetStatePropertyAll(colors.surface), side: const WidgetStatePropertyAll(BorderSide.none), ), ), outlinedButtonTheme: OutlinedButtonThemeData( style: control(base.outlinedButtonTheme.style)?.copyWith( backgroundColor: WidgetStatePropertyAll( - dark ? AppColors.penDark.settingsControlBackground : colors.surface, + dark + ? AppColors.of(theme).settingsControlBackground + : colors.surface, ), side: WidgetStatePropertyAll(BorderSide(color: border)), ), @@ -373,11 +685,12 @@ abstract final class AppTheme { switchTheme: base.switchTheme.copyWith( trackColor: WidgetStateProperty.resolveWith( (states) => states.contains(WidgetState.selected) - ? AppColors.settingsSwitchAccent - : (dark ? AppColors.penDark : AppColors.penLight) - .settingsSwitchTrack, + ? AppColors.of(theme).settingsSwitchColor + : AppColors.of(theme).settingsSwitchTrack, + ), + thumbColor: WidgetStateProperty.resolveWith( + (states) => AppColors.of(theme).settingsSwitchThumb(states), ), - thumbColor: const WidgetStatePropertyAll(Colors.white), ), ); } @@ -389,13 +702,12 @@ abstract final class AppTheme { textButtonTheme: TextButtonThemeData( style: theme.textButtonTheme.style?.copyWith( backgroundColor: WidgetStatePropertyAll( - (dark ? AppColors.penDark : AppColors.penLight) - .dialogActionBackground, + AppColors.of(theme).dialogActionBackground, ), side: WidgetStatePropertyAll( BorderSide( color: dark - ? AppColors.penDark.dialogBorder + ? AppColors.of(theme).dialogBorder : colors.outlineVariant, ), ), @@ -404,8 +716,12 @@ abstract final class AppTheme { ), filledButtonTheme: FilledButtonThemeData( style: theme.filledButtonTheme.style?.copyWith( - backgroundColor: WidgetStatePropertyAll(colors.onSurface), - foregroundColor: WidgetStatePropertyAll(colors.surface), + backgroundColor: WidgetStatePropertyAll( + AppColors.of(theme)._legacy ? colors.onSurface : colors.primary, + ), + foregroundColor: WidgetStatePropertyAll( + AppColors.of(theme)._legacy ? colors.surface : colors.onPrimary, + ), side: const WidgetStatePropertyAll(BorderSide.none), ), ), @@ -514,6 +830,26 @@ abstract final class AppTheme { ); } + static ButtonStyle accentIconButtonStyle(BuildContext context) { + final theme = Theme.of(context); + final colors = theme.colorScheme; + return primaryIconButtonStyle(context).copyWith( + shape: const WidgetStatePropertyAll(CircleBorder()), + backgroundColor: WidgetStateProperty.resolveWith( + (states) => states.contains(WidgetState.disabled) + ? colors.onSurface.withValues(alpha: .12) + : colors.outline, + ), + foregroundColor: WidgetStateProperty.resolveWith( + (states) => states.contains(WidgetState.disabled) + ? colors.onSurface.withValues(alpha: .38) + : AppColors.of(theme)._legacy + ? Colors.white + : colors.onPrimary, + ), + ); + } + static BoxDecoration userMessageDecoration(BuildContext context) => BoxDecoration( color: Theme.of(context).colorScheme.onSurface.withValues(alpha: .08), @@ -534,8 +870,19 @@ abstract final class AppTheme { color: Theme.of(context).colorScheme.onSurface.withValues(alpha: .5), ); - static TextStyle inputTextStyle(BuildContext context) => - Theme.of(context).textTheme.bodyMedium!; + /// Splits extra line height evenly above and below editable text. + static TextStyle inputTextStyle(BuildContext context, {TextStyle? style}) => + (style ?? Theme.of(context).textTheme.bodyMedium!).copyWith( + leadingDistribution: TextLeadingDistribution.even, + ); + + /// Hints share the input's metrics and retain the theme's secondary color. + static TextStyle inputHintStyle(BuildContext context, {TextStyle? style}) => + inputTextStyle(context, style: style).copyWith( + color: + Theme.of(context).inputDecorationTheme.hintStyle?.color ?? + Theme.of(context).colorScheme.onSurfaceVariant, + ); static TextStyle composerTextStyle(BuildContext context) => AppSidebarTypography.style( @@ -559,7 +906,7 @@ abstract final class AppTheme { final theme = Theme.of(context); return theme.brightness == Brightness.dark ? Color.alphaBlend( - AppColors.penDark.composerUtilityOverlay, + AppColors.of(theme).composerUtilityOverlay, theme.colorScheme.surface, ) : theme.colorScheme.surfaceContainerLow; @@ -572,8 +919,9 @@ abstract final class AppTheme { } /// Match the glyph size, rather than the editable line's leading. - static double inputCursorHeight(BuildContext context) => - MediaQuery.textScalerOf(context).scale(inputTextStyle(context).fontSize!); + static double inputCursorHeight(BuildContext context, {TextStyle? style}) => + MediaQuery.textScalerOf(context) + .scale(inputTextStyle(context, style: style).fontSize!); static double composerCursorHeight(BuildContext context) => MediaQuery.textScalerOf(context) @@ -624,8 +972,8 @@ abstract final class AppTheme { surfaceContainerLowest: palette.background, surfaceContainerLow: palette.sidebar, surfaceContainer: palette.card, - surfaceContainerHigh: palette.accent, - surfaceContainerHighest: palette.accent, + surfaceContainerHigh: palette._legacy ? palette.accent : palette.card, + surfaceContainerHighest: palette._legacy ? palette.accent : palette.card, surfaceTint: Colors.transparent, outline: palette.ring, outlineVariant: palette.border, @@ -718,6 +1066,12 @@ abstract final class AppTheme { color: palette.mutedForeground, size: AppIconSize.standard, ), + actionIconTheme: ActionIconThemeData( + backButtonIconBuilder: (_) => const Icon(AppIcons.arrowBack), + closeButtonIconBuilder: (_) => const Icon(AppIcons.close), + drawerButtonIconBuilder: (_) => const Icon(AppIcons.menu), + endDrawerButtonIconBuilder: (_) => const Icon(AppIcons.menu), + ), iconButtonTheme: IconButtonThemeData( style: _iconButtonStyle(palette.foreground, brightness) .merge(buttonStyle) @@ -774,7 +1128,10 @@ abstract final class AppTheme { horizontal: AppSpacing.controlHorizontal, vertical: AppSpacing.inputVertical, ), - hintStyle: text.bodyMedium?.copyWith(color: palette.mutedForeground), + hintStyle: text.bodyMedium?.copyWith( + color: palette.mutedForeground, + leadingDistribution: TextLeadingDistribution.even, + ), labelStyle: text.bodyMedium?.copyWith(color: palette.mutedForeground), errorStyle: text.bodySmall?.copyWith(color: palette.destructive), ), @@ -787,11 +1144,17 @@ abstract final class AppTheme { style: buttonStyle.copyWith( backgroundColor: WidgetStateProperty.resolveWith( (states) => states.contains(WidgetState.disabled) - ? palette.buttonBackground.withValues(alpha: 0.5) - : palette.buttonBackground, + ? palette.filledButtonBackground.withValues(alpha: 0.5) + : palette.filledButtonBackground, + ), + foregroundColor: WidgetStatePropertyAll( + palette.filledButtonForeground, + ), + side: WidgetStatePropertyAll( + BorderSide( + color: palette._legacy ? palette.buttonBorder : palette.primary, + ), ), - foregroundColor: WidgetStatePropertyAll(palette.foreground), - side: WidgetStatePropertyAll(BorderSide(color: palette.buttonBorder)), ), ), outlinedButtonTheme: OutlinedButtonThemeData( @@ -944,6 +1307,7 @@ abstract final class AppTheme { trackBorderColor: const WidgetStatePropertyAll(Colors.transparent), ), extensions: [ + _AppPaletteData(palette), AppSurfaces( previewBackground: Colors.black, composerBackground: palette.composer, @@ -991,93 +1355,177 @@ abstract final class AppTheme { } } -/// Pen colors with editor-specific workspace and side-panel surfaces. +/// Workspace surfaces and semantic colors. Pen presets remain compatible with +/// existing integrations; selectable palettes share one surface hierarchy. enum AppColors { penLight, - penDark; + penDark, + graphiteLight, + graphiteDark, + violetLight, + violetDark, + tealLight, + tealDark; - bool get _dark => this == penDark; + bool get _legacy => index < 2; + bool get _dark => index.isOdd; Brightness get brightness => _dark ? Brightness.dark : Brightness.light; - Color get background => switch (this) { - penLight => const Color(0xFFF6F6F6), - penDark => const Color(0xFF111111), + static AppColors forPalette(AppPalette palette, Brightness brightness) { + final dark = brightness == Brightness.dark; + return switch (palette) { + AppPalette.graphite => dark ? graphiteDark : graphiteLight, + AppPalette.violet => dark ? violetDark : violetLight, + AppPalette.teal => dark ? tealDark : tealLight, + }; + } + + static AppColors of(ThemeData theme) => + theme.extension<_AppPaletteData>()?.colors ?? + (theme.brightness == Brightness.dark ? penDark : penLight); + + AppPalette get family => switch (this) { + violetLight || violetDark => AppPalette.violet, + tealLight || tealDark => AppPalette.teal, + _ => AppPalette.graphite, }; - Color get foreground => switch (this) { - penDark => const Color(0xFFFCFCFC), - penLight => const Color(0xFF020202), - }; - Color get card => switch (this) { - penLight => const Color(0xFFFAFAFA), - penDark => const Color(0xFF27272A), - }; - Color get popover => _dark ? const Color(0xFF242424) : card; - Color get sidebar => switch (this) { - penLight => const Color(0xFFFAFAFA), - // Project sidebar sampled from Codex's opaque-window screenshot (2026-09-28). - penDark => const Color(0xFF151515), - }; - Color get primary => switch (this) { - penLight => const Color(0xFF18181B), - penDark => const Color(0xFFF4F4F5), - }; - Color get primaryForeground => switch (this) { - penLight => const Color(0xFFFAFAFA), - penDark => const Color(0xFF18181B), - }; - Color get accent => switch (this) { - penDark => const Color(0xFF3F3F46), - penLight => const Color(0xFFECECEE), - }; - Color get mutedForeground => switch (this) { - penLight => const Color(0xFF71717A), - penDark => const Color(0xFFFCFCFC).withValues(alpha: 0.71), - }; - Color get ring => const Color(0xFF3B82F6); - Color get border => switch (this) { - penLight => const Color(0xFFE4E4E7), - penDark => const Color(0xFFFCFCFC).withValues(alpha: 0.084), - }; - Color get divider => _dark ? const Color(0xFF303030) : border; - Color get input => switch (this) { - penLight => const Color(0x0A020202), - penDark => const Color(0x1AC8C8C8), - }; - Color get inputFill => switch (this) { - penLight => const Color(0x0A020202), - penDark => const Color(0x1AC8C8C8), - }; - Color get buttonBackground => switch (this) { - penLight => const Color(0xFFFAFAFA), - penDark => const Color(0xFF18181B), - }; - Color get buttonBorder => switch (this) { - penLight => const Color(0xFFE4E4E7), - penDark => const Color(0xFF38383C), + + (Color, Color, Color, Color) get _surfaces => switch ((family, _dark)) { + (AppPalette.graphite, false) => ( + const Color(0xFFF3F3F3), + const Color(0xFFFAFAFA), + const Color(0xFFFFFFFF), + const Color(0xFFDDDDDD), + ), + (AppPalette.graphite, true) => ( + const Color(0xFF181818), + const Color(0xFF202020), + const Color(0xFF282828), + const Color(0xFF363636), + ), + (AppPalette.violet, false) => ( + const Color(0xFFF3F3F5), + const Color(0xFFFAFAFA), + const Color(0xFFFFFFFF), + const Color(0xFFDEDEE3), + ), + (AppPalette.violet, true) => ( + const Color(0xFF19191C), + const Color(0xFF222226), + const Color(0xFF2B2B30), + const Color(0xFF393940), + ), + (AppPalette.teal, false) => ( + const Color(0xFFF4F3F0), + const Color(0xFFFAF9F6), + const Color(0xFFFFFFFF), + const Color(0xFFDEDBD5), + ), + (AppPalette.teal, true) => ( + const Color(0xFF1C1B19), + const Color(0xFF252420), + const Color(0xFF2E2D29), + const Color(0xFF3D3B35), + ), }; + + Color get background => _legacy + ? (_dark ? const Color(0xFF111111) : const Color(0xFFF6F6F6)) + : _surfaces.$1; + Color get foreground => _legacy + ? (_dark ? const Color(0xFFFCFCFC) : const Color(0xFF020202)) + : (_dark ? const Color(0xFFEEEEEE) : const Color(0xFF242424)); + Color get card => _legacy + ? (_dark ? const Color(0xFF27272A) : const Color(0xFFFAFAFA)) + : _surfaces.$3; + Color get popover => _legacy && _dark ? const Color(0xFF242424) : card; + Color get sidebar => _legacy + ? (_dark ? const Color(0xFF151515) : const Color(0xFFFAFAFA)) + : _surfaces.$2; + Color get primary => _legacy + ? (_dark ? const Color(0xFFF4F4F5) : const Color(0xFF18181B)) + : ring; + Color get primaryForeground => _legacy + ? (_dark ? const Color(0xFF18181B) : const Color(0xFFFAFAFA)) + : (_dark ? const Color(0xFF111111) : Colors.white); + Color get accent => _legacy + ? (_dark ? const Color(0xFF3F3F46) : const Color(0xFFECECEE)) + : Color.alphaBlend(foreground.withValues(alpha: .06), sidebar); + Color get mutedForeground => _legacy + ? (_dark + ? const Color(0xFFFCFCFC).withValues(alpha: .71) + : const Color(0xFF71717A)) + : (_dark ? const Color(0xFFAAAAAA) : const Color(0xFF666666)); + Color get ring => _legacy + ? const Color(0xFF3B82F6) + : switch ((family, _dark)) { + (AppPalette.graphite, false) => const Color(0xFF2563EB), + (AppPalette.graphite, true) => const Color(0xFF6B9FFF), + (AppPalette.violet, false) => const Color(0xFF6D4BD1), + (AppPalette.violet, true) => const Color(0xFFAD9AF2), + (AppPalette.teal, false) => const Color(0xFF147566), + (AppPalette.teal, true) => const Color(0xFF76C5B0), + }; + Color get border => _legacy + ? (_dark + ? const Color(0xFFFCFCFC).withValues(alpha: .084) + : const Color(0xFFE4E4E7)) + : _surfaces.$4; + Color get divider => _legacy && _dark ? const Color(0xFF303030) : border; + Color get input => _legacy + ? (_dark ? const Color(0x1AC8C8C8) : const Color(0x0A020202)) + : border; + Color get inputFill => _legacy ? input : card; + Color get buttonBackground => _legacy + ? (_dark ? const Color(0xFF18181B) : const Color(0xFFFAFAFA)) + : sidebar; + Color get filledButtonBackground => _legacy ? buttonBackground : primary; + Color get filledButtonForeground => _legacy ? foreground : primaryForeground; + Color get buttonBorder => _legacy && _dark ? const Color(0xFF38383C) : border; Color get destructive => _dark ? const Color(0xFFFF6467) : const Color(0xFFE7000B); Color get destructiveBackground => - destructive.withValues(alpha: _dark ? 0.2 : 0.1); - - Color get visualClip => _dark ? const Color(0xFF2F2F2F) : accent; - Color get composer => _dark ? const Color(0xFF2F2F2F) : background; + destructive.withValues(alpha: _dark ? .2 : .1); + Color get visualClip => _legacy + ? (_dark ? const Color(0xFF2F2F2F) : accent) + : (_dark ? const Color(0xFF304053) : const Color(0xFFD8E3F0)); + Color get audioClip => _legacy + ? popover + : (_dark ? const Color(0xFF2D4740) : const Color(0xFFD5E8E2)); + Color get audioWaveform => _legacy + ? mutedForeground + : (_dark ? const Color(0xFF9AD3BE) : const Color(0xFF28624D)); + Color get selection => _legacy ? foreground : ring; + Color get composer => + _legacy ? (_dark ? const Color(0xFF2F2F2F) : background) : card; Color get composerUtilityOverlay => _dark ? foreground.withValues(alpha: .032) : Colors.transparent; - Color get dialogBorder => _dark ? const Color(0xFF3C3C3C) : border; + Color get dialogBorder => _legacy && _dark ? const Color(0xFF3C3C3C) : border; Color get dialogInputBackground => - _dark ? const Color(0xFF262626) : background; - Color get dialogFocusBorder => _dark ? const Color(0xFF6084AF) : ring; - Color get dialogActionBackground => - _dark ? const Color(0xFF2B2B2B) : const Color(0xFFF0F0F0); - Color get settingsSidebar => _dark ? const Color(0xFF141414) : card; - Color get settingsContainer => _dark ? const Color(0xFF1C1C1C) : card; - Color get settingsBorder => _dark ? const Color(0xFF2E2E2E) : border; + _legacy ? (_dark ? const Color(0xFF262626) : background) : card; + Color get dialogFocusBorder => + _legacy && _dark ? const Color(0xFF6084AF) : ring; + Color get dialogActionBackground => _legacy + ? (_dark ? const Color(0xFF2B2B2B) : const Color(0xFFF0F0F0)) + : sidebar; + Color get settingsSidebar => + _legacy && _dark ? const Color(0xFF141414) : sidebar; + Color get settingsContainer => + _legacy && _dark ? const Color(0xFF1C1C1C) : card; + Color get settingsBorder => + _legacy && _dark ? const Color(0xFF2E2E2E) : border; Color get settingsControlBackground => - _dark ? const Color(0xFF262626) : background; - Color get settingsSwitchTrack => - _dark ? const Color(0xFF333333) : const Color(0xFFD0D0D0); + _legacy ? (_dark ? const Color(0xFF262626) : background) : card; + Color get settingsSwitchTrack => _legacy + ? (_dark ? const Color(0xFF333333) : const Color(0xFFD0D0D0)) + : border; static const settingsSwitchAccent = Color(0xFF007AFF); + Color get settingsSwitchColor => _legacy ? settingsSwitchAccent : primary; + Color settingsSwitchThumb(Set states) => _legacy + ? Colors.white + : states.contains(WidgetState.selected) + ? primaryForeground + : foreground; AppSidebarColors resolveSidebarColors( ColorScheme colors, { @@ -1105,6 +1553,19 @@ enum AppColors { } } +class _AppPaletteData extends ThemeExtension<_AppPaletteData> { + const _AppPaletteData(this.colors); + final AppColors colors; + + @override + _AppPaletteData copyWith({AppColors? colors}) => + _AppPaletteData(colors ?? this.colors); + + @override + _AppPaletteData lerp(covariant _AppPaletteData? other, double t) => + other == null || t < .5 ? this : other; +} + /// Styles with product semantics that Material's built-in themes do not expose. @immutable class AppSurfaces extends ThemeExtension { @@ -1227,9 +1688,7 @@ class AppSidebarColors { static AppSidebarColors of(BuildContext context) { final theme = Theme.of(context); - final palette = theme.brightness == Brightness.dark - ? AppColors.penDark - : AppColors.penLight; + final palette = AppColors.of(theme); return palette.resolveSidebarColors( theme.colorScheme, disabledColor: theme.disabledColor, @@ -1282,6 +1741,64 @@ abstract final class AppSettingsMetrics { static const cardRadius = 16.0; } +/// Desktop geometry is separate from touch component defaults. +abstract final class AppDesktopMetrics { + static const windowHeader = 44.0; + static const panelHeader = 36.0; + static const timelineTabs = 32.0; + static const timelineTabControl = 26.0; + static const timelineTabRadius = 7.0; + static const timelineToolbar = 36.0; + static const timelineRuler = 28.0; + static const playbackBar = 36.0; + static const iconButton = 28.0; + static const button = 32.0; + static const input = 36.0; + static const sidebarRow = 32.0; + static const panelPadding = 12.0; +} + +/// Window project tabs have their own geometry, separate from timeline tabs. +abstract final class AppProjectTabMetrics { + static const height = 28.0; + static const close = 24.0; + static const radius = 6.0; + static const gap = 4.0; + static const minWidth = 112.0; + static const maxWidth = 180.0; +} + +/// Geometry for desktop parameter editing, independent of general inputs. +abstract final class AppInspectorMetrics { + static const input = 28.0; + static const action = 24.0; + static const rowGap = 4.0; + static const groupGap = 12.0; + static const padding = 12.0; +} + +class InspectorControlDensity extends ThemeExtension { + const InspectorControlDensity(); + @override + InspectorControlDensity copyWith() => this; + @override + InspectorControlDensity lerp( + covariant InspectorControlDensity? other, + double t, + ) => this; +} + +class DesktopControlDensity extends ThemeExtension { + const DesktopControlDensity(); + @override + DesktopControlDensity copyWith() => this; + @override + DesktopControlDensity lerp( + covariant DesktopControlDensity? other, + double t, + ) => this; +} + abstract final class AppControlSize { static const compact = 24.0; static const small = 24.0; diff --git a/packages/cutdex_ui/lib/src/widgets/app_combobox.dart b/packages/cutdex_ui/lib/src/widgets/app_combobox.dart index 0c7a431..5441471 100644 --- a/packages/cutdex_ui/lib/src/widgets/app_combobox.dart +++ b/packages/cutdex_ui/lib/src/widgets/app_combobox.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import '../icons/app_icons.dart'; import 'app_menu.dart'; import '../theme/app_theme.dart'; @@ -31,6 +32,7 @@ class _AppComboboxState extends State> { final _focus = FocusNode(); final _input = TextEditingController(); final _firstOption = GlobalKey(); + final _menuStorage = PageStorageBucket(); String _query = ''; String get _selectedLabel => @@ -122,121 +124,146 @@ class _AppComboboxState extends State> { builder: (context, constraints) { final theme = Theme.of(context); final colors = theme.colorScheme; + final inputStyle = AppTheme.inputTextStyle( + context, + style: AppTheme.isDesktop(context) + ? theme.textTheme.bodyMedium + : theme.textTheme.bodyLarge, + ); final width = constraints.hasBoundedWidth ? constraints.maxWidth : 240.0; final filtered = _filtered; - return MenuAnchor( - controller: _menu, - childFocusNode: _focus, - consumeOutsideTap: false, - crossAxisUnconstrained: false, - alignmentOffset: const Offset(0, 4), - style: AppMenuStyle.selectPanel(context, minWidth: width).copyWith( - maximumSize: const WidgetStatePropertyAll(Size(double.infinity, 320)), - ), - onClose: _restore, - menuChildren: [ - if (filtered.isEmpty) AppMenuLabel(widget.emptyLabel), - for (var i = 0; i < filtered.length; i++) - Builder( - key: i == 0 ? _firstOption : null, - builder: (_) { - final option = filtered[i]; - return AppMenuItem( - label: option.label, - selected: option.value == widget.value, - selectOption: true, - requestFocusOnHover: false, - onPressed: widget.onChanged == null || !option.enabled - ? null - : () => widget.onChanged!(option.value), - ); - }, + return PageStorage( + bucket: _menuStorage, + child: MenuAnchor( + controller: _menu, + childFocusNode: _focus, + consumeOutsideTap: false, + crossAxisUnconstrained: false, + alignmentOffset: const Offset(0, 4), + style: AppMenuStyle.selectPanel(context, minWidth: width).copyWith( + maximumSize: const WidgetStatePropertyAll( + Size(double.infinity, 320), ), - ], - child: Semantics( - label: widget.label, - child: SizedBox( - width: width, - child: Focus( - canRequestFocus: false, - onKeyEvent: _handleKey, - child: Opacity( - opacity: widget.onChanged == null ? .5 : 1, - child: Container( - constraints: const BoxConstraints( - minHeight: AppControlSize.input, - ), - padding: const EdgeInsetsDirectional.only( - start: AppSpacing.compact, - end: AppSpacing.tiny, - ), - decoration: BoxDecoration( - color: AppTheme.comboboxBackground(context), - borderRadius: BorderRadius.circular(AppRadius.large), - border: Border.all(color: colors.outlineVariant), - boxShadow: [ - BoxShadow( - color: colors.shadow.withValues(alpha: .05), - offset: const Offset(0, 1), - blurRadius: 2, - ), - ], - ), - child: Row( - children: [ - Expanded( - child: TextField( - controller: _input, - focusNode: _focus, - enabled: widget.onChanged != null, - onTap: _open, - onTapAlwaysCalled: true, - onChanged: (text) { - setState(() => _query = text); - if (!_menu.isOpen) _menu.open(); - }, - style: theme.textTheme.bodyLarge, - decoration: InputDecoration( - constraints: const BoxConstraints( - minHeight: AppControlSize.input - 2, + ), + onClose: _restore, + menuChildren: [ + if (filtered.isEmpty) AppMenuLabel(widget.emptyLabel), + for (var i = 0; i < filtered.length; i++) + Builder( + key: i == 0 ? _firstOption : null, + builder: (_) { + final option = filtered[i]; + return AppMenuItem( + label: option.label, + selected: option.value == widget.value, + selectOption: true, + requestFocusOnHover: false, + onPressed: widget.onChanged == null || !option.enabled + ? null + : () => widget.onChanged!(option.value), + ); + }, + ), + ], + child: Semantics( + label: widget.label, + child: SizedBox( + width: width, + child: Focus( + canRequestFocus: false, + onKeyEvent: _handleKey, + child: Opacity( + opacity: widget.onChanged == null ? .5 : 1, + child: Container( + constraints: BoxConstraints( + minHeight: AppTheme.isDesktop(context) + ? theme.inputDecorationTheme.constraints?.minHeight ?? + AppDesktopMetrics.input + : AppControlSize.input, + ), + padding: const EdgeInsetsDirectional.only( + start: AppSpacing.compact, + end: AppSpacing.tiny, + ), + decoration: BoxDecoration( + color: AppTheme.comboboxBackground(context), + borderRadius: BorderRadius.circular(AppRadius.large), + border: Border.all(color: colors.outlineVariant), + boxShadow: [ + BoxShadow( + color: colors.shadow.withValues(alpha: .05), + offset: const Offset(0, 1), + blurRadius: 2, + ), + ], + ), + child: Row( + children: [ + Expanded( + child: TextField( + controller: _input, + focusNode: _focus, + enabled: widget.onChanged != null, + onTap: _open, + onTapAlwaysCalled: true, + onChanged: (text) { + setState(() => _query = text); + if (!_menu.isOpen) _menu.open(); + }, + style: inputStyle, + cursorHeight: AppTheme.inputCursorHeight( + context, + style: inputStyle, ), - hintText: widget.searchHint, - isDense: true, - filled: false, - contentPadding: const EdgeInsets.symmetric( - vertical: AppSpacing.inputVertical - 2, + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + constraints: const BoxConstraints( + minHeight: AppControlSize.input - 2, + ), + hintText: widget.searchHint, + hintStyle: AppTheme.inputHintStyle( + context, + style: inputStyle, + ), + isDense: true, + filled: false, + contentPadding: const EdgeInsets.symmetric( + vertical: AppSpacing.inputVertical - 2, + ), + border: InputBorder.none, + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + disabledBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, ), - border: InputBorder.none, - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - disabledBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, ), ), - ), - IconButton( - tooltip: null, - onPressed: widget.onChanged == null - ? null - : () => _menu.isOpen ? _menu.close() : _open(), - style: IconButton.styleFrom( - overlayColor: Colors.transparent, - minimumSize: const Size.square( - AppControlSize.input - 2, + IconButton( + tooltip: null, + onPressed: widget.onChanged == null + ? null + : () => _menu.isOpen ? _menu.close() : _open(), + style: IconButton.styleFrom( + overlayColor: Colors.transparent, + minimumSize: const Size.square( + AppControlSize.input - 2, + ), + padding: const EdgeInsets.all( + AppSpacing.inputVertical, + ), + tapTargetSize: MaterialTapTargetSize.shrinkWrap, ), - padding: const EdgeInsets.all( - AppSpacing.inputVertical, + icon: Icon( + AppIcons.expandMore, + size: 16, + color: colors.onSurfaceVariant.withValues( + alpha: .5, + ), ), - tapTargetSize: MaterialTapTargetSize.shrinkWrap, ), - icon: Icon( - Icons.expand_more, - size: 16, - color: colors.onSurfaceVariant.withValues(alpha: .5), - ), - ), - ], + ], + ), ), ), ), diff --git a/packages/cutdex_ui/lib/src/widgets/app_command_toolbar.dart b/packages/cutdex_ui/lib/src/widgets/app_command_toolbar.dart new file mode 100644 index 0000000..e720fdf --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/app_command_toolbar.dart @@ -0,0 +1,111 @@ +import 'package:flutter/material.dart'; + +import '../icons/app_icons.dart'; +import '../theme/app_theme.dart'; +import 'app_menu.dart'; +import 'app_popover.dart'; + +class AppToolbarCommand { + const AppToolbarCommand({ + required this.label, + required this.icon, + required this.onPressed, + this.key, + this.semanticLabel, + }); + final String label; + final IconData icon; + final VoidCallback? onPressed; + final Key? key; + final String? semanticLabel; +} + +/// Keeps primary commands and view controls visible when a panel narrows. +class AppCommandToolbar extends StatelessWidget { + const AppCommandToolbar({ + super.key, + required this.groups, + this.trailing = const [], + this.status, + }); + final List> groups; + final List trailing; + final Widget? status; + + Widget _button(AppToolbarCommand command) => IconButton( + key: command.key, + tooltip: command.label, + onPressed: command.onPressed, + icon: Icon(command.icon, semanticLabel: command.semanticLabel, size: 16), + style: IconButton.styleFrom( + fixedSize: const Size.square(AppDesktopMetrics.iconButton), + minimumSize: const Size.square(AppDesktopMetrics.iconButton), + maximumSize: const Size.square(AppDesktopMetrics.iconButton), + padding: EdgeInsets.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(AppRadius.small)), + ), + ), + ); + + @override + Widget build(BuildContext context) => LayoutBuilder( + builder: (context, constraints) { + final commands = groups.expand((group) => group).toList(); + final reserved = trailing.length * 32 + (status == null ? 0 : 24); + final groupSpace = (groups.length - 1).clamp(0, groups.length) * 16; + final allFit = + constraints.maxWidth >= commands.length * 32 + groupSpace + reserved; + final visibleCount = allFit + ? commands.length + : ((constraints.maxWidth - reserved - groupSpace - 36) / 32) + .floor() + .clamp(0, commands.length); + final hidden = commands.skip(visibleCount).toList(); + var index = 0; + return Row( + children: [ + for (final group in groups) ...[ + if (index > 0 && index < visibleCount) + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: SizedBox(height: 16, child: VerticalDivider(width: 1)), + ), + for (final command in group) + if (index++ < visibleCount) ...[ + _button(command), + const SizedBox(width: 4), + ], + ], + if (hidden.isNotEmpty) + AppPopover( + width: 240, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + for (final command in hidden) + AppMenuItem( + label: command.label, + icon: command.icon, + onPressed: command.onPressed, + ), + ], + ), + builder: (context, toggle) => _button( + AppToolbarCommand( + key: const Key('toolbar-overflow'), + label: MaterialLocalizations.of(context).moreButtonTooltip, + icon: AppIcons.more, + onPressed: toggle, + ), + ), + ), + const Spacer(), + for (final command in trailing) _button(command), + ?status, + ], + ); + }, + ); +} diff --git a/packages/cutdex_ui/lib/src/widgets/app_command_toolbar_previews.dart b/packages/cutdex_ui/lib/src/widgets/app_command_toolbar_previews.dart new file mode 100644 index 0000000..73a6f8f --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/app_command_toolbar_previews.dart @@ -0,0 +1,86 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../icons/app_icons.dart'; +import '../theme/app_palette.dart'; +import '../theme/app_theme.dart'; +import 'app_command_toolbar.dart'; + +@Preview( + name: 'Timeline commands — light', + group: 'Desktop workspace', + size: Size(480, 36), +) +Widget desktopTimelineToolbarLightPreview() => + _toolbarPreview(Brightness.light); + +@Preview( + name: 'Timeline commands — dark', + group: 'Desktop workspace', + size: Size(480, 36), +) +@Preview( + name: 'Narrow timeline commands', + group: 'Desktop workspace', + size: Size(180, 36), +) +Widget desktopTimelineToolbarPreview() => _toolbarPreview(Brightness.dark); + +Widget _toolbarPreview(Brightness brightness) => MaterialApp( + debugShowCheckedModeBanner: false, + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(AppPalette.graphite, brightness), + ), + home: Scaffold(body: desktopTimelineCommands()), +); + +Widget desktopTimelineCommands() => Material( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: AppCommandToolbar( + groups: [ + [ + AppToolbarCommand( + label: 'Undo', + icon: AppIcons.undo, + onPressed: () {}, + ), + const AppToolbarCommand( + label: 'Redo', + icon: AppIcons.redo, + onPressed: null, + ), + ], + [ + AppToolbarCommand( + label: 'Split', + icon: AppIcons.cut, + onPressed: () {}, + ), + AppToolbarCommand( + label: 'Trim left', + icon: AppIcons.alignLeft, + onPressed: () {}, + ), + AppToolbarCommand( + label: 'Trim right', + icon: AppIcons.alignRight, + onPressed: () {}, + ), + AppToolbarCommand( + label: 'Delete', + icon: AppIcons.delete, + onPressed: () {}, + ), + ], + ], + trailing: [ + AppToolbarCommand( + label: 'Fit timeline', + icon: AppIcons.fitContent, + onPressed: () {}, + ), + ], + ), + ), +); diff --git a/packages/cutdex_ui/lib/src/widgets/app_dialog.dart b/packages/cutdex_ui/lib/src/widgets/app_dialog.dart index 8fd67d3..824c3ed 100644 --- a/packages/cutdex_ui/lib/src/widgets/app_dialog.dart +++ b/packages/cutdex_ui/lib/src/widgets/app_dialog.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import '../icons/app_icons.dart'; import '../theme/app_theme.dart'; Future showAppDialog({ @@ -307,7 +308,10 @@ class AppDialog extends StatelessWidget { ), ), ), - icon: const Icon(Icons.close, size: AppIconSize.header), + icon: const Icon( + AppIcons.close, + size: AppIconSize.header, + ), ), ), ), diff --git a/packages/cutdex_ui/lib/src/widgets/app_floating_dialog.dart b/packages/cutdex_ui/lib/src/widgets/app_floating_dialog.dart new file mode 100644 index 0000000..070f79b --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/app_floating_dialog.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; + +import '../theme/app_theme.dart'; + +/// A rounded, non-modal dialog surface positioned by its parent. +class AppFloatingDialog extends StatelessWidget { + const AppFloatingDialog({ + super.key, + required this.child, + this.backgroundColor, + this.shape, + }); + + final Widget child; + final Color? backgroundColor; + final ShapeBorder? shape; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final background = + backgroundColor ?? + theme.dialogTheme.backgroundColor ?? + theme.colorScheme.surfaceContainer; + return Theme( + data: theme.copyWith( + canvasColor: background, + colorScheme: theme.colorScheme.copyWith(surface: background), + ), + child: Material( + color: background, + surfaceTintColor: Colors.transparent, + elevation: 8, + shadowColor: theme.colorScheme.shadow, + shape: + shape ?? + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(AppRadius.dialog), + side: BorderSide( + color: theme.dividerColor, + width: theme.dividerTheme.thickness ?? 1, + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + ); + } +} diff --git a/packages/cutdex_ui/lib/src/widgets/app_floating_dialog_previews.dart b/packages/cutdex_ui/lib/src/widgets/app_floating_dialog_previews.dart new file mode 100644 index 0000000..3ad2f43 --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/app_floating_dialog_previews.dart @@ -0,0 +1,83 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../icons/app_icons.dart'; +import '../theme/app_theme.dart'; +import 'app_floating_dialog.dart'; + +@Preview(name: 'Floating input — light', group: 'Dialogs', size: Size(600, 140)) +Widget floatingInputLightPreview() => _inputPreview(AppTheme.penLight); + +@Preview(name: 'Floating input — dark', group: 'Dialogs', size: Size(600, 140)) +Widget floatingInputDarkPreview() => _inputPreview(AppTheme.penDark); + +Widget _inputPreview(ThemeData theme) => MaterialApp( + theme: theme, + debugShowCheckedModeBanner: false, + home: Scaffold( + body: Center( + child: SizedBox( + width: 560, + child: AppFloatingDialog( + shape: const StadiumBorder(), + backgroundColor: theme.extension()!.composerBackground, + child: Builder( + builder: (context) => Padding( + padding: const EdgeInsets.all(AppSpacing.small), + child: Row( + children: [ + IconButton( + style: _controlStyle(), + onPressed: () {}, + icon: const Icon(AppIcons.add), + ), + Expanded( + child: TextField( + minLines: 1, + maxLines: 1, + style: AppTheme.composerTextStyle(context), + cursorHeight: AppTheme.composerCursorHeight(context), + textAlignVertical: TextAlignVertical.center, + decoration: AppTheme.composerInputDecoration.copyWith( + hintText: 'Message Agent…', + hintStyle: AppTheme.composerHintStyle(context), + isDense: true, + constraints: const BoxConstraints( + minHeight: AppControlSize.headerButton, + ), + contentPadding: const EdgeInsets.symmetric( + horizontal: AppSpacing.small, + vertical: AppSpacing.tiny, + ), + ), + ), + ), + IconButton( + style: _controlStyle(), + onPressed: () {}, + icon: const Icon(AppIcons.model), + ), + IconButton.filled( + style: AppTheme.accentIconButtonStyle(context) + .merge(_controlStyle()), + onPressed: () {}, + icon: const Icon(AppIcons.arrowUp), + ), + ], + ), + ), + ), + ), + ), + ), + ), +); + +ButtonStyle _controlStyle() => IconButton.styleFrom( + minimumSize: const Size.square(AppControlSize.headerButton), + maximumSize: const Size.square(AppControlSize.headerButton), + fixedSize: const Size.square(AppControlSize.headerButton), + iconSize: AppIconSize.header, + padding: EdgeInsets.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, +); diff --git a/packages/cutdex_ui/lib/src/widgets/app_menu.dart b/packages/cutdex_ui/lib/src/widgets/app_menu.dart index e3b1792..1647ceb 100644 --- a/packages/cutdex_ui/lib/src/widgets/app_menu.dart +++ b/packages/cutdex_ui/lib/src/widgets/app_menu.dart @@ -2,10 +2,12 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import '../icons/app_icons.dart'; import '../theme/app_theme.dart'; import '../theme/menu_metrics.dart'; import 'native_context_menu.dart'; import 'app_combobox.dart'; +import 'menu_trigger_focus.dart'; part 'app_menu.freezed.dart'; @@ -203,7 +205,7 @@ class _AppMenuItemState extends State { ? null : SizedBox.square( dimension: AppMenuMetrics.iconSize, - child: widget.selected! ? const Icon(Icons.check) : null, + child: widget.selected! ? const Icon(AppIcons.check) : null, ), child: widget.selectOption ? Row( @@ -219,7 +221,7 @@ class _AppMenuItemState extends State { SizedBox.square( dimension: 16, child: widget.selected == true - ? const Icon(Icons.check, size: 16) + ? const Icon(AppIcons.check, size: 16) : null, ), ], @@ -261,7 +263,7 @@ class AppMenuSeparator extends StatelessWidget { horizontal: AppMenuMetrics.iconGap, vertical: AppMenuMetrics.separatorVerticalPadding, ), - child: Divider(height: 1, thickness: 1), + child: Divider(height: 1), ); } @@ -335,53 +337,67 @@ class AppDropdownMenu extends StatefulWidget { } class _AppDropdownMenuState extends State { - final _focus = FocusNode(); final _controller = MenuController(); + late final _triggerFocus = MenuTriggerFocus(controller: _controller); + FocusNode get _focus => _triggerFocus.node; final _entryKey = GlobalKey(); + // MenuAnchor owns a scroll view. Do not let its offset read or overwrite + // an enclosing inspector's expansion state or scroll position. + final _menuStorage = PageStorageBucket(); @override void dispose() { - _focus.dispose(); + _triggerFocus.dispose(); super.dispose(); } @override - Widget build(BuildContext context) => MenuAnchor( - controller: _controller, - childFocusNode: _focus, - consumeOutsideTap: true, - crossAxisUnconstrained: widget.crossAxisUnconstrained, - alignmentOffset: widget.alignmentOffset, - style: - (widget.menuStyle ?? - AppMenuStyle.panel(context, minWidth: widget.minWidth)) - .copyWith( - maximumSize: widget.maxHeight == null - ? null - : WidgetStatePropertyAll( - Size(double.infinity, widget.maxHeight!), - ), - ), - onClose: widget.onClose, - onOpen: () => _focusMenu(_entryKey), - menuChildren: [ - for (var i = 0; i < widget.items.length; i++) - if (i == 0) - Builder(key: _entryKey, builder: (_) => widget.items[i]) - else - widget.items[i], - ], - builder: (context, controller, _) => Shortcuts( - shortcuts: const { - SingleActivator(LogicalKeyboardKey.arrowDown): ActivateIntent(), + Widget build(BuildContext context) => PageStorage( + bucket: _menuStorage, + child: MenuAnchor( + controller: _controller, + childFocusNode: _focus, + // Close on outside clicks without swallowing the target control's action. + consumeOutsideTap: false, + crossAxisUnconstrained: widget.crossAxisUnconstrained, + alignmentOffset: widget.alignmentOffset, + style: + (widget.menuStyle ?? + AppMenuStyle.panel(context, minWidth: widget.minWidth)) + .copyWith( + maximumSize: widget.maxHeight == null + ? null + : WidgetStatePropertyAll( + Size(double.infinity, widget.maxHeight!), + ), + ), + onClose: () { + _triggerFocus.onClose(); + widget.onClose?.call(); }, - child: widget.builder( - context, - !widget.enabled - ? null - : () { - controller.isOpen ? controller.close() : controller.open(); - }, - _focus, + onOpen: () { + _triggerFocus.onOpen(); + _focusMenu(_entryKey); + }, + menuChildren: [ + for (var i = 0; i < widget.items.length; i++) + if (i == 0) + Builder(key: _entryKey, builder: (_) => widget.items[i]) + else + widget.items[i], + ], + builder: (context, controller, _) => Shortcuts( + shortcuts: const { + SingleActivator(LogicalKeyboardKey.arrowDown): ActivateIntent(), + }, + child: widget.builder( + context, + !widget.enabled + ? null + : () { + controller.isOpen ? controller.close() : controller.open(); + }, + _focus, + ), ), ), ); @@ -495,9 +511,18 @@ class AppSelect extends StatelessWidget { : Size.fromHeight(controlHeight!), minimumSize: Size( 0, - outlined - ? AppControlSize.input - : AppControlSize.small, + controlHeight ?? + (AppTheme.isDesktop(context) + ? outlined + ? theme + .inputDecorationTheme + .constraints + ?.minHeight ?? + AppDesktopMetrics.input + : AppDesktopMetrics.iconButton + : outlined + ? AppControlSize.input + : AppControlSize.small), ), tapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( @@ -530,7 +555,7 @@ class AppSelect extends StatelessWidget { ), const SizedBox(width: AppSpacing.small), Icon( - Icons.expand_more, + AppIcons.expandMore, size: 16, color: colors.onSurfaceVariant.withValues( alpha: .5, @@ -563,6 +588,7 @@ class _AppContextMenuState extends State { final _controller = MenuController(); final _focus = FocusNode(); final _entryKey = GlobalKey(); + final _menuStorage = PageStorageBucket(); Offset _anchorPosition = Offset.zero; bool _focusFirstItem = false; bool _opening = false; @@ -640,17 +666,22 @@ class _AppContextMenuState extends State { Positioned( left: _anchorPosition.dx, top: _anchorPosition.dy, - child: MenuAnchor( - controller: _controller, - childFocusNode: _focus, - consumeOutsideTap: true, - crossAxisUnconstrained: false, - style: AppMenuStyle.panel(context), - onOpen: () { - if (_focusFirstItem) _focusMenu(_entryKey); - }, - menuChildren: _items(context), - child: const IgnorePointer(child: SizedBox.square(dimension: 1)), + child: PageStorage( + bucket: _menuStorage, + child: MenuAnchor( + controller: _controller, + childFocusNode: _focus, + // Nested anchors share their parent's open state. Consuming an + // outside tap here would also block clicks outside that parent. + consumeOutsideTap: false, + crossAxisUnconstrained: false, + style: AppMenuStyle.panel(context), + onOpen: () { + if (_focusFirstItem) _focusMenu(_entryKey); + }, + menuChildren: _items(context), + child: const IgnorePointer(child: SizedBox.square(dimension: 1)), + ), ), ), ], diff --git a/packages/cutdex_ui/lib/src/widgets/app_popover.dart b/packages/cutdex_ui/lib/src/widgets/app_popover.dart index 0efeead..5c3d5c2 100644 --- a/packages/cutdex_ui/lib/src/widgets/app_popover.dart +++ b/packages/cutdex_ui/lib/src/widgets/app_popover.dart @@ -5,6 +5,7 @@ import 'package:flutter/services.dart'; import '../theme/app_theme.dart'; import '../theme/menu_metrics.dart'; +import 'menu_trigger_focus.dart'; /// Anchored shadcn-style surface, dismissed outside or with Escape. class AppPopover extends StatefulWidget { @@ -39,6 +40,18 @@ class AppPopover extends StatefulWidget { class _AppPopoverState extends State { final _menu = MenuController(); + final _triggerScope = FocusScopeNode(); + late final _triggerFocus = MenuTriggerFocus( + controller: _menu, + node: _triggerScope, + ); + final _menuStorage = PageStorageBucket(); + + @override + void dispose() { + _triggerFocus.dispose(); + super.dispose(); + } void _toggle() { if (!widget.enabled) return; @@ -65,90 +78,100 @@ class _AppPopoverState extends State { ); final endAligned = widget.alignment == AlignmentDirectional.bottomEnd; final direction = Directionality.of(context); - return MenuAnchor( - controller: _menu, - alignmentOffset: Offset( - endAligned - ? (direction == TextDirection.ltr ? -surfaceWidth : surfaceWidth) - : 0, - 4, - ), - consumeOutsideTap: false, - crossAxisUnconstrained: false, - clipBehavior: Clip.none, - style: MenuStyle( - alignment: widget.alignment, - padding: const WidgetStatePropertyAll(EdgeInsets.zero), - backgroundColor: const WidgetStatePropertyAll(Colors.transparent), - surfaceTintColor: const WidgetStatePropertyAll(Colors.transparent), - elevation: const WidgetStatePropertyAll(0), - shadowColor: const WidgetStatePropertyAll(Colors.transparent), - // The inner surface owns the border; do not inherit MenuTheme's stroke. - side: const WidgetStatePropertyAll(BorderSide.none), - shape: WidgetStatePropertyAll( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(widget.borderRadius), + return PageStorage( + bucket: _menuStorage, + child: MenuAnchor( + controller: _menu, + childFocusNode: _triggerScope, + onOpen: _triggerFocus.onOpen, + onClose: _triggerFocus.onClose, + alignmentOffset: Offset( + endAligned + ? (direction == TextDirection.ltr ? -surfaceWidth : surfaceWidth) + : 0, + 4, + ), + consumeOutsideTap: false, + crossAxisUnconstrained: false, + clipBehavior: Clip.none, + style: MenuStyle( + alignment: widget.alignment, + padding: const WidgetStatePropertyAll(EdgeInsets.zero), + backgroundColor: const WidgetStatePropertyAll(Colors.transparent), + surfaceTintColor: const WidgetStatePropertyAll(Colors.transparent), + elevation: const WidgetStatePropertyAll(0), + shadowColor: const WidgetStatePropertyAll(Colors.transparent), + // The inner surface owns the border; do not inherit MenuTheme's stroke. + side: const WidgetStatePropertyAll(BorderSide.none), + shape: WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(widget.borderRadius), + ), ), ), - ), - menuChildren: [ - SizedBox( - key: widget.surfaceKey, - width: surfaceWidth, - child: DecoratedBox( - decoration: BoxDecoration( - color: - widget.backgroundColor ?? AppTheme.popoverBackground(context), - borderRadius: BorderRadius.circular(widget.borderRadius), - border: Border.all( - color: colors.outlineVariant, - width: AppMenuMetrics.borderWidth, + menuChildren: [ + SizedBox( + key: widget.surfaceKey, + width: surfaceWidth, + child: DecoratedBox( + decoration: BoxDecoration( + color: + widget.backgroundColor ?? + AppTheme.popoverBackground(context), + borderRadius: BorderRadius.circular(widget.borderRadius), + border: Border.all( + color: colors.outlineVariant, + width: AppMenuMetrics.borderWidth, + ), + boxShadow: [ + BoxShadow( + color: colors.shadow.withValues(alpha: .1), + offset: const Offset(0, 4), + blurRadius: 6, + spreadRadius: -1, + ), + BoxShadow( + color: colors.shadow.withValues(alpha: .1), + offset: const Offset(0, 2), + blurRadius: 4, + spreadRadius: -2, + ), + ], ), - boxShadow: [ - BoxShadow( - color: colors.shadow.withValues(alpha: .1), - offset: const Offset(0, 4), - blurRadius: 6, - spreadRadius: -1, - ), - BoxShadow( - color: colors.shadow.withValues(alpha: .1), - offset: const Offset(0, 2), - blurRadius: 4, - spreadRadius: -2, - ), - ], - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(widget.borderRadius), - child: Padding( - padding: widget.padding, - child: ConstrainedBox( - constraints: BoxConstraints( - maxHeight: math.max( - 0, - math.min(widget.maxHeight, viewport.height - 96), + child: ClipRRect( + borderRadius: BorderRadius.circular(widget.borderRadius), + child: Padding( + padding: widget.padding, + child: ConstrainedBox( + constraints: BoxConstraints( + maxHeight: math.max( + 0, + math.min(widget.maxHeight, viewport.height - 96), + ), + ), + child: Focus( + autofocus: true, + onKeyEvent: (_, event) { + if (event is KeyDownEvent && + event.logicalKey == LogicalKeyboardKey.escape) { + _menu.close(); + return KeyEventResult.handled; + } + return KeyEventResult.ignored; + }, + child: widget.child, ), ), - child: Focus( - autofocus: true, - onKeyEvent: (_, event) { - if (event is KeyDownEvent && - event.logicalKey == LogicalKeyboardKey.escape) { - _menu.close(); - return KeyEventResult.handled; - } - return KeyEventResult.ignored; - }, - child: widget.child, - ), ), ), ), ), + ], + builder: (context, _, _) => FocusScope( + node: _triggerScope, + child: widget.builder(context, _toggle), ), - ], - builder: (context, _, _) => widget.builder(context, _toggle), + ), ); } } diff --git a/packages/cutdex_ui/lib/src/widgets/app_property_group.dart b/packages/cutdex_ui/lib/src/widgets/app_property_group.dart new file mode 100644 index 0000000..54d39ad --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/app_property_group.dart @@ -0,0 +1,52 @@ +import 'package:flutter/material.dart'; + +import '../theme/app_theme.dart'; + +/// An inspector property title, its actions, and the controls below it. +class AppPropertyGroup extends StatelessWidget { + const AppPropertyGroup({ + super.key, + required this.label, + required this.child, + this.labelWidget, + this.actions = const [], + }); + + final String label; + final Widget? labelWidget; + final List actions; + final Widget child; + + @override + Widget build(BuildContext context) => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ConstrainedBox( + constraints: BoxConstraints( + minHeight: AppTheme.isDesktop(context) + ? AppInspectorMetrics.action + : AppControlSize.propertyControl, + ), + child: Row( + children: [ + Expanded( + child: + labelWidget ?? + Text( + label, + style: AppTheme.propertySectionTitleStyle(context), + ), + ), + for (final action in actions) ...[ + SizedBox(width: AppTheme.propertyRowGap(context)), + action, + ], + ], + ), + ), + SizedBox(height: AppTheme.propertyRowGap(context)), + child, + ], + ); +} diff --git a/packages/cutdex_ui/lib/src/widgets/app_property_group_previews.dart b/packages/cutdex_ui/lib/src/widgets/app_property_group_previews.dart new file mode 100644 index 0000000..7c2bd66 --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/app_property_group_previews.dart @@ -0,0 +1,134 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../icons/app_icons.dart'; +import '../theme/app_palette.dart'; +import '../theme/app_theme.dart'; +import 'app_property_group.dart'; +import 'app_text_field.dart'; + +@Preview( + name: 'Property groups — light', + group: 'Desktop inspector', + size: Size(280, 240), +) +Widget propertyGroupsLightPreview() => _preview(Brightness.light); + +@Preview( + name: 'Property groups — dark', + group: 'Desktop inspector', + size: Size(280, 240), +) +@Preview( + name: 'Narrow property groups', + group: 'Desktop inspector', + size: Size(220, 240), +) +Widget propertyGroupsDarkPreview() => _preview(Brightness.dark); + +Widget _preview(Brightness brightness) => MaterialApp( + debugShowCheckedModeBanner: false, + theme: AppTheme.propertiesPanelTheme( + AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(AppPalette.graphite, brightness), + ), + ), + home: const Scaffold(body: _PropertyGroupsPreview()), +); + +class _PropertyGroupsPreview extends StatefulWidget { + const _PropertyGroupsPreview(); + @override + State<_PropertyGroupsPreview> createState() => _PropertyGroupsPreviewState(); +} + +class _PropertyGroupsPreviewState extends State<_PropertyGroupsPreview> { + final _values = [ + TextEditingController(text: '0'), + TextEditingController(text: '0'), + TextEditingController(text: '100'), + TextEditingController(text: '100'), + TextEditingController(text: '0'), + ]; + bool _locked = true; + final _keyed = {}; + + @override + void dispose() { + for (final value in _values) { + value.dispose(); + } + super.dispose(); + } + + Widget _keyframe(int channel) => IconButton( + tooltip: 'Toggle keyframe', + isSelected: _keyed.contains(channel), + icon: const Icon(AppIcons.square, size: 12), + onPressed: () => setState(() { + if (!_keyed.add(channel)) _keyed.remove(channel); + }), + ); + + Widget _pair(String a, String b, int index, {String? unit}) => Row( + children: [ + Expanded( + child: AppTextField(label: a, unit: unit, controller: _values[index]), + ), + const SizedBox(width: 4), + Expanded( + child: AppTextField( + label: b, + unit: unit, + controller: _values[index + 1], + ), + ), + ], + ); + + @override + Widget build(BuildContext context) => SingleChildScrollView( + child: Column( + children: [ + for (final group in [ + AppPropertyGroup( + label: '位置', + actions: [_keyframe(0)], + child: _pair('X', 'Y', 0), + ), + AppPropertyGroup( + label: '缩放', + actions: [ + IconButton( + tooltip: 'Lock aspect ratio', + isSelected: _locked, + icon: const Icon(AppIcons.unlock), + selectedIcon: const Icon(AppIcons.lockFilled), + onPressed: () => setState(() => _locked = !_locked), + ), + _keyframe(1), + ], + child: _pair('W', 'H', 2, unit: '%'), + ), + AppPropertyGroup( + label: '旋转', + actions: [_keyframe(2)], + child: AppTextField( + label: '旋转', + leading: const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Icon(AppIcons.angle, size: 14), + ), + unit: '°', + controller: _values[4], + ), + ), + ]) + Padding( + padding: AppTheme.propertySectionPadding(context), + child: group, + ), + ], + ), + ); +} diff --git a/packages/cutdex_ui/lib/src/widgets/app_scrub_label.dart b/packages/cutdex_ui/lib/src/widgets/app_scrub_label.dart index b031e3d..2d749d4 100644 --- a/packages/cutdex_ui/lib/src/widgets/app_scrub_label.dart +++ b/packages/cutdex_ui/lib/src/widgets/app_scrub_label.dart @@ -15,9 +15,17 @@ class AppScrubLabel extends StatefulWidget { required this.onUpdate, required this.onEnd, required this.onCancel, + this.padding = const EdgeInsets.symmetric(horizontal: AppSpacing.small), + this.alignment = Alignment.center, + this.style, + this.icon, }); final String label; + final EdgeInsetsGeometry padding; + final AlignmentGeometry alignment; + final TextStyle? style; + final IconData? icon; final bool enabled; final bool Function() onStart; final ValueChanged onUpdate; @@ -104,16 +112,27 @@ class _AppScrubLabelState extends State { }, onHorizontalDragCancel: _cancel, child: Align( + alignment: widget.alignment, widthFactor: 1, heightFactor: 1, child: Padding( - padding: const EdgeInsets.symmetric(horizontal: AppSpacing.small), - child: Text( - widget.label, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), - ), + padding: widget.padding, + child: widget.icon == null + ? Text( + widget.label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: + widget.style ?? AppTheme.propertyLabelStyle(context), + ) + : Icon( + widget.icon, + size: 14, + color: + (widget.style ?? AppTheme.propertyLabelStyle(context)) + .color, + semanticLabel: widget.label, + ), ), ), ), diff --git a/packages/cutdex_ui/lib/src/widgets/app_slider.dart b/packages/cutdex_ui/lib/src/widgets/app_slider.dart index 1be0e7a..256e146 100644 --- a/packages/cutdex_ui/lib/src/widgets/app_slider.dart +++ b/packages/cutdex_ui/lib/src/widgets/app_slider.dart @@ -34,7 +34,11 @@ class AppSlider extends StatelessWidget { final colors = theme.colorScheme; final accent = colors.primary; return SizedBox( - height: AppControlSize.standard, + height: AppTheme.isCompactInspector(context) + ? AppInspectorMetrics.input + : AppTheme.isDesktop(context) + ? AppDesktopMetrics.input + : AppControlSize.standard, child: SliderTheme( data: SliderTheme.of(context).copyWith( trackHeight: 4, diff --git a/packages/cutdex_ui/lib/src/widgets/app_text_field.dart b/packages/cutdex_ui/lib/src/widgets/app_text_field.dart index 09a671a..eda4604 100644 --- a/packages/cutdex_ui/lib/src/widgets/app_text_field.dart +++ b/packages/cutdex_ui/lib/src/widgets/app_text_field.dart @@ -2,14 +2,17 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import '../theme/app_theme.dart'; +import 'app_property_group.dart'; -/// Shared inline-labelled input built on Flutter's native text editing. +/// Native input with inline prefixes and optional property group titles. class AppTextField extends StatefulWidget { const AppTextField({ super.key, this.controller, this.focusNode, this.label, + this.labelAbove = false, + this.labelActions = const [], this.leading, this.unit, this.hintText, @@ -31,6 +34,8 @@ class AppTextField extends StatefulWidget { final TextEditingController? controller; final FocusNode? focusNode; final String? label; + final bool labelAbove; + final List labelActions; final Widget? leading; final String? unit; final String? hintText; @@ -66,132 +71,143 @@ class _AppTextFieldState extends State { final focusColor = colors.primary; final borderless = theme.inputDecorationTheme.enabledBorder?.borderSide == BorderSide.none; - final style = theme.textTheme.bodyMedium!.copyWith( - color: foreground, - letterSpacing: 0, - ); + final style = AppTheme.inputTextStyle(context) + .copyWith(color: foreground, letterSpacing: 0); OutlineInputBorder border(Color color) => OutlineInputBorder( borderRadius: BorderRadius.circular(AppRadius.large), borderSide: BorderSide(color: color), ); + final labelAbove = + widget.labelAbove && (widget.label != null || widget.leading != null); + final input = TextField( + controller: widget.controller, + focusNode: widget.focusNode, + enabled: widget.enabled, + readOnly: widget.readOnly, + canRequestFocus: widget.canRequestFocus, + keyboardType: widget.keyboardType, + inputFormatters: widget.inputFormatters, + minLines: widget.minLines, + maxLines: widget.maxLines, + textInputAction: widget.textInputAction, + style: style, + cursorColor: focusColor, + cursorHeight: AppTheme.inputCursorHeight(context), + cursorWidth: 1, + textAlignVertical: widget.maxLines == 1 + ? TextAlignVertical.center + : TextAlignVertical.top, + decoration: InputDecoration( + isDense: true, + filled: true, + fillColor: theme.inputDecorationTheme.fillColor, + hoverColor: Colors.transparent, + hintText: widget.hintText, + hintStyle: AppTheme.inputHintStyle(context, style: style), + errorText: widget.errorText, + errorMaxLines: 2, + contentPadding: + theme.inputDecorationTheme.contentPadding ?? + const EdgeInsets.symmetric( + horizontal: AppSpacing.controlHorizontal, + vertical: AppSpacing.inputVertical, + ), + prefixIcon: labelAbove + ? null + : widget.leading ?? + (widget.label == null + ? null + : Align( + widthFactor: 1, + heightFactor: 1, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: AppSpacing.small, + ), + child: ExcludeSemantics( + child: Text( + widget.label!, + style: AppTheme.propertyLabelStyle(context) + .copyWith( + color: widget.enabled + ? colors.onSurfaceVariant + : foreground, + ), + ), + ), + ), + )), + prefixIconConstraints: const BoxConstraints( + minWidth: AppControlSize.standard, + minHeight: AppControlSize.input, + ), + suffixIcon: widget.unit == null + ? null + : Align( + widthFactor: 1, + heightFactor: 1, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: AppSpacing.small, + ), + child: ExcludeSemantics( + child: Text( + widget.unit!, + style: style.copyWith( + color: widget.enabled + ? colors.onSurfaceVariant + : foreground, + ), + ), + ), + ), + ), + suffixIconConstraints: const BoxConstraints( + minWidth: AppControlSize.compact, + minHeight: AppControlSize.input, + ), + border: theme.inputDecorationTheme.border, + enabledBorder: borderless + ? theme.inputDecorationTheme.enabledBorder + : border( + _hovered + ? colors.outline + : theme + .inputDecorationTheme + .enabledBorder + ?.borderSide + .color ?? + colors.outlineVariant, + ), + disabledBorder: theme.inputDecorationTheme.disabledBorder, + focusedBorder: theme.inputDecorationTheme.focusedBorder, + errorBorder: borderless + ? theme.inputDecorationTheme.errorBorder + : border(colors.error), + focusedErrorBorder: borderless + ? theme.inputDecorationTheme.focusedErrorBorder + : border(colors.error), + ), + onChanged: widget.onChanged, + onEditingComplete: widget.onEditingComplete, + onSubmitted: widget.onSubmitted, + onTapOutside: widget.onTapOutside, + ); + return MouseRegion( onEnter: (_) => setState(() => _hovered = true), onExit: (_) => setState(() => _hovered = false), child: Semantics( label: [widget.label, widget.unit].whereType().join(' '), - child: TextField( - controller: widget.controller, - focusNode: widget.focusNode, - enabled: widget.enabled, - readOnly: widget.readOnly, - canRequestFocus: widget.canRequestFocus, - keyboardType: widget.keyboardType, - inputFormatters: widget.inputFormatters, - minLines: widget.minLines, - maxLines: widget.maxLines, - textInputAction: widget.textInputAction, - style: style, - cursorColor: focusColor, - cursorHeight: AppTheme.inputCursorHeight(context), - cursorWidth: 1, - textAlignVertical: TextAlignVertical.center, - decoration: InputDecoration( - isDense: true, - filled: true, - fillColor: theme.inputDecorationTheme.fillColor, - hoverColor: Colors.transparent, - hintText: widget.hintText, - hintStyle: - theme.inputDecorationTheme.hintStyle ?? - style.copyWith(color: colors.onSurfaceVariant), - errorText: widget.errorText, - errorMaxLines: 2, - contentPadding: - theme.inputDecorationTheme.contentPadding ?? - const EdgeInsets.symmetric( - horizontal: AppSpacing.controlHorizontal, - vertical: AppSpacing.inputVertical, - ), - prefixIcon: - widget.leading ?? - (widget.label == null - ? null - : Align( - widthFactor: 1, - heightFactor: 1, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: AppSpacing.small, - ), - child: ExcludeSemantics( - child: Text( - widget.label!, - style: style.copyWith( - color: widget.enabled - ? colors.onSurfaceVariant - : foreground, - ), - ), - ), - ), - )), - prefixIconConstraints: const BoxConstraints( - minWidth: AppControlSize.standard, - minHeight: AppControlSize.input, - ), - suffixIcon: widget.unit == null - ? null - : Align( - widthFactor: 1, - heightFactor: 1, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: AppSpacing.small, - ), - child: ExcludeSemantics( - child: Text( - widget.unit!, - style: style.copyWith( - color: widget.enabled - ? colors.onSurfaceVariant - : foreground, - ), - ), - ), - ), - ), - suffixIconConstraints: const BoxConstraints( - minWidth: AppControlSize.compact, - minHeight: AppControlSize.input, - ), - border: theme.inputDecorationTheme.border, - enabledBorder: borderless - ? theme.inputDecorationTheme.enabledBorder - : border( - _hovered - ? colors.outline - : theme - .inputDecorationTheme - .enabledBorder - ?.borderSide - .color ?? - colors.outlineVariant, - ), - disabledBorder: theme.inputDecorationTheme.disabledBorder, - focusedBorder: theme.inputDecorationTheme.focusedBorder, - errorBorder: borderless - ? theme.inputDecorationTheme.errorBorder - : border(colors.error), - focusedErrorBorder: borderless - ? theme.inputDecorationTheme.focusedErrorBorder - : border(colors.error), - ), - onChanged: widget.onChanged, - onEditingComplete: widget.onEditingComplete, - onSubmitted: widget.onSubmitted, - onTapOutside: widget.onTapOutside, - ), + child: labelAbove + ? AppPropertyGroup( + label: widget.label ?? '', + labelWidget: widget.leading, + actions: widget.labelActions, + child: input, + ) + : input, ), ); } diff --git a/packages/cutdex_ui/lib/src/widgets/compact_panel_tabs.dart b/packages/cutdex_ui/lib/src/widgets/compact_panel_tabs.dart index 9e0c6c5..ea1a573 100644 --- a/packages/cutdex_ui/lib/src/widgets/compact_panel_tabs.dart +++ b/packages/cutdex_ui/lib/src/widgets/compact_panel_tabs.dart @@ -24,9 +24,15 @@ class CompactPanelTabs extends StatelessWidget { @override Widget build(BuildContext context) => SizedBox( - height: height, + height: AppTheme.isDesktop(context) + ? AppDesktopMetrics.panelHeader + : height, child: Padding( - padding: padding, + padding: + AppTheme.isDesktop(context) && + padding == const EdgeInsets.all(AppSpacing.gap) + ? const EdgeInsets.symmetric(horizontal: 8, vertical: 4) + : padding, child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Row( diff --git a/packages/cutdex_ui/lib/src/widgets/menu_trigger_focus.dart b/packages/cutdex_ui/lib/src/widgets/menu_trigger_focus.dart new file mode 100644 index 0000000..22e5da8 --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/menu_trigger_focus.dart @@ -0,0 +1,67 @@ +import 'dart:async'; + +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +/// Keeps keyboard focus while releasing a pointer-operated menu's highlight. +class MenuTriggerFocus { + MenuTriggerFocus({required this.controller, FocusNode? node}) + : node = node ?? FocusNode(); + + final MenuController controller; + final FocusNode node; + bool _keyboardClose = false; + bool _disposed = false; + bool _listening = false; + + void onOpen() { + _keyboardClose = + LogicalKeyboardKey.collapseSynonyms( + HardwareKeyboard.instance.logicalKeysPressed, + ).difference({ + LogicalKeyboardKey.alt, + LogicalKeyboardKey.control, + LogicalKeyboardKey.meta, + LogicalKeyboardKey.shift, + }).isNotEmpty; + if (_listening) return; + _listening = true; + GestureBinding.instance.pointerRouter.addGlobalRoute(_onPointer); + HardwareKeyboard.instance.addHandler(_onKey); + } + + void _onPointer(PointerEvent event) { + if (event is PointerDownEvent) _keyboardClose = false; + } + + bool _onKey(KeyEvent event) { + if (event is KeyDownEvent) _keyboardClose = true; + return false; + } + + void _stopListening() { + if (!_listening) return; + _listening = false; + GestureBinding.instance.pointerRouter.removeGlobalRoute(_onPointer); + HardwareKeyboard.instance.removeHandler(_onKey); + } + + void onClose() { + WidgetsBinding.instance.addPostFrameCallback((_) { + // Menu disposal restores focus at the end of the frame. Let that update + // and the closing input event finish before clearing pointer focus. + scheduleMicrotask(() { + if (_disposed || controller.isOpen) return; + _stopListening(); + if (!_keyboardClose && node.hasFocus) node.unfocus(); + }); + }); + } + + void dispose() { + _disposed = true; + _stopListening(); + node.dispose(); + } +} diff --git a/packages/cutdex_ui/lib/src/widgets/timeline_controls_previews.dart b/packages/cutdex_ui/lib/src/widgets/timeline_controls_previews.dart new file mode 100644 index 0000000..be31e6f --- /dev/null +++ b/packages/cutdex_ui/lib/src/widgets/timeline_controls_previews.dart @@ -0,0 +1,161 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widget_previews.dart'; + +import '../icons/app_icons.dart'; +import '../theme/app_palette.dart'; +import '../theme/app_theme.dart'; +import 'app_command_toolbar.dart'; + +@Preview( + name: 'Rounded timeline tabs — light', + group: 'Desktop workspace', + size: Size(480, 68), +) +Widget roundedTimelineControlsLightPreview() => _preview(Brightness.light); + +@Preview( + name: 'Rounded timeline tabs — dark', + group: 'Desktop workspace', + size: Size(480, 68), +) +@Preview( + name: 'Rounded timeline tabs — narrow', + group: 'Desktop workspace', + size: Size(240, 68), +) +Widget roundedTimelineControlsDarkPreview() => _preview(Brightness.dark); + +Widget _preview(Brightness brightness) => MaterialApp( + debugShowCheckedModeBanner: false, + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(AppPalette.graphite, brightness), + ), + home: const Scaffold(body: _TimelineControlsPreview()), +); + +class _TimelineControlsPreview extends StatefulWidget { + const _TimelineControlsPreview(); + + @override + State<_TimelineControlsPreview> createState() => + _TimelineControlsPreviewState(); +} + +class _TimelineControlsPreviewState extends State<_TimelineControlsPreview> { + final _timelines = ['Main edit', 'Portrait', 'Outtakes']; + String _selected = 'Main edit'; + + @override + Widget build(BuildContext context) => Column( + children: [ + ColoredBox( + color: AppTheme.timelineTabsBackground(context), + child: SizedBox( + height: AppDesktopMetrics.timelineTabs, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSpacing.tiny), + child: Row( + children: [ + Expanded( + child: Align( + alignment: AlignmentDirectional.centerStart, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Flexible( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + for (final name in _timelines) + Padding( + padding: const EdgeInsetsDirectional.only( + end: AppSpacing.hairline, + ), + child: Semantics( + selected: name == _selected, + child: TextButton( + style: AppTheme.timelineTabStyle( + context, + selected: name == _selected, + ), + onPressed: () => + setState(() => _selected = name), + child: Text(name), + ), + ), + ), + ], + ), + ), + ), + IconButton( + tooltip: 'New timeline', + style: AppTheme.timelineTabActionStyle, + onPressed: () => setState(() { + final name = 'Timeline ${_timelines.length + 1}'; + _timelines.add(name); + _selected = name; + }), + icon: const Icon(AppIcons.add, size: 16), + ), + ], + ), + ), + ), + IconButton( + tooltip: 'All timelines', + style: AppTheme.timelineTabActionStyle, + onPressed: () {}, + icon: const Icon(AppIcons.more, size: 16), + ), + ], + ), + ), + ), + ), + SizedBox( + height: AppDesktopMetrics.timelineToolbar, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: AppSpacing.small), + child: AppCommandToolbar( + groups: [ + [ + AppToolbarCommand( + label: 'Undo', + icon: AppIcons.undo, + onPressed: () {}, + ), + const AppToolbarCommand( + label: 'Redo', + icon: AppIcons.redo, + onPressed: null, + ), + ], + [ + for (final command in [ + ('Split', AppIcons.cut), + ('Trim left', AppIcons.alignLeft), + ('Trim right', AppIcons.alignRight), + ('Delete', AppIcons.delete), + ]) + AppToolbarCommand( + label: command.$1, + icon: command.$2, + onPressed: () {}, + ), + ], + ], + trailing: [ + AppToolbarCommand( + label: 'Fit timeline', + icon: AppIcons.fitContent, + onPressed: () {}, + ), + ], + ), + ), + ), + ], + ); +} diff --git a/packages/cutdex_ui/lib/src/widgets/workspace_panel.dart b/packages/cutdex_ui/lib/src/widgets/workspace_panel.dart index 38e5b7b..2fa1185 100644 --- a/packages/cutdex_ui/lib/src/widgets/workspace_panel.dart +++ b/packages/cutdex_ui/lib/src/widgets/workspace_panel.dart @@ -10,7 +10,7 @@ class WorkspacePanel extends StatelessWidget { required this.child, this.trailing, this.controls, - this.headerHeight = AppControlSize.panelHeader, + this.headerHeight, this.headerPadding = const EdgeInsets.symmetric( horizontal: AppSpacing.compact, ), @@ -23,7 +23,7 @@ class WorkspacePanel extends StatelessWidget { final Widget child; final Widget? trailing; final Widget? controls; - final double headerHeight; + final double? headerHeight; final EdgeInsetsGeometry headerPadding; final bool showHeaderDivider; final bool paintBackground; @@ -34,7 +34,11 @@ class WorkspacePanel extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox( - height: headerHeight, + height: + headerHeight ?? + (AppTheme.isDesktop(context) + ? AppDesktopMetrics.panelHeader + : AppControlSize.panelHeader), child: Padding( padding: headerPadding, child: Row( diff --git a/packages/cutdex_ui/lib/theme.dart b/packages/cutdex_ui/lib/theme.dart index 163de14..17bb0f7 100644 --- a/packages/cutdex_ui/lib/theme.dart +++ b/packages/cutdex_ui/lib/theme.dart @@ -1,2 +1,3 @@ +export 'src/theme/app_palette.dart'; export 'src/theme/app_theme.dart'; export 'src/theme/menu_metrics.dart'; diff --git a/packages/cutdex_ui/lib/widgets.dart b/packages/cutdex_ui/lib/widgets.dart index aa3a59e..cae9889 100644 --- a/packages/cutdex_ui/lib/widgets.dart +++ b/packages/cutdex_ui/lib/widgets.dart @@ -2,6 +2,7 @@ export 'src/widgets/app_button_group.dart'; export 'src/widgets/app_combobox.dart'; export 'src/widgets/app_dialog.dart'; export 'src/widgets/app_field.dart'; +export 'src/widgets/app_floating_dialog.dart'; export 'src/widgets/app_item.dart'; export 'src/widgets/app_menu.dart'; export 'src/widgets/app_popover.dart'; @@ -17,3 +18,5 @@ export 'src/widgets/native_context_menu.dart'; export 'src/widgets/scroll_edge_fade.dart'; export 'src/widgets/workspace_panel.dart'; export 'src/widgets/resource_download_progress.dart'; +export 'src/widgets/app_command_toolbar.dart'; +export 'src/widgets/app_property_group.dart'; diff --git a/packages/cutdex_ui/pubspec.yaml b/packages/cutdex_ui/pubspec.yaml index 1d2d6fb..1618ff1 100644 --- a/packages/cutdex_ui/pubspec.yaml +++ b/packages/cutdex_ui/pubspec.yaml @@ -16,3 +16,13 @@ dev_dependencies: flutter_lints: ^6.0.0 build_runner: ^2.16.1 freezed: ^4.0.2 +flutter: + fonts: + - family: PhosphorRegular + fonts: + - asset: assets/fonts/PhosphorRegular.ttf + - family: PhosphorFill + fonts: + - asset: assets/fonts/PhosphorFill.ttf + assets: + - assets/fonts/PHOSPHOR_LICENSE.txt diff --git a/packages/cutdex_ui/test/app_command_toolbar_test.dart b/packages/cutdex_ui/test/app_command_toolbar_test.dart new file mode 100644 index 0000000..c2a83ed --- /dev/null +++ b/packages/cutdex_ui/test/app_command_toolbar_test.dart @@ -0,0 +1,80 @@ +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('overflow keeps view controls visible and runs hidden commands', ( + tester, + ) async { + var deleted = 0; + var fitted = 0; + final commands = [ + const AppToolbarCommand( + label: 'Undo', + icon: AppIcons.undo, + onPressed: null, + ), + AppToolbarCommand(label: 'Redo', icon: AppIcons.redo, onPressed: () {}), + AppToolbarCommand(label: 'Split', icon: AppIcons.cut, onPressed: () {}), + AppToolbarCommand( + label: 'Trim left', + icon: AppIcons.alignLeft, + onPressed: () {}, + ), + AppToolbarCommand( + label: 'Trim right', + icon: AppIcons.alignRight, + onPressed: () {}, + ), + AppToolbarCommand( + label: 'Delete', + icon: AppIcons.delete, + onPressed: () => deleted++, + ), + ]; + Widget toolbar(double width) => MaterialApp( + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(AppPalette.graphite, Brightness.dark), + ), + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + height: 36, + child: AppCommandToolbar( + groups: [commands.take(2).toList(), commands.skip(2).toList()], + trailing: [ + AppToolbarCommand( + label: 'Fit', + icon: AppIcons.fitContent, + onPressed: () => fitted++, + ), + ], + ), + ), + ), + ), + ); + for (final width in [128.0, 180.0, 200.0, 240.0, 480.0]) { + await tester.pumpWidget(toolbar(width)); + expect(tester.takeException(), isNull); + expect( + find.widgetWithIcon(IconButton, AppIcons.fitContent), + findsOneWidget, + ); + } + expect(find.byKey(const Key('toolbar-overflow')), findsNothing); + await tester.pumpWidget(toolbar(180)); + await tester.tap(find.widgetWithIcon(IconButton, AppIcons.fitContent)); + expect(fitted, 1); + await tester.tap(find.byKey(const Key('toolbar-overflow'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('Delete')); + await tester.pumpAndSettle(); + expect(deleted, 1); + expect(tester.takeException(), isNull); + }); +} diff --git a/packages/cutdex_ui/test/app_icons_test.dart b/packages/cutdex_ui/test/app_icons_test.dart new file mode 100644 index 0000000..adef5a3 --- /dev/null +++ b/packages/cutdex_ui/test/app_icons_test.dart @@ -0,0 +1,153 @@ +import 'dart:ui' as ui; + +import 'package:cutdex_ui/cutdex_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + setUpAll(() async { + for (final family in ['PhosphorRegular', 'PhosphorFill']) { + final loader = FontLoader('packages/cutdex_ui/$family') + ..addFont( + rootBundle.load('packages/cutdex_ui/assets/fonts/$family.ttf'), + ); + await loader.load(); + } + }); + + testWidgets('bundled fonts render distinct glyphs and filled shapes', ( + tester, + ) async { + final close = await renderIcon(tester, AppIcons.close); + final check = await renderIcon(tester, AppIcons.check); + final star = await renderIcon(tester, AppIcons.star); + final filledStar = await renderIcon(tester, AppIcons.starFilled); + + // Missing fonts would render identical fallback boxes for these codepoints. + expect(close, isNot(orderedEquals(check))); + expect(paintedPixels(close), greaterThan(0)); + expect(paintedPixels(star), greaterThan(0)); + expect(paintedPixels(filledStar), greaterThan(paintedPixels(star))); + }); + + testWidgets('IconData works in WorkspacePanel and inherits IconTheme', ( + tester, + ) async { + await tester.pumpWidget( + const MaterialApp( + home: IconTheme( + data: IconThemeData(color: Colors.purple), + child: WorkspacePanel( + title: 'Media', + icon: AppIcons.video, + child: SizedBox(), + ), + ), + ), + ); + final icon = find.byIcon(AppIcons.video); + expect(icon, findsOneWidget); + final text = tester.widget( + find.descendant(of: icon, matching: find.byType(RichText)), + ); + expect(text.text.style!.color, Colors.purple); + expect(text.text.style!.fontFamily, 'packages/cutdex_ui/PhosphorRegular'); + expect(tester.takeException(), isNull); + }); + + testWidgets('RTL mirrors navigation while preserving playback direction', ( + tester, + ) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.rtl, + child: Row(children: [Icon(AppIcons.arrowBack), Icon(AppIcons.play)]), + ), + ); + expect( + find.descendant( + of: find.byIcon(AppIcons.arrowBack), + matching: find.byType(Transform), + ), + findsOneWidget, + ); + expect( + find.descendant( + of: find.byIcon(AppIcons.play), + matching: find.byType(Transform), + ), + findsNothing, + ); + }); + + testWidgets('workspace themes replace implicit Material action icons', ( + tester, + ) async { + var backPressed = 0; + for (final theme in [AppTheme.penLight, AppTheme.penDark]) { + await tester.pumpWidget( + MaterialApp( + theme: theme, + home: Scaffold( + body: Row( + children: [ + BackButton(onPressed: () => backPressed++), + CloseButton(onPressed: () {}), + const DrawerButton(), + const EndDrawerButton(), + ], + ), + ), + ), + ); + expect(find.byIcon(AppIcons.arrowBack), findsOneWidget); + expect(find.byIcon(AppIcons.close), findsOneWidget); + expect(find.byIcon(AppIcons.menu), findsNWidgets(2)); + expect(find.byTooltip('Back'), findsOneWidget); + await tester.tap(find.byIcon(AppIcons.arrowBack)); + } + expect(backPressed, 2); + }); +} + +Future renderIcon(WidgetTester tester, IconData icon) async { + final key = GlobalKey(); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: RepaintBoundary( + key: key, + child: SizedBox.square( + dimension: 48, + child: Icon(icon, size: 48, color: Colors.black), + ), + ), + ), + ), + ); + final boundary = + key.currentContext!.findRenderObject()! as RenderRepaintBoundary; + final pixels = await tester.runAsync(() async { + final image = await boundary.toImage(); + try { + final data = await image.toByteData(format: ui.ImageByteFormat.rawRgba); + return Uint8List.fromList(data!.buffer.asUint8List()); + } finally { + image.dispose(); + } + }); + return pixels!; +} + +int paintedPixels(Uint8List rgba) { + var result = 0; + for (var index = 3; index < rgba.length; index += 4) { + if (rgba[index] != 0) result++; + } + return result; +} diff --git a/packages/cutdex_ui/test/app_menu_test.dart b/packages/cutdex_ui/test/app_menu_test.dart index 9a31139..64af5eb 100644 --- a/packages/cutdex_ui/test/app_menu_test.dart +++ b/packages/cutdex_ui/test/app_menu_test.dart @@ -1,3 +1,4 @@ +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:flutter/gestures.dart'; @@ -7,6 +8,294 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { + for (final dismissal in ['trigger', 'selection', 'outside']) { + testWidgets( + 'pointer $dismissal dismissal releases menu trigger highlight', + (tester) async { + late FocusNode triggerFocus; + final states = WidgetStatesController(); + addTearDown(states.dispose); + var closed = 0; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.penDark, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: AppDropdownMenu( + onClose: () => closed++, + items: [AppMenuItem(label: 'Action', onPressed: () {})], + builder: (_, toggle, focus) { + triggerFocus = focus; + return TextButton( + focusNode: focus, + statesController: states, + onPressed: toggle, + child: const Text('Open'), + ); + }, + ), + ), + ), + ), + ); + final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); + await mouse.addPointer(location: const Offset(400, 400)); + Future click(Offset point) async { + await mouse.moveTo(point); + await mouse.down(point); + await mouse.up(); + } + + await click(tester.getCenter(find.text('Open'))); + await tester.pumpAndSettle(); + expect(find.text('Action'), findsOneWidget); + switch (dismissal) { + case 'trigger': + await click(tester.getCenter(find.text('Open'))); + case 'selection': + await click(tester.getCenter(find.text('Action'))); + case 'outside': + await click(const Offset(400, 400)); + } + await mouse.moveTo(const Offset(450, 450)); + await tester.pumpAndSettle(); + expect(find.text('Action'), findsNothing); + expect(closed, 1); + expect(triggerFocus.hasFocus, isFalse); + expect(states.value, isNot(contains(WidgetState.focused))); + expect(states.value, isNot(contains(WidgetState.hovered))); + await mouse.removePointer(); + expect(tester.takeException(), isNull); + }, + ); + } + + for (final kind in [PointerDeviceKind.mouse, PointerDeviceKind.touch]) { + testWidgets('dropdown outside $kind click activates buttons and inputs', ( + tester, + ) async { + var outsideClicks = 0; + var menuActions = 0; + final inputFocus = FocusNode(); + addTearDown(inputFocus.dispose); + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.penLight, + home: Scaffold( + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppDropdownMenu( + items: [ + AppMenuItem( + label: 'Menu action', + onPressed: () => menuActions++, + ), + ], + builder: (_, toggle, focus) => TextButton( + focusNode: focus, + onPressed: toggle, + child: const Text('Open menu'), + ), + ), + const SizedBox(height: 200), + TextButton( + onPressed: () => outsideClicks++, + child: const Text('Outside button'), + ), + SizedBox(width: 240, child: TextField(focusNode: inputFocus)), + ], + ), + ), + ), + ); + await tester.tap(find.text('Open menu'), kind: kind); + await tester.pumpAndSettle(); + expect(find.text('Menu action'), findsOneWidget); + await tester.tap(find.text('Outside button'), kind: kind); + await tester.pumpAndSettle(); + expect(find.text('Menu action'), findsNothing); + expect(outsideClicks, 1); + + await tester.tap(find.text('Open menu'), kind: kind); + await tester.pumpAndSettle(); + await tester.tap(find.byType(TextField), kind: kind); + await tester.pumpAndSettle(); + expect(find.text('Menu action'), findsNothing); + expect(inputFocus.hasFocus, isTrue); + expect(menuActions, 0); + expect(tester.takeException(), isNull); + }); + + testWidgets('dropdowns and selects switch on the first $kind click', ( + tester, + ) async { + var selected = 0; + var actions = 0; + Widget dropdown(String name) => AppDropdownMenu( + items: [AppMenuItem(label: '$name action', onPressed: () => actions++)], + builder: (_, toggle, focus) => + TextButton(focusNode: focus, onPressed: toggle, child: Text(name)), + ); + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.penDark, + home: Scaffold( + body: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + dropdown('First'), + dropdown('Second'), + SizedBox( + width: 200, + child: AppSelect( + value: selected, + options: const [ + AppSelectOption(0, 'Automatic'), + AppSelectOption(1, 'Manual'), + ], + onChanged: (next) => selected = next, + label: 'Mode', + emptyLabel: 'No options', + ), + ), + ], + ), + ), + ), + ); + await tester.tap(find.text('First'), kind: kind); + await tester.pumpAndSettle(); + expect(find.text('First action'), findsOneWidget); + await tester.tap(find.text('Second'), kind: kind); + await tester.pumpAndSettle(); + expect(find.text('First action'), findsNothing); + expect(find.text('Second action'), findsOneWidget); + // Clicking the open menu's own trigger still closes it. + await tester.tap(find.text('Second'), kind: kind); + await tester.pumpAndSettle(); + expect(find.text('Second action'), findsNothing); + + await tester.tap(find.text('First'), kind: kind); + await tester.pumpAndSettle(); + await tester.tap( + find.widgetWithText(TextButton, 'Automatic'), + kind: kind, + ); + await tester.pumpAndSettle(); + expect(find.text('First action'), findsNothing); + expect(find.widgetWithText(MenuItemButton, 'Manual'), findsOneWidget); + await tester.tap(find.text('First'), kind: kind); + await tester.pumpAndSettle(); + expect(find.widgetWithText(MenuItemButton, 'Manual'), findsNothing); + expect(find.text('First action'), findsOneWidget); + expect(selected, 0); + + await tester.tap(find.text('First action'), kind: kind); + await tester.pumpAndSettle(); + expect(actions, 1); + expect(find.text('First action'), findsNothing); + expect(tester.takeException(), isNull); + }); + } + + testWidgets('Flutter context menu outside click also activates its target', ( + tester, + ) async { + debugDefaultTargetPlatformOverride = TargetPlatform.windows; + addTearDown(() => debugDefaultTargetPlatformOverride = null); + var outsideClicks = 0; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.penDark, + home: Scaffold( + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppContextMenu( + itemsBuilder: (_) => [ + AppMenuItem(label: 'Context action', onPressed: () {}), + ], + child: const SizedBox(width: 100, height: 100), + ), + const SizedBox(height: 200), + TextButton( + onPressed: () => outsideClicks++, + child: const Text('Outside button'), + ), + ], + ), + ), + ), + ); + await tester.tap( + find.byType(AppContextMenu), + kind: PointerDeviceKind.mouse, + buttons: kSecondaryMouseButton, + ); + await tester.pumpAndSettle(); + expect(find.text('Context action'), findsOneWidget); + await tester.tap( + find.text('Outside button'), + kind: PointerDeviceKind.mouse, + ); + await tester.pumpAndSettle(); + expect(find.text('Context action'), findsNothing); + expect(outsideClicks, 1); + expect(tester.takeException(), isNull); + debugDefaultTargetPlatformOverride = null; + }); + + testWidgets('dropdown offsets do not inherit or overwrite expansion state', ( + tester, + ) async { + final bucket = PageStorageBucket(); + const ancestorKey = PageStorageKey('expanded-property'); + int? selected; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.penDark, + home: Scaffold( + body: PageStorage( + bucket: bucket, + child: Builder( + key: ancestorKey, + builder: (context) { + bucket.writeState(context, true); + return SizedBox( + width: 220, + child: AppSelect( + label: 'Color space', + emptyLabel: 'No options', + value: 0, + options: const [ + AppSelectOption(0, 'Automatic'), + AppSelectOption(1, 'Manual'), + ], + onChanged: (value) => selected = value, + ), + ); + }, + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + for (var i = 0; i < 2; i++) { + await tester.tap(find.text('Automatic')); + await tester.pumpAndSettle(); + expect(tester.takeException(), isNull); + await tester.tap(find.text('Manual')); + await tester.pumpAndSettle(); + expect(selected, 1); + expect(bucket.readState(tester.element(find.byKey(ancestorKey))), isTrue); + expect(tester.takeException(), isNull); + } + }); + testWidgets( 'native menu waits for right-button release and dismissal keeps left clicks working', (tester) async { @@ -248,7 +537,7 @@ void main() { await tester.tap(find.byType(TextButton)); await tester.pumpAndSettle(); expect(tester.takeException(), isNull); - expect(find.byIcon(Icons.check), findsOneWidget); + expect(find.byIcon(AppIcons.check), findsOneWidget); expect( tester.getSize(find.widgetWithText(MenuItemButton, 'Dark')).height, 28, diff --git a/packages/cutdex_ui/test/app_popover_test.dart b/packages/cutdex_ui/test/app_popover_test.dart index 58e3612..7bd5357 100644 --- a/packages/cutdex_ui/test/app_popover_test.dart +++ b/packages/cutdex_ui/test/app_popover_test.dart @@ -1,10 +1,70 @@ import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { + testWidgets('popover clears pointer focus and retains keyboard focus', ( + tester, + ) async { + final focus = FocusNode(); + final states = WidgetStatesController(); + addTearDown(focus.dispose); + addTearDown(states.dispose); + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.penDark, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: AppPopover( + builder: (_, toggle) => TextButton( + focusNode: focus, + statesController: states, + onPressed: toggle, + child: const Text('Open'), + ), + child: const Text('Content'), + ), + ), + ), + ), + ); + final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); + await mouse.addPointer(location: const Offset(400, 400)); + for (final outside in [false, true]) { + final trigger = tester.getCenter(find.text('Open')); + await mouse.moveTo(trigger); + await mouse.down(trigger); + await mouse.up(); + await tester.pumpAndSettle(); + expect(find.text('Content'), findsOneWidget); + final closingPoint = outside ? const Offset(400, 400) : trigger; + await mouse.moveTo(closingPoint); + await mouse.down(closingPoint); + await mouse.up(); + await mouse.moveTo(const Offset(450, 450)); + await tester.pumpAndSettle(); + expect(find.text('Content'), findsNothing); + expect(focus.hasFocus, isFalse); + expect(states.value, isNot(contains(WidgetState.focused))); + expect(states.value, isNot(contains(WidgetState.hovered))); + } + await mouse.removePointer(); + focus.requestFocus(); + await tester.pump(); + await tester.sendKeyEvent(LogicalKeyboardKey.enter); + await tester.pumpAndSettle(); + expect(find.text('Content'), findsOneWidget); + await tester.sendKeyEvent(LogicalKeyboardKey.escape); + await tester.pumpAndSettle(); + expect(find.text('Content'), findsNothing); + expect(focus.hasFocus, isTrue); + expect(tester.takeException(), isNull); + }); + testWidgets( 'popover anchors below its trigger and dismisses outside and with Escape', (tester) async { diff --git a/packages/cutdex_ui/test/app_property_group_test.dart b/packages/cutdex_ui/test/app_property_group_test.dart new file mode 100644 index 0000000..af0f816 --- /dev/null +++ b/packages/cutdex_ui/test/app_property_group_test.dart @@ -0,0 +1,74 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('titles and actions leave the full width for paired fields', ( + tester, + ) async { + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.propertiesPanelTheme( + AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(palette, brightness), + ), + ), + home: Scaffold( + body: SizedBox( + width: 220, + child: Padding( + padding: const EdgeInsets.all(12), + child: AppPropertyGroup( + label: 'Position', + actions: [ + IconButton( + onPressed: () {}, + icon: const Icon(Icons.diamond_outlined), + ), + ], + child: const Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppTextField( + label: 'X', + errorText: 'Invalid value', + ), + ), + SizedBox(width: 4), + Expanded(child: AppTextField(label: 'Y')), + ], + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final first = find.byType(TextField).first; + final second = find.byType(TextField).last; + expect(tester.getRect(first).width, 96); + expect(tester.getRect(second).right, 208); + expect(tester.getRect(first).top, tester.getRect(second).top); + expect( + tester.getRect(first).height, + greaterThan(tester.getRect(second).height), + ); + expect( + tester.getRect(find.byType(IconButton)).bottom, + tester.getRect(first).top - 4, + ); + expect( + tester.widget(first).decoration!.prefixIcon, + isNotNull, + ); + expect(tester.takeException(), isNull); + } + } + await tester.pumpWidget(const SizedBox()); + }); +} diff --git a/packages/cutdex_ui/test/app_theme_test.dart b/packages/cutdex_ui/test/app_theme_test.dart index ac947d8..792ddcd 100644 --- a/packages/cutdex_ui/test/app_theme_test.dart +++ b/packages/cutdex_ui/test/app_theme_test.dart @@ -7,6 +7,167 @@ import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { + testWidgets('slider density follows inspector and desktop contexts', ( + tester, + ) async { + final desktop = AppTheme.desktopWorkspaceTheme(AppTheme.penDark); + for (final (theme, height) in [ + (AppTheme.propertiesPanelTheme(desktop), 28.0), + (desktop, 36.0), + ( + AppTheme.propertiesPanelTheme(AppTheme.penDark), + AppControlSize.standard, + ), + ]) { + await tester.pumpWidget( + MaterialApp( + theme: theme, + home: Scaffold( + body: Center( + child: SizedBox( + width: 220, + child: AppSlider(value: .5, onChanged: (_) {}), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect(tester.getSize(find.byType(AppSlider)).height, height); + expect(tester.takeException(), isNull); + } + }); + + test( + 'inspector density leaves general desktop and touch inputs unchanged', + () { + final desktop = AppTheme.desktopWorkspaceTheme(AppTheme.penDark); + final inspector = AppTheme.propertiesPanelTheme(desktop); + expect(desktop.inputDecorationTheme.constraints!.minHeight, 36); + expect(inspector.inputDecorationTheme.constraints!.minHeight, 28); + expect(inspector.textTheme.bodyMedium!.fontSize, 13); + expect(inspector.textTheme.bodySmall!.fontSize, 12); + expect( + inspector.iconButtonTheme.style!.fixedSize!.resolve({}), + const Size.square(24), + ); + expect(desktop.extension(), isNull); + expect(inspector.extension(), isNotNull); + final dialog = AppTheme.dialogContentTheme(inspector); + expect(dialog.extension(), isNull); + expect(dialog.inputDecorationTheme.constraints!.minHeight, 36); + expect(dialog.textTheme.bodyMedium!.fontSize, 14); + final touch = AppTheme.propertiesPanelTheme(AppTheme.penDark); + expect(touch.extension(), isNull); + expect( + touch.iconButtonTheme.style!.fixedSize!.resolve({}), + const Size.square(28), + ); + }, + ); + + testWidgets('multiline input keeps its first line near the top', ( + tester, + ) async { + final controller = TextEditingController(text: 'First\nSecond'); + addTearDown(controller.dispose); + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme(AppTheme.penDark), + home: Scaffold( + body: Center( + child: SizedBox( + width: 240, + height: 100, + child: AppTextField( + controller: controller, + minLines: 3, + maxLines: 3, + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final editable = tester + .state(find.byType(EditableText)) + .renderEditable; + final caret = editable.getLocalRectForCaret(const TextPosition(offset: 0)); + expect( + editable.localToGlobal(caret.center).dy - + tester.getTopLeft(find.byType(TextField)).dy, + lessThan(25), + ); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets('labelled single-line inputs keep text and caret centered', ( + tester, + ) async { + final controller = TextEditingController(text: '125'); + addTearDown(controller.dispose); + for (final brightness in Brightness.values) { + for (final desktop in [false, true]) { + final base = AppTheme.forPalette(AppPalette.graphite, brightness); + final theme = AppTheme.propertiesPanelTheme( + desktop ? AppTheme.desktopWorkspaceTheme(base) : base, + ); + final height = desktop + ? AppInspectorMetrics.input + : AppControlSize.propertyControl; + await tester.pumpWidget( + MaterialApp( + theme: theme, + home: Scaffold( + body: Center( + child: SizedBox( + width: 240, + height: height, + child: AppTextField( + controller: controller, + label: 'W', + unit: '%', + hintText: 'Value', + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final field = find.byType(TextField); + final label = find.text('W'); + expect( + tester.getRect(label).center.dy, + tester.getRect(field).center.dy, + ); + expect( + tester.widget(field).decoration!.prefixIcon, + isNotNull, + ); + for (final text in ['', '125', '项目']) { + await tester.enterText(field, text); + await tester.pump(); + final editable = tester + .state(find.byType(EditableText)) + .renderEditable; + final caret = editable.getLocalRectForCaret( + TextPosition(offset: text.length), + ); + expect( + editable.localToGlobal(caret.center).dy, + closeTo(tester.getCenter(field).dy, 1), + ); + expect(tester.getSize(field).height, height); + expect(tester.takeException(), isNull); + } + await tester.pumpWidget(const SizedBox()); + } + } + }); + test('Icon button states use translucent ink without stacking selection', () { final style = AppTheme.penDark.iconButtonTheme.style!; const ink = Color(0xFFFCFCFC); diff --git a/packages/cutdex_ui/test/popup_storage_isolation_test.dart b/packages/cutdex_ui/test/popup_storage_isolation_test.dart new file mode 100644 index 0000000..5bf67ae --- /dev/null +++ b/packages/cutdex_ui/test/popup_storage_isolation_test.dart @@ -0,0 +1,129 @@ +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + for (final kind in ['searchable', 'popover', 'context']) { + for (final stored in [true, 120.0]) { + testWidgets('$kind popup isolates ancestor state $stored', ( + tester, + ) async { + final bucket = PageStorageBucket(); + const ancestorKey = PageStorageKey('parent-state'); + Widget popup() => switch (kind) { + 'searchable' => AppSelect( + value: 0, + label: 'Select', + emptyLabel: 'Empty', + searchable: true, + searchHint: 'Search', + onChanged: (_) {}, + options: [ + for (var i = 0; i < 40; i++) AppSelectOption(i, 'Choice $i'), + ], + ), + 'popover' => AppPopover( + builder: (_, toggle) => TextButton( + key: const Key('trigger'), + onPressed: toggle, + child: const Text('Open'), + ), + child: SizedBox( + height: 150, + child: ListView( + primary: false, + children: [ + for (var i = 0; i < 40; i++) + SizedBox(height: 32, child: Text('Choice $i')), + ], + ), + ), + ), + _ => AppContextMenu( + itemsBuilder: (_) => [ + for (var i = 0; i < 40; i++) + AppMenuItem(label: 'Choice $i', onPressed: () {}), + ], + child: const SizedBox( + key: Key('trigger'), + width: 200, + height: 100, + child: ColoredBox(color: Colors.transparent), + ), + ), + }; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.penDark, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: 240, + child: PageStorage( + bucket: bucket, + child: Builder( + key: ancestorKey, + builder: (context) { + bucket.writeState(context, stored); + return popup(); + }, + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + await tester.tap( + kind == 'searchable' + ? find.byType(TextField) + : find.byKey(const Key('trigger')), + buttons: kind == 'context' + ? kSecondaryMouseButton + : kPrimaryMouseButton, + ); + await tester.pumpAndSettle(); + expect(tester.takeException(), isNull); + final positions = tester + .stateList( + find.byWidgetPredicate( + (widget) => + widget is Scrollable && + axisDirectionToAxis(widget.axisDirection) == Axis.vertical, + ), + ) + .map((state) => state.position) + .toList(); + expect(positions, isNotEmpty); + for (final position in positions) { + expect( + position.pixels, + 0, + reason: 'Popup must not restore its parent offset', + ); + } + positions + .firstWhere((position) => position.maxScrollExtent > 50) + .jumpTo(25); + await tester.pumpAndSettle(); + expect( + bucket.readState(tester.element(find.byKey(ancestorKey))), + stored, + ); + await tester.tapAt(const Offset(790, 590)); + await tester.pumpAndSettle(); + expect(find.text('Choice 3'), findsNothing); + expect( + bucket.readState(tester.element(find.byKey(ancestorKey))), + stored, + ); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); + } + } +} diff --git a/packages/cutdex_ui/tool/generate_icons.py b/packages/cutdex_ui/tool/generate_icons.py new file mode 100644 index 0000000..38ab46e --- /dev/null +++ b/packages/cutdex_ui/tool/generate_icons.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +"""Generate Flutter icon constants from a pinned Phosphor font catalog.""" + +import argparse +import hashlib +import json +from pathlib import Path +import re +import sys +from urllib.request import urlopen + + +ROOT = Path(__file__).resolve().parent.parent +SOURCE = ROOT / 'tool/phosphor/catalog.json' +OUTPUT = ROOT / 'lib/src/icons/phosphor_icons.g.dart' +STYLES = { + 'regular': ('Phosphor.ttf', 'PhosphorRegular', 'PhosphorIconsRegular'), + 'fill': ('Phosphor-Fill.ttf', 'PhosphorFill', 'PhosphorIconsFill'), +} +# Mirror navigation only, keeping playback, undo/redo, and logos unchanged. +MIRRORED = {'arrow-left', 'arrow-right', 'caret-left', 'caret-right', + 'caret-double-left', 'caret-double-right'} + + +def read_upstream(revision, path): + url = f'https://raw.githubusercontent.com/phosphor-icons/web/{revision}/{path}' + with urlopen(url, timeout=30) as response: + return response.read() + + +def update_catalog(revision): + if not re.fullmatch(r'[0-9a-f]{40}', revision): + raise ValueError('--update requires a full Git commit SHA') + version = json.loads(read_upstream(revision, 'package.json'))['version'] + catalog = { + 'repository': 'https://github.com/phosphor-icons/web', + 'revision': revision, + 'version': version, + 'styles': {}, + } + # Fetch and validate everything before writing the local snapshot. + assets = {} + for style, (filename, family, _) in STYLES.items(): + selection_path = f'src/{style}/selection.json' + selection = read_upstream(revision, selection_path) + icons = {} + for item in json.loads(selection)['icons']: + properties = item['properties'] + for alias in properties['name'].split(','): + name = alias.strip() + if style == 'fill': + if not name.endswith('-fill'): + raise ValueError(f'Missing fill suffix: {name}') + name = name[:-5] + if name in icons: + raise ValueError(f'Duplicate icon: {name}') + icons[name] = properties['code'] + font_path = f'src/{style}/{filename}' + font = read_upstream(revision, font_path) + local_path = f'assets/fonts/{family}.ttf' + assets[local_path] = font + catalog['styles'][style] = { + 'font': local_path, + 'fontSource': font_path, + 'fontSha256': hashlib.sha256(font).hexdigest(), + 'catalogSource': selection_path, + 'catalogSha256': hashlib.sha256(selection).hexdigest(), + 'icons': dict(sorted(icons.items())), + } + if catalog['styles']['regular']['icons'] != catalog['styles']['fill']['icons']: + raise ValueError('Regular and Fill catalogs do not match') + assets['assets/fonts/PHOSPHOR_LICENSE.txt'] = read_upstream(revision, 'LICENSE') + for path, data in assets.items(): + target = ROOT / path + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(data) + SOURCE.parent.mkdir(parents=True, exist_ok=True) + SOURCE.write_text(json.dumps(catalog, indent=2) + '\n', encoding='utf-8') + + +def dart_name(name): + if not re.fullmatch(r'[a-z][a-z0-9]*(?:-[a-z0-9]+)*', name): + raise ValueError(f'Invalid icon name: {name}') + first, *rest = name.split('-') + result = first + ''.join(part[0].upper() + part[1:] for part in rest) + # Preserve Dart keywords as usable field names. + if result in {'as', 'assert', 'break', 'case', 'catch', 'class', 'const', + 'continue', 'default', 'do', 'else', 'enum', 'extends', 'false', + 'final', 'finally', 'for', 'if', 'in', 'is', 'new', 'null', + 'rethrow', 'return', 'super', 'switch', 'this', 'throw', 'true', + 'try', 'var', 'void', 'while', 'with'}: + result += 'Icon' + return result + + +def generate(catalog): + lines = [ + '// GENERATED CODE - DO NOT MODIFY BY HAND.', + '// Run: python3 tool/generate_icons.py (from packages/cutdex_ui).', + f"// Phosphor web {catalog['version']} @ {catalog['revision']}", + "import 'package:flutter/widgets.dart';", + ] + for style, (_, family, class_name) in STYLES.items(): + source = catalog['styles'][style] + font = (ROOT / source['font']).read_bytes() + if hashlib.sha256(font).hexdigest() != source['fontSha256']: + raise ValueError(f'Font checksum mismatch: {source["font"]}') + lines.extend(['', f'/// Phosphor {style.title()} icons from the pinned font catalog.', + '@staticIconProvider', f'abstract final class {class_name} {{']) + identifiers = set() + for name, codepoint in sorted(source['icons'].items()): + identifier = dart_name(name) + if identifier in identifiers: + raise ValueError(f'Duplicate Dart identifier: {identifier}') + identifiers.add(identifier) + if type(codepoint) is not int or not 0xe000 <= codepoint <= 0xf8ff: + raise ValueError(f'Invalid private-use codepoint: {name}') + lines.extend([ + f' static const IconData {identifier} = IconData(', + f' 0x{codepoint:04x},', + f" fontFamily: '{family}',", + " fontPackage: 'cutdex_ui',", + ]) + if name in MIRRORED: + lines.append(' matchTextDirection: true,') + lines.append(' );') + lines.append('}') + return '\n'.join(lines) + '\n' + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + actions = parser.add_mutually_exclusive_group() + actions.add_argument('--update', metavar='COMMIT_SHA', help='refresh official font resources') + actions.add_argument('--check', action='store_true', help='verify resources and generated output') + args = parser.parse_args() + try: + if args.update: + update_catalog(args.update) + output = generate(json.loads(SOURCE.read_text(encoding='utf-8'))) + if args.check: + if not OUTPUT.exists() or OUTPUT.read_text(encoding='utf-8') != output: + print('Generated icons are stale. Run tool/generate_icons.py.', file=sys.stderr) + return 1 + print('Phosphor font checksums and generated icons are current.') + else: + OUTPUT.parent.mkdir(parents=True, exist_ok=True) + OUTPUT.write_text(output, encoding='utf-8') + print(f'Generated {OUTPUT.relative_to(ROOT)}') + return 0 + except (OSError, ValueError, KeyError) as error: + print(str(error), file=sys.stderr) + return 1 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/packages/cutdex_ui/tool/phosphor/catalog.json b/packages/cutdex_ui/tool/phosphor/catalog.json new file mode 100644 index 0000000..8a7da05 --- /dev/null +++ b/packages/cutdex_ui/tool/phosphor/catalog.json @@ -0,0 +1,3085 @@ +{ + "repository": "https://github.com/phosphor-icons/web", + "revision": "3d40a3eaa73b25d20d263f0e1e55c9fed3e66809", + "version": "2.1.2", + "styles": { + "regular": { + "font": "assets/fonts/PhosphorRegular.ttf", + "fontSource": "src/regular/Phosphor.ttf", + "fontSha256": "06b91e022b7ee899a63efced879392a74f0bacbda54e4467e9f663220d173a10", + "catalogSource": "src/regular/selection.json", + "catalogSha256": "c61ab6841b8baf33e0ef13326ce9b6db6e84540ad4264b9f92050d090acd193e", + "icons": { + "acorn": 60314, + "activity": 57344, + "address-book": 59128, + "address-book-tabs": 61006, + "air-traffic-control": 60632, + "airplane": 57346, + "airplane-in-flight": 58622, + "airplane-landing": 58626, + "airplane-takeoff": 58628, + "airplane-taxiing": 58624, + "airplane-tilt": 58838, + "airplay": 57348, + "alarm": 57350, + "alien": 59558, + "align-bottom": 58630, + "align-bottom-simple": 60172, + "align-center-horizontal": 58634, + "align-center-horizontal-simple": 60174, + "align-center-vertical": 58636, + "align-center-vertical-simple": 60176, + "align-left": 58638, + "align-left-simple": 60142, + "align-right": 58640, + "align-right-simple": 60178, + "align-top": 58642, + "align-top-simple": 60180, + "amazon-logo": 59756, + "ambulance": 58738, + "anchor": 58644, + "anchor-simple": 58840, + "android-logo": 57352, + "angle": 59324, + "angular-logo": 60288, + "aperture": 57354, + "app-store-logo": 59764, + "app-window": 58842, + "apple-logo": 58646, + "apple-podcasts-logo": 60310, + "approximate-equals": 60842, + "archive": 57356, + "archive-box": 57358, + "archive-tray": 57360, + "armchair": 57362, + "arrow-arc-left": 57364, + "arrow-arc-right": 57366, + "arrow-bend-double-up-left": 57402, + "arrow-bend-double-up-right": 57404, + "arrow-bend-down-left": 57368, + "arrow-bend-down-right": 57370, + "arrow-bend-left-down": 57372, + "arrow-bend-left-up": 57374, + "arrow-bend-right-down": 57376, + "arrow-bend-right-up": 57378, + "arrow-bend-up-left": 57380, + "arrow-bend-up-right": 57382, + "arrow-circle-down": 57384, + "arrow-circle-down-left": 57386, + "arrow-circle-down-right": 57388, + "arrow-circle-left": 57434, + "arrow-circle-right": 57390, + "arrow-circle-up": 57392, + "arrow-circle-up-left": 57394, + "arrow-circle-up-right": 57396, + "arrow-clockwise": 57398, + "arrow-counter-clockwise": 57400, + "arrow-down": 57406, + "arrow-down-left": 57408, + "arrow-down-right": 57410, + "arrow-elbow-down-left": 57412, + "arrow-elbow-down-right": 57414, + "arrow-elbow-left": 57416, + "arrow-elbow-left-down": 57418, + "arrow-elbow-left-up": 57420, + "arrow-elbow-right": 57422, + "arrow-elbow-right-down": 57424, + "arrow-elbow-right-up": 57426, + "arrow-elbow-up-left": 57428, + "arrow-elbow-up-right": 57430, + "arrow-fat-down": 58648, + "arrow-fat-left": 58650, + "arrow-fat-line-down": 58652, + "arrow-fat-line-left": 58654, + "arrow-fat-line-right": 58656, + "arrow-fat-line-up": 58658, + "arrow-fat-lines-down": 58660, + "arrow-fat-lines-left": 58662, + "arrow-fat-lines-right": 58664, + "arrow-fat-lines-up": 58666, + "arrow-fat-right": 58668, + "arrow-fat-up": 58670, + "arrow-left": 57432, + "arrow-line-down": 57436, + "arrow-line-down-left": 57438, + "arrow-line-down-right": 57440, + "arrow-line-left": 57442, + "arrow-line-right": 57444, + "arrow-line-up": 57446, + "arrow-line-up-left": 57448, + "arrow-line-up-right": 57450, + "arrow-right": 57452, + "arrow-square-down": 57454, + "arrow-square-down-left": 57456, + "arrow-square-down-right": 57458, + "arrow-square-in": 58844, + "arrow-square-left": 57460, + "arrow-square-out": 58846, + "arrow-square-right": 57462, + "arrow-square-up": 57464, + "arrow-square-up-left": 57466, + "arrow-square-up-right": 57468, + "arrow-u-down-left": 57470, + "arrow-u-down-right": 57472, + "arrow-u-left-down": 57474, + "arrow-u-left-up": 57476, + "arrow-u-right-down": 57478, + "arrow-u-right-up": 57480, + "arrow-u-up-left": 57482, + "arrow-u-up-right": 57484, + "arrow-up": 57486, + "arrow-up-left": 57488, + "arrow-up-right": 57490, + "arrows-clockwise": 57492, + "arrows-counter-clockwise": 57494, + "arrows-down-up": 57496, + "arrows-horizontal": 60166, + "arrows-in": 57498, + "arrows-in-cardinal": 57500, + "arrows-in-line-horizontal": 58672, + "arrows-in-line-vertical": 58674, + "arrows-in-simple": 57502, + "arrows-left-right": 57504, + "arrows-merge": 60734, + "arrows-out": 57506, + "arrows-out-cardinal": 57508, + "arrows-out-line-horizontal": 58676, + "arrows-out-line-vertical": 58678, + "arrows-out-simple": 57510, + "arrows-split": 60732, + "arrows-vertical": 60164, + "article": 57512, + "article-medium": 58848, + "article-ny-times": 58850, + "asclepius": 60980, + "asterisk": 57514, + "asterisk-simple": 59442, + "at": 57516, + "atom": 58852, + "avocado": 60932, + "axe": 59900, + "baby": 59252, + "baby-carriage": 59416, + "backpack": 59682, + "backspace": 57518, + "bag": 57520, + "bag-simple": 58854, + "balloon": 59244, + "bandaids": 57522, + "bank": 57524, + "barbell": 57526, + "barcode": 57528, + "barn": 60530, + "barricade": 59720, + "baseball": 59162, + "baseball-cap": 59944, + "baseball-helmet": 61002, + "basket": 59748, + "basketball": 59172, + "bathtub": 59422, + "battery-charging": 57530, + "battery-charging-vertical": 57532, + "battery-empty": 57534, + "battery-full": 57536, + "battery-high": 57538, + "battery-low": 57540, + "battery-medium": 57542, + "battery-plus": 59400, + "battery-plus-vertical": 60496, + "battery-vertical-empty": 59334, + "battery-vertical-full": 59332, + "battery-vertical-high": 59330, + "battery-vertical-low": 59326, + "battery-vertical-medium": 59328, + "battery-warning": 57544, + "battery-warning-vertical": 57546, + "beach-ball": 60708, + "beanie": 59946, + "bed": 57548, + "beer-bottle": 59312, + "beer-stein": 60258, + "behance-logo": 59380, + "bell": 57550, + "bell-ringing": 58856, + "bell-simple": 57552, + "bell-simple-ringing": 58858, + "bell-simple-slash": 57554, + "bell-simple-z": 58860, + "bell-slash": 57556, + "bell-z": 58862, + "belt": 59948, + "bezier-curve": 60160, + "bicycle": 57558, + "binary": 61024, + "binoculars": 60004, + "biohazard": 59872, + "bird": 59180, + "blueprint": 60832, + "bluetooth": 57562, + "bluetooth-connected": 57564, + "bluetooth-slash": 57566, + "bluetooth-x": 57568, + "boat": 59270, + "bomb": 60938, + "bone": 59378, + "book": 57570, + "book-bookmark": 57572, + "book-open": 57574, + "book-open-text": 59634, + "book-open-user": 60896, + "bookmark": 57576, + "bookmark-simple": 57578, + "bookmarks": 57580, + "bookmarks-simple": 58864, + "books": 59224, + "boot": 60618, + "boules": 59170, + "bounding-box": 59086, + "bowl-food": 60068, + "bowl-steam": 59620, + "bowling-ball": 59956, + "box-arrow-down": 57358, + "box-arrow-up": 61012, + "boxing-glove": 59958, + "brackets-angle": 59490, + "brackets-curly": 59488, + "brackets-round": 59492, + "brackets-square": 59486, + "brain": 59214, + "brandy": 59060, + "bread": 59420, + "bridge": 60008, + "briefcase": 57582, + "briefcase-metal": 58866, + "broadcast": 57586, + "broom": 60500, + "browser": 57588, + "browsers": 57590, + "bug": 58868, + "bug-beetle": 58870, + "bug-droid": 58872, + "building": 57600, + "building-apartment": 57598, + "building-office": 57599, + "buildings": 57602, + "bulldozer": 60524, + "bus": 57606, + "butterfly": 60014, + "cable-car": 58524, + "cactus": 59672, + "caduceus": 60980, + "cake": 59264, + "calculator": 58680, + "calendar": 57608, + "calendar-blank": 57610, + "calendar-check": 59154, + "calendar-dot": 59314, + "calendar-dots": 59316, + "calendar-heart": 59568, + "calendar-minus": 59924, + "calendar-plus": 59156, + "calendar-slash": 59922, + "calendar-star": 59570, + "calendar-x": 57612, + "call-bell": 59358, + "camera": 57614, + "camera-plus": 60504, + "camera-rotate": 59300, + "camera-slash": 57616, + "campfire": 59864, + "car": 57618, + "car-battery": 60976, + "car-profile": 59596, + "car-simple": 57620, + "cardholder": 58874, + "cards": 57592, + "cards-three": 61008, + "caret-circle-double-down": 57622, + "caret-circle-double-left": 57624, + "caret-circle-double-right": 57626, + "caret-circle-double-up": 57628, + "caret-circle-down": 57630, + "caret-circle-left": 57632, + "caret-circle-right": 57634, + "caret-circle-up": 57636, + "caret-circle-up-down": 57662, + "caret-double-down": 57638, + "caret-double-left": 57640, + "caret-double-right": 57642, + "caret-double-up": 57644, + "caret-down": 57654, + "caret-left": 57656, + "caret-line-down": 57652, + "caret-line-left": 57650, + "caret-line-right": 57648, + "caret-line-up": 57646, + "caret-right": 57658, + "caret-up": 57660, + "caret-up-down": 57664, + "carrot": 60728, + "cash-register": 60800, + "cassette-tape": 60718, + "castle-turret": 59856, + "cat": 59208, + "cell-signal-full": 57666, + "cell-signal-high": 57668, + "cell-signal-low": 57670, + "cell-signal-medium": 57672, + "cell-signal-none": 57674, + "cell-signal-slash": 57676, + "cell-signal-x": 57678, + "cell-tower": 60330, + "certificate": 59238, + "chair": 59728, + "chalkboard": 58876, + "chalkboard-simple": 58878, + "chalkboard-teacher": 58880, + "champagne": 60106, + "charging-station": 59600, + "chart-bar": 57680, + "chart-bar-horizontal": 57682, + "chart-donut": 60070, + "chart-line": 57684, + "chart-line-down": 59574, + "chart-line-up": 57686, + "chart-pie": 57688, + "chart-pie-slice": 57690, + "chart-polar": 60072, + "chart-scatter": 60076, + "chat": 57692, + "chat-centered": 57696, + "chat-centered-dots": 57700, + "chat-centered-slash": 57698, + "chat-centered-text": 57702, + "chat-circle": 57704, + "chat-circle-dots": 57708, + "chat-circle-slash": 57706, + "chat-circle-text": 57710, + "chat-dots": 57712, + "chat-slash": 57694, + "chat-teardrop": 57714, + "chat-teardrop-dots": 57718, + "chat-teardrop-slash": 57716, + "chat-teardrop-text": 57720, + "chat-text": 57722, + "chats": 57724, + "chats-circle": 57726, + "chats-teardrop": 57728, + "check": 57730, + "check-circle": 57732, + "check-fat": 60326, + "check-square": 57734, + "check-square-offset": 57736, + "checkerboard": 59588, + "checks": 58682, + "cheers": 59978, + "cheese": 59902, + "chef-hat": 60814, + "cherries": 59440, + "church": 60650, + "cigarette": 60816, + "cigarette-slash": 60818, + "circle": 57738, + "circle-dashed": 58882, + "circle-half": 57740, + "circle-half-tilt": 57742, + "circle-notch": 60228, + "circle-wavy": 58884, + "circle-wavy-check": 58886, + "circle-wavy-question": 58888, + "circle-wavy-warning": 58892, + "circles-four": 57744, + "circles-three": 57746, + "circles-three-plus": 57748, + "circuitry": 59842, + "city": 60010, + "clipboard": 57750, + "clipboard-text": 57752, + "clock": 57754, + "clock-afternoon": 57756, + "clock-clockwise": 57758, + "clock-countdown": 60716, + "clock-counter-clockwise": 57760, + "clock-user": 60908, + "closed-captioning": 57764, + "cloud": 57770, + "cloud-arrow-down": 57772, + "cloud-arrow-up": 57774, + "cloud-check": 57776, + "cloud-fog": 58684, + "cloud-lightning": 57778, + "cloud-moon": 58686, + "cloud-rain": 57780, + "cloud-slash": 57782, + "cloud-snow": 57784, + "cloud-sun": 58688, + "cloud-warning": 60056, + "cloud-x": 60054, + "clover": 60872, + "club": 57786, + "coat-hanger": 59390, + "coda-logo": 59342, + "code": 57788, + "code-block": 60158, + "code-simple": 57790, + "codepen-logo": 59768, + "codesandbox-logo": 59910, + "coffee": 57794, + "coffee-bean": 57792, + "coin": 58894, + "coin-vertical": 60232, + "coins": 59278, + "columns": 58694, + "columns-plus-left": 58692, + "columns-plus-right": 58690, + "command": 57796, + "compass": 57800, + "compass-rose": 57798, + "compass-tool": 59918, + "computer-tower": 58696, + "confetti": 59418, + "contactless-payment": 60738, + "control": 60582, + "cookie": 59082, + "cooking-pot": 59236, + "copy": 57802, + "copy-simple": 57804, + "copyleft": 59498, + "copyright": 58698, + "corners-in": 57806, + "corners-out": 57808, + "couch": 59382, + "court-basketball": 60982, + "cow": 60094, + "cowboy-hat": 60690, + "cpu": 58896, + "crane": 60744, + "crane-tower": 60745, + "credit-card": 57810, + "cricket": 60946, + "crop": 57812, + "cross": 59552, + "crosshair": 57814, + "crosshair-simple": 57816, + "crown": 58900, + "crown-cross": 61022, + "crown-simple": 58902, + "cube": 57818, + "cube-focus": 60682, + "cube-transparent": 60540, + "currency-btc": 58904, + "currency-circle-dollar": 58700, + "currency-cny": 58702, + "currency-dollar": 58704, + "currency-dollar-simple": 58706, + "currency-eth": 60122, + "currency-eur": 58708, + "currency-gbp": 58710, + "currency-inr": 58712, + "currency-jpy": 58714, + "currency-krw": 58716, + "currency-kzt": 60492, + "currency-ngn": 60242, + "currency-rub": 58718, + "cursor": 57820, + "cursor-click": 59336, + "cursor-text": 59352, + "cylinder": 59644, + "database": 57822, + "desk": 60694, + "desktop": 58720, + "desktop-tower": 58722, + "detective": 59454, + "dev-to-logo": 60686, + "device-mobile": 57824, + "device-mobile-camera": 57826, + "device-mobile-slash": 60998, + "device-mobile-speaker": 57828, + "device-rotate": 60914, + "device-tablet": 57830, + "device-tablet-camera": 57832, + "device-tablet-speaker": 57834, + "devices": 60324, + "diamond": 57836, + "diamonds-four": 59636, + "dice-five": 57838, + "dice-four": 57840, + "dice-one": 57842, + "dice-six": 57844, + "dice-three": 57846, + "dice-two": 57848, + "disc": 58724, + "disco-ball": 60824, + "discord-logo": 58906, + "divide": 57850, + "dna": 59684, + "dog": 59210, + "door": 58908, + "door-open": 59366, + "dot": 60638, + "dot-outline": 60640, + "dots-nine": 57852, + "dots-six": 59284, + "dots-six-vertical": 60130, + "dots-three": 57854, + "dots-three-circle": 57856, + "dots-three-circle-vertical": 57858, + "dots-three-outline": 57860, + "dots-three-outline-vertical": 57862, + "dots-three-vertical": 57864, + "download": 57866, + "download-simple": 57868, + "dress": 60030, + "dresser": 59726, + "dribbble-logo": 57870, + "drone": 60788, + "drop": 57872, + "drop-half": 58726, + "drop-half-bottom": 60224, + "drop-simple": 60978, + "drop-slash": 59732, + "dropbox-logo": 59344, + "ear": 59148, + "ear-slash": 59150, + "egg": 59410, + "egg-crack": 60260, + "eject": 57874, + "eject-simple": 59054, + "elevator": 60608, + "empty": 60860, + "engine": 60032, + "envelope": 57876, + "envelope-open": 57878, + "envelope-simple": 57880, + "envelope-simple-open": 57882, + "equalizer": 60348, + "equals": 57884, + "eraser": 57886, + "escalator-down": 60602, + "escalator-up": 60604, + "exam": 59202, + "exclamation-mark": 60996, + "exclude": 59522, + "exclude-square": 59520, + "export": 60144, + "eye": 57888, + "eye-closed": 57890, + "eye-slash": 57892, + "eyedropper": 58728, + "eyedropper-sample": 60100, + "eyeglasses": 59322, + "eyes": 61020, + "face-mask": 58730, + "facebook-logo": 57894, + "factory": 59232, + "faders": 57896, + "faders-horizontal": 57898, + "fallout-shelter": 59870, + "fan": 59890, + "farm": 60528, + "fast-forward": 59046, + "fast-forward-circle": 57900, + "feather": 59840, + "fediverse-logo": 60774, + "figma-logo": 57902, + "file": 57904, + "file-archive": 60202, + "file-arrow-down": 57906, + "file-arrow-up": 58910, + "file-audio": 59936, + "file-c": 60210, + "file-c-sharp": 60208, + "file-cloud": 59742, + "file-code": 59668, + "file-cpp": 60206, + "file-css": 60212, + "file-csv": 60188, + "file-dashed": 59140, + "file-doc": 60190, + "file-dotted": 59140, + "file-html": 60216, + "file-image": 59940, + "file-ini": 60211, + "file-jpg": 60186, + "file-js": 60196, + "file-jsx": 60218, + "file-lock": 59740, + "file-magnifying-glass": 57912, + "file-md": 60752, + "file-minus": 57908, + "file-pdf": 59138, + "file-plus": 57910, + "file-png": 60184, + "file-ppt": 60192, + "file-py": 60204, + "file-rs": 60200, + "file-search": 57912, + "file-sql": 60750, + "file-svg": 60680, + "file-text": 57914, + "file-ts": 60198, + "file-tsx": 60220, + "file-txt": 60213, + "file-video": 59938, + "file-vue": 60222, + "file-x": 57916, + "file-xls": 60194, + "file-zip": 59736, + "files": 59152, + "film-reel": 59584, + "film-script": 60240, + "film-slate": 59586, + "film-strip": 59282, + "fingerprint": 57918, + "fingerprint-simple": 57920, + "finn-the-human": 58732, + "fire": 57922, + "fire-extinguisher": 59880, + "fire-simple": 58912, + "fire-truck": 58740, + "first-aid": 58734, + "first-aid-kit": 58736, + "fish": 59176, + "fish-simple": 59178, + "flag": 57924, + "flag-banner": 58914, + "flag-banner-fold": 60658, + "flag-checkered": 59960, + "flag-pennant": 60656, + "flame": 58916, + "flashlight": 57926, + "flask": 59294, + "flip-horizontal": 60778, + "flip-vertical": 60780, + "floppy-disk": 57928, + "floppy-disk-back": 60148, + "flow-arrow": 59116, + "flower": 59230, + "flower-lotus": 59084, + "flower-tulip": 60108, + "flying-saucer": 60234, + "folder": 57930, + "folder-dashed": 59640, + "folder-dotted": 59640, + "folder-lock": 59964, + "folder-minus": 57940, + "folder-notch": 57930, + "folder-notch-minus": 57940, + "folder-notch-open": 57942, + "folder-notch-plus": 57944, + "folder-open": 57942, + "folder-plus": 57944, + "folder-simple": 57946, + "folder-simple-dashed": 60458, + "folder-simple-dotted": 60458, + "folder-simple-lock": 60254, + "folder-simple-minus": 57948, + "folder-simple-plus": 57950, + "folder-simple-star": 60462, + "folder-simple-user": 60256, + "folder-star": 60038, + "folder-user": 60230, + "folders": 57952, + "football": 59160, + "football-helmet": 61004, + "footprints": 60040, + "fork-knife": 57954, + "four-k": 59996, + "frame-corners": 58918, + "framer-logo": 57956, + "function": 60388, + "funnel": 57958, + "funnel-simple": 57960, + "funnel-simple-x": 57962, + "funnel-x": 57964, + "game-controller": 57966, + "garage": 60630, + "gas-can": 59598, + "gas-pump": 59240, + "gauge": 58920, + "gavel": 59954, + "gear": 57968, + "gear-fine": 59516, + "gear-six": 57970, + "gender-female": 59104, + "gender-intersex": 59110, + "gender-male": 59106, + "gender-neuter": 59114, + "gender-nonbinary": 59108, + "gender-transgender": 59112, + "ghost": 58922, + "gif": 57972, + "gift": 57974, + "git-branch": 57976, + "git-commit": 57978, + "git-diff": 57980, + "git-fork": 57982, + "git-merge": 57984, + "git-pull-request": 57986, + "github-logo": 58742, + "gitlab-logo": 59028, + "gitlab-logo-simple": 59030, + "globe": 57992, + "globe-hemisphere-east": 57994, + "globe-hemisphere-west": 57996, + "globe-simple": 57998, + "globe-simple-x": 57988, + "globe-stand": 58000, + "globe-x": 57990, + "goggles": 60596, + "golf": 59966, + "goodreads-logo": 60688, + "google-cardboard-logo": 59318, + "google-chrome-logo": 59766, + "google-drive-logo": 59638, + "google-logo": 58002, + "google-photos-logo": 60306, + "google-play-logo": 58004, + "google-podcasts-logo": 60308, + "gps": 60888, + "gps-fix": 60886, + "gps-slash": 60884, + "gradient": 60226, + "graduation-cap": 58924, + "grains": 60520, + "grains-slash": 60522, + "graph": 60248, + "graphics-card": 58898, + "greater-than": 60868, + "greater-than-or-equal": 60834, + "grid-four": 58006, + "grid-nine": 60556, + "guitar": 60042, + "hair-dryer": 60006, + "hamburger": 59280, + "hammer": 59406, + "hand": 58008, + "hand-arrow-down": 59982, + "hand-arrow-up": 61018, + "hand-coins": 60044, + "hand-deposit": 61058, + "hand-eye": 59980, + "hand-fist": 58746, + "hand-grabbing": 58748, + "hand-heart": 59408, + "hand-palm": 58750, + "hand-peace": 59340, + "hand-pointing": 58010, + "hand-soap": 58928, + "hand-swipe-left": 60564, + "hand-swipe-right": 60562, + "hand-tap": 60560, + "hand-waving": 58752, + "hand-withdraw": 61056, + "handbag": 58012, + "handbag-simple": 58926, + "hands-clapping": 59040, + "hands-praying": 60616, + "handshake": 58754, + "hard-drive": 58014, + "hard-drives": 58016, + "hard-hat": 60742, + "hash": 58018, + "hash-straight": 58020, + "head-circuit": 59348, + "headlights": 59134, + "headphones": 58022, + "headset": 58756, + "heart": 58024, + "heart-break": 60392, + "heart-half": 60488, + "heart-straight": 58026, + "heart-straight-break": 60312, + "heartbeat": 58028, + "hexagon": 58030, + "high-definition": 60046, + "high-heel": 59624, + "highlighter": 60534, + "highlighter-circle": 58930, + "hockey": 60550, + "hoodie": 60624, + "horse": 58032, + "hospital": 59460, + "hourglass": 58034, + "hourglass-high": 58036, + "hourglass-low": 58038, + "hourglass-medium": 58040, + "hourglass-simple": 58042, + "hourglass-simple-high": 58044, + "hourglass-simple-low": 58046, + "hourglass-simple-medium": 58048, + "house": 58050, + "house-line": 58052, + "house-simple": 58054, + "hurricane": 59534, + "ice-cream": 59396, + "identification-badge": 59126, + "identification-card": 58056, + "image": 58058, + "image-broken": 59304, + "image-square": 58060, + "images": 59446, + "images-square": 59444, + "infinity": 58932, + "info": 58062, + "instagram-logo": 58064, + "intersect": 58066, + "intersect-square": 59514, + "intersect-three": 60612, + "intersection": 60858, + "invoice": 60994, + "island": 60934, + "jar": 59360, + "jar-label": 59361, + "jeep": 58068, + "joystick": 59998, + "kanban": 60244, + "key": 58070, + "key-return": 59266, + "keyboard": 58072, + "keyhole": 60024, + "knife": 58934, + "ladder": 59876, + "ladder-simple": 60454, + "lamp": 58936, + "lamp-pendant": 60974, + "laptop": 58758, + "lasso": 60870, + "lastfm-logo": 59458, + "layout": 59094, + "leaf": 58074, + "lectern": 59738, + "lego": 59590, + "lego-smiley": 59591, + "lemniscate": 58932, + "less-than": 60844, + "less-than-or-equal": 60836, + "letter-circle-h": 60408, + "letter-circle-p": 60424, + "letter-circle-v": 60436, + "lifebuoy": 58938, + "lightbulb": 58076, + "lightbulb-filament": 58940, + "lighthouse": 59894, + "lightning": 58078, + "lightning-a": 60036, + "lightning-slash": 58080, + "line-segment": 59090, + "line-segments": 59092, + "line-vertical": 60784, + "link": 58082, + "link-break": 58084, + "link-simple": 58086, + "link-simple-break": 58088, + "link-simple-horizontal": 58090, + "link-simple-horizontal-break": 58092, + "linkedin-logo": 58094, + "linktree-logo": 60910, + "linux-logo": 60162, + "list": 58096, + "list-bullets": 58098, + "list-checks": 60124, + "list-dashes": 58100, + "list-heart": 60382, + "list-magnifying-glass": 60384, + "list-numbers": 58102, + "list-plus": 58104, + "list-star": 60380, + "lock": 58106, + "lock-key": 58110, + "lock-key-open": 58112, + "lock-laminated": 58114, + "lock-laminated-open": 58116, + "lock-open": 58118, + "lock-simple": 58120, + "lock-simple-open": 58122, + "lockers": 60600, + "log": 60802, + "magic-wand": 59062, + "magnet": 59008, + "magnet-straight": 59010, + "magnifying-glass": 58124, + "magnifying-glass-minus": 58126, + "magnifying-glass-plus": 58128, + "mailbox": 60446, + "map-pin": 58134, + "map-pin-area": 60986, + "map-pin-line": 58136, + "map-pin-plus": 58132, + "map-pin-simple": 60990, + "map-pin-simple-area": 60988, + "map-pin-simple-line": 60984, + "map-trifold": 58138, + "markdown-logo": 58632, + "marker-circle": 58944, + "martini": 58140, + "mask-happy": 59892, + "mask-sad": 60318, + "mastodon-logo": 60776, + "math-operations": 58142, + "matrix-logo": 60772, + "medal": 58144, + "medal-military": 60668, + "medium-logo": 58146, + "megaphone": 58148, + "megaphone-simple": 58946, + "member-of": 60866, + "memory": 59844, + "messenger-logo": 59096, + "meta-logo": 60674, + "meteor": 59834, + "metronome": 60558, + "microphone": 58150, + "microphone-slash": 58152, + "microphone-stage": 59228, + "microscope": 60538, + "microsoft-excel-logo": 60268, + "microsoft-outlook-logo": 60272, + "microsoft-powerpoint-logo": 60110, + "microsoft-teams-logo": 60262, + "microsoft-word-logo": 60266, + "minus": 58154, + "minus-circle": 58156, + "minus-square": 60748, + "money": 58760, + "money-wavy": 61032, + "monitor": 58158, + "monitor-arrow-up": 58762, + "monitor-play": 58764, + "moon": 58160, + "moon-stars": 58766, + "moped": 59428, + "moped-front": 59426, + "mosque": 60654, + "motorcycle": 59402, + "mountains": 59310, + "mouse": 58170, + "mouse-left-click": 58164, + "mouse-middle-click": 58168, + "mouse-right-click": 58166, + "mouse-scroll": 58162, + "mouse-simple": 58948, + "music-note": 58172, + "music-note-simple": 58174, + "music-notes": 58176, + "music-notes-minus": 60940, + "music-notes-plus": 60284, + "music-notes-simple": 58178, + "navigation-arrow": 60126, + "needle": 59438, + "network": 60894, + "network-slash": 60892, + "network-x": 60890, + "newspaper": 58180, + "newspaper-clipping": 58182, + "not-equals": 60838, + "not-member-of": 60846, + "not-subset-of": 60848, + "not-superset-of": 60850, + "notches": 60730, + "note": 58184, + "note-blank": 58186, + "note-pencil": 58188, + "notebook": 58190, + "notepad": 58942, + "notification": 59130, + "notion-logo": 59808, + "nuclear-plant": 60796, + "number-circle-eight": 58194, + "number-circle-five": 58200, + "number-circle-four": 58206, + "number-circle-nine": 58212, + "number-circle-one": 58218, + "number-circle-seven": 58224, + "number-circle-six": 58230, + "number-circle-three": 58236, + "number-circle-two": 58242, + "number-circle-zero": 58248, + "number-eight": 58192, + "number-five": 58198, + "number-four": 58204, + "number-nine": 58210, + "number-one": 58216, + "number-seven": 58222, + "number-six": 58228, + "number-square-eight": 58196, + "number-square-five": 58202, + "number-square-four": 58208, + "number-square-nine": 58214, + "number-square-one": 58220, + "number-square-seven": 58226, + "number-square-six": 58232, + "number-square-three": 58238, + "number-square-two": 58244, + "number-square-zero": 58250, + "number-three": 58234, + "number-two": 58240, + "number-zero": 58246, + "numpad": 58312, + "nut": 58252, + "ny-times-logo": 58950, + "octagon": 58254, + "office-chair": 59974, + "onigiri": 60972, + "open-ai-logo": 59346, + "option": 59560, + "orange": 60992, + "orange-slice": 60726, + "oven": 60812, + "package": 58256, + "paint-brush": 59120, + "paint-brush-broad": 58768, + "paint-brush-household": 59122, + "paint-bucket": 58258, + "paint-roller": 59124, + "palette": 59080, + "panorama": 60066, + "pants": 60552, + "paper-plane": 58260, + "paper-plane-right": 58262, + "paper-plane-tilt": 58264, + "paperclip": 58266, + "paperclip-horizontal": 58770, + "parachute": 60028, + "paragraph": 59744, + "parallelogram": 60614, + "park": 60594, + "password": 59218, + "path": 58268, + "patreon-logo": 59786, + "pause": 58270, + "pause-circle": 58272, + "paw-print": 58952, + "paypal-logo": 59788, + "peace": 58274, + "pen": 58282, + "pen-nib": 58284, + "pen-nib-straight": 58954, + "pencil": 58286, + "pencil-circle": 58288, + "pencil-line": 58290, + "pencil-ruler": 59654, + "pencil-simple": 58292, + "pencil-simple-line": 60358, + "pencil-simple-slash": 60662, + "pencil-slash": 60664, + "pentagon": 60542, + "pentagram": 60508, + "pepper": 59722, + "percent": 58294, + "person": 58280, + "person-arms-spread": 60670, + "person-simple": 59182, + "person-simple-bike": 59188, + "person-simple-circle": 61016, + "person-simple-hike": 60756, + "person-simple-run": 59184, + "person-simple-ski": 59164, + "person-simple-snowboard": 59166, + "person-simple-swim": 59190, + "person-simple-tai-chi": 60764, + "person-simple-throw": 59186, + "person-simple-walk": 59194, + "perspective": 60390, + "phone": 58296, + "phone-call": 58298, + "phone-disconnect": 58300, + "phone-incoming": 58302, + "phone-list": 58316, + "phone-outgoing": 58304, + "phone-pause": 58314, + "phone-plus": 60502, + "phone-slash": 58306, + "phone-transfer": 58310, + "phone-x": 58308, + "phosphor-logo": 58318, + "pi": 60544, + "piano-keys": 59848, + "picnic-table": 60966, + "picture-in-picture": 58956, + "piggy-bank": 59908, + "pill": 59136, + "ping-pong": 59970, + "pint-glass": 60880, + "pinterest-logo": 58958, + "pinwheel": 60316, + "pipe": 60806, + "pipe-wrench": 60808, + "pix-logo": 60610, + "pizza": 59286, + "placeholder": 58960, + "planet": 58962, + "plant": 60334, + "play": 58320, + "play-circle": 58322, + "play-pause": 59582, + "playlist": 59050, + "plug": 59718, + "plug-charging": 60252, + "plugs": 60246, + "plugs-connected": 60250, + "plus": 58324, + "plus-circle": 58326, + "plus-minus": 58328, + "plus-square": 60746, + "poker-chip": 58772, + "police-car": 60490, + "polygon": 59088, + "popcorn": 60238, + "popsicle": 60350, + "potted-plant": 60450, + "power": 58330, + "prescription": 59298, + "presentation": 58964, + "presentation-chart": 58966, + "printer": 58332, + "prohibit": 58334, + "prohibit-inset": 58336, + "projector-screen": 58968, + "projector-screen-chart": 58970, + "pulse": 57344, + "push-pin": 58338, + "push-pin-simple": 58972, + "push-pin-simple-slash": 58974, + "push-pin-slash": 58340, + "puzzle-piece": 58774, + "qr-code": 58342, + "question": 58344, + "question-mark": 58345, + "queue": 59052, + "quotes": 58976, + "rabbit": 60098, + "racquet": 60930, + "radical": 58346, + "radio": 59262, + "radio-button": 60168, + "radioactive": 59868, + "rainbow": 58776, + "rainbow-cloud": 58778, + "ranking": 60770, + "read-cv-logo": 60684, + "receipt": 58348, + "receipt-x": 60736, + "record": 58350, + "rectangle": 58352, + "rectangle-dashed": 58354, + "recycle": 59226, + "reddit-logo": 58780, + "repeat": 58358, + "repeat-once": 58360, + "replit-logo": 60298, + "resize": 60782, + "rewind": 59048, + "rewind-circle": 58362, + "road-horizon": 59448, + "robot": 59234, + "rocket": 58364, + "rocket-launch": 58366, + "rows": 58786, + "rows-plus-bottom": 58782, + "rows-plus-top": 58784, + "rss": 58368, + "rss-simple": 58370, + "rug": 59930, + "ruler": 59064, + "sailboat": 59274, + "scales": 59216, + "scan": 60342, + "scan-smiley": 60340, + "scissors": 60128, + "scooter": 59424, + "screencast": 58372, + "screwdriver": 59502, + "scribble": 59398, + "scribble-loop": 58978, + "scroll": 60282, + "seal": 58884, + "seal-check": 58886, + "seal-percent": 58890, + "seal-question": 58888, + "seal-warning": 58892, + "seat": 60302, + "seatbelt": 60926, + "security-camera": 60580, + "selection": 59034, + "selection-all": 59206, + "selection-background": 60152, + "selection-foreground": 60150, + "selection-inverse": 59204, + "selection-plus": 59036, + "selection-slash": 59038, + "shapes": 60510, + "share": 58374, + "share-fat": 60754, + "share-network": 58376, + "shield": 58378, + "shield-check": 58380, + "shield-checkered": 59144, + "shield-chevron": 58382, + "shield-plus": 59142, + "shield-slash": 58384, + "shield-star": 60468, + "shield-warning": 58386, + "shipping-container": 59276, + "shirt-folded": 60050, + "shooting-star": 60666, + "shopping-bag": 58390, + "shopping-bag-open": 58392, + "shopping-cart": 58398, + "shopping-cart-simple": 58400, + "shovel": 59878, + "shower": 59254, + "shrimp": 60084, + "shuffle": 58402, + "shuffle-angular": 58404, + "shuffle-simple": 58406, + "sidebar": 60086, + "sidebar-simple": 60452, + "sigma": 60088, + "sign-in": 58408, + "sign-out": 58410, + "signature": 60332, + "signpost": 59548, + "sim-card": 58980, + "siren": 59832, + "sketch-logo": 58412, + "skip-back": 58788, + "skip-back-circle": 58414, + "skip-forward": 58790, + "skip-forward-circle": 58416, + "skull": 59670, + "skype-logo": 59612, + "slack-logo": 58792, + "sliders": 58418, + "sliders-horizontal": 58420, + "slideshow": 60722, + "smiley": 58422, + "smiley-angry": 60514, + "smiley-blank": 58424, + "smiley-meh": 58426, + "smiley-melting": 61014, + "smiley-nervous": 58428, + "smiley-sad": 58430, + "smiley-sticker": 58432, + "smiley-wink": 58982, + "smiley-x-eyes": 58434, + "snapchat-logo": 58984, + "sneaker": 59404, + "sneaker-move": 60768, + "snowflake": 58794, + "soccer-ball": 59158, + "sock": 60622, + "solar-panel": 60794, + "solar-roof": 60795, + "sort-ascending": 58436, + "sort-descending": 58438, + "soundcloud-logo": 59614, + "spade": 58440, + "sparkle": 59042, + "speaker-hifi": 59912, + "speaker-high": 58442, + "speaker-low": 58444, + "speaker-none": 58446, + "speaker-simple-high": 58448, + "speaker-simple-low": 58450, + "speaker-simple-none": 58452, + "speaker-simple-slash": 58454, + "speaker-simple-x": 58456, + "speaker-slash": 58458, + "speaker-x": 58460, + "speedometer": 61044, + "sphere": 61030, + "spinner": 58986, + "spinner-ball": 60968, + "spinner-gap": 58988, + "spiral": 59898, + "split-horizontal": 59506, + "split-vertical": 59510, + "spotify-logo": 58990, + "spray-bottle": 59364, + "square": 58462, + "square-half": 58466, + "square-half-bottom": 60182, + "square-logo": 59024, + "square-split-horizontal": 59504, + "square-split-vertical": 59508, + "squares-four": 58468, + "stack": 58470, + "stack-minus": 60916, + "stack-overflow-logo": 60280, + "stack-plus": 60918, + "stack-simple": 58472, + "stairs": 59628, + "stamp": 59976, + "standard-definition": 60048, + "star": 58474, + "star-and-crescent": 60660, + "star-four": 59044, + "star-half": 59146, + "star-of-david": 59550, + "steam-logo": 60116, + "steering-wheel": 59820, + "steps": 60606, + "stethoscope": 59370, + "sticker": 58796, + "stool": 59972, + "stop": 58476, + "stop-circle": 58478, + "storefront": 58480, + "strategy": 59962, + "stripe-logo": 59032, + "student": 59198, + "subset-of": 60864, + "subset-proper-of": 60854, + "subtitles": 57768, + "subtitles-slash": 57766, + "subtract": 60374, + "subtract-square": 60372, + "subway": 58520, + "suitcase": 58798, + "suitcase-rolling": 59824, + "suitcase-simple": 58800, + "sun": 58482, + "sun-dim": 58484, + "sun-horizon": 58806, + "sunglasses": 59414, + "superset-of": 60856, + "superset-proper-of": 60852, + "swap": 59452, + "swatches": 58808, + "swimming-pool": 60598, + "sword": 58810, + "synagogue": 60652, + "syringe": 59752, + "t-shirt": 58992, + "table": 58486, + "tabs": 59256, + "tag": 58488, + "tag-chevron": 58994, + "tag-simple": 58490, + "target": 58492, + "taxi": 59650, + "tea-bag": 59622, + "telegram-logo": 58812, + "television": 59220, + "television-simple": 60134, + "tennis-ball": 59168, + "tent": 59578, + "terminal": 58494, + "terminal-window": 60136, + "test-tube": 59296, + "text-a-underline": 60724, + "text-aa": 59118, + "text-align-center": 58496, + "text-align-justify": 58498, + "text-align-left": 58500, + "text-align-right": 58502, + "text-b": 58814, + "text-bolder": 58814, + "text-columns": 60566, + "text-h": 59066, + "text-h-five": 59076, + "text-h-four": 59074, + "text-h-one": 59068, + "text-h-six": 59078, + "text-h-three": 59072, + "text-h-two": 59070, + "text-indent": 59934, + "text-italic": 58816, + "text-outdent": 59932, + "text-strikethrough": 58818, + "text-subscript": 60568, + "text-superscript": 60570, + "text-t": 58506, + "text-t-slash": 58504, + "text-underline": 58820, + "textbox": 60170, + "thermometer": 58822, + "thermometer-cold": 58824, + "thermometer-hot": 58826, + "thermometer-simple": 58828, + "threads-logo": 60830, + "three-d": 59994, + "thumbs-down": 58508, + "thumbs-up": 58510, + "ticket": 58512, + "tidal-logo": 60700, + "tiktok-logo": 60146, + "tilde": 60840, + "timer": 58514, + "tip-jar": 59362, + "tipi": 60720, + "tire": 60882, + "toggle-left": 58996, + "toggle-right": 58998, + "toilet": 59290, + "toilet-paper": 59292, + "toolbox": 60576, + "tooth": 59852, + "tornado": 59532, + "tote": 58516, + "tote-simple": 59000, + "towel": 60902, + "tractor": 60526, + "trademark": 59888, + "trademark-registered": 58356, + "traffic-cone": 59816, + "traffic-sign": 59002, + "traffic-signal": 59818, + "train": 58518, + "train-regional": 58526, + "train-simple": 58528, + "tram": 59884, + "translate": 58530, + "trash": 58534, + "trash-simple": 58536, + "tray": 58538, + "tray-arrow-down": 57360, + "tray-arrow-up": 61010, + "treasure-chest": 60898, + "tree": 59098, + "tree-evergreen": 59100, + "tree-palm": 59674, + "tree-structure": 59004, + "tree-view": 61000, + "trend-down": 58540, + "trend-up": 58542, + "triangle": 58544, + "triangle-dashed": 58546, + "trolley": 58802, + "trolley-suitcase": 58804, + "trophy": 59006, + "truck": 58548, + "truck-trailer": 58550, + "tumblr-logo": 59604, + "twitch-logo": 58830, + "twitter-logo": 58554, + "umbrella": 59012, + "umbrella-simple": 59014, + "union": 60862, + "unite": 59518, + "unite-square": 59512, + "upload": 58558, + "upload-simple": 58560, + "usb": 59734, + "user": 58562, + "user-check": 60154, + "user-circle": 58564, + "user-circle-check": 60472, + "user-circle-dashed": 60470, + "user-circle-gear": 58566, + "user-circle-minus": 58568, + "user-circle-plus": 58570, + "user-focus": 59132, + "user-gear": 58572, + "user-list": 59196, + "user-minus": 58574, + "user-plus": 58576, + "user-rectangle": 58578, + "user-sound": 60584, + "user-square": 58580, + "user-switch": 59222, + "users": 58582, + "users-four": 59020, + "users-three": 59022, + "van": 59430, + "vault": 59246, + "vector-three": 61026, + "vector-two": 61028, + "vibrate": 58584, + "video": 59200, + "video-camera": 58586, + "video-camera-slash": 58588, + "video-conference": 60878, + "vignette": 60322, + "vinyl-record": 60588, + "virtual-reality": 59320, + "virus": 59350, + "visor": 60970, + "voicemail": 58590, + "volleyball": 59174, + "wall": 59016, + "wallet": 59018, + "warehouse": 60628, + "warning": 58592, + "warning-circle": 58594, + "warning-diamond": 59388, + "warning-octagon": 58596, + "washing-machine": 60904, + "watch": 58598, + "wave-sawtooth": 60060, + "wave-sine": 60058, + "wave-square": 60062, + "wave-triangle": 60064, + "waveform": 59394, + "waveform-slash": 59392, + "waves": 59102, + "webcam": 59826, + "webcam-slash": 60636, + "webhooks-logo": 60590, + "wechat-logo": 59602, + "whatsapp-logo": 58832, + "wheelchair": 58600, + "wheelchair-motion": 59546, + "wifi-high": 58602, + "wifi-low": 58604, + "wifi-medium": 58606, + "wifi-none": 58608, + "wifi-slash": 58610, + "wifi-x": 58612, + "wind": 58834, + "windmill": 59896, + "windows-logo": 59026, + "wine": 59058, + "wrench": 58836, + "x": 58614, + "x-circle": 58616, + "x-logo": 58556, + "x-square": 58618, + "yarn": 60826, + "yin-yang": 59690, + "youtube-logo": 58620 + } + }, + "fill": { + "font": "assets/fonts/PhosphorFill.ttf", + "fontSource": "src/fill/Phosphor-Fill.ttf", + "fontSha256": "a53f5d2630cab5e3b7536ecb9d69d71519a2190298c22b1f8d770dd37bc2940a", + "catalogSource": "src/fill/selection.json", + "catalogSha256": "4c2141ee6e8ed9b53466b26e483ca4d85fcf2044138029095d56f910e1b9dab2", + "icons": { + "acorn": 60314, + "activity": 57344, + "address-book": 59128, + "address-book-tabs": 61006, + "air-traffic-control": 60632, + "airplane": 57346, + "airplane-in-flight": 58622, + "airplane-landing": 58626, + "airplane-takeoff": 58628, + "airplane-taxiing": 58624, + "airplane-tilt": 58838, + "airplay": 57348, + "alarm": 57350, + "alien": 59558, + "align-bottom": 58630, + "align-bottom-simple": 60172, + "align-center-horizontal": 58634, + "align-center-horizontal-simple": 60174, + "align-center-vertical": 58636, + "align-center-vertical-simple": 60176, + "align-left": 58638, + "align-left-simple": 60142, + "align-right": 58640, + "align-right-simple": 60178, + "align-top": 58642, + "align-top-simple": 60180, + "amazon-logo": 59756, + "ambulance": 58738, + "anchor": 58644, + "anchor-simple": 58840, + "android-logo": 57352, + "angle": 59324, + "angular-logo": 60288, + "aperture": 57354, + "app-store-logo": 59764, + "app-window": 58842, + "apple-logo": 58646, + "apple-podcasts-logo": 60310, + "approximate-equals": 60842, + "archive": 57356, + "archive-box": 57358, + "archive-tray": 57360, + "armchair": 57362, + "arrow-arc-left": 57364, + "arrow-arc-right": 57366, + "arrow-bend-double-up-left": 57402, + "arrow-bend-double-up-right": 57404, + "arrow-bend-down-left": 57368, + "arrow-bend-down-right": 57370, + "arrow-bend-left-down": 57372, + "arrow-bend-left-up": 57374, + "arrow-bend-right-down": 57376, + "arrow-bend-right-up": 57378, + "arrow-bend-up-left": 57380, + "arrow-bend-up-right": 57382, + "arrow-circle-down": 57384, + "arrow-circle-down-left": 57386, + "arrow-circle-down-right": 57388, + "arrow-circle-left": 57434, + "arrow-circle-right": 57390, + "arrow-circle-up": 57392, + "arrow-circle-up-left": 57394, + "arrow-circle-up-right": 57396, + "arrow-clockwise": 57398, + "arrow-counter-clockwise": 57400, + "arrow-down": 57406, + "arrow-down-left": 57408, + "arrow-down-right": 57410, + "arrow-elbow-down-left": 57412, + "arrow-elbow-down-right": 57414, + "arrow-elbow-left": 57416, + "arrow-elbow-left-down": 57418, + "arrow-elbow-left-up": 57420, + "arrow-elbow-right": 57422, + "arrow-elbow-right-down": 57424, + "arrow-elbow-right-up": 57426, + "arrow-elbow-up-left": 57428, + "arrow-elbow-up-right": 57430, + "arrow-fat-down": 58648, + "arrow-fat-left": 58650, + "arrow-fat-line-down": 58652, + "arrow-fat-line-left": 58654, + "arrow-fat-line-right": 58656, + "arrow-fat-line-up": 58658, + "arrow-fat-lines-down": 58660, + "arrow-fat-lines-left": 58662, + "arrow-fat-lines-right": 58664, + "arrow-fat-lines-up": 58666, + "arrow-fat-right": 58668, + "arrow-fat-up": 58670, + "arrow-left": 57432, + "arrow-line-down": 57436, + "arrow-line-down-left": 57438, + "arrow-line-down-right": 57440, + "arrow-line-left": 57442, + "arrow-line-right": 57444, + "arrow-line-up": 57446, + "arrow-line-up-left": 57448, + "arrow-line-up-right": 57450, + "arrow-right": 57452, + "arrow-square-down": 57454, + "arrow-square-down-left": 57456, + "arrow-square-down-right": 57458, + "arrow-square-in": 58844, + "arrow-square-left": 57460, + "arrow-square-out": 58846, + "arrow-square-right": 57462, + "arrow-square-up": 57464, + "arrow-square-up-left": 57466, + "arrow-square-up-right": 57468, + "arrow-u-down-left": 57470, + "arrow-u-down-right": 57472, + "arrow-u-left-down": 57474, + "arrow-u-left-up": 57476, + "arrow-u-right-down": 57478, + "arrow-u-right-up": 57480, + "arrow-u-up-left": 57482, + "arrow-u-up-right": 57484, + "arrow-up": 57486, + "arrow-up-left": 57488, + "arrow-up-right": 57490, + "arrows-clockwise": 57492, + "arrows-counter-clockwise": 57494, + "arrows-down-up": 57496, + "arrows-horizontal": 60166, + "arrows-in": 57498, + "arrows-in-cardinal": 57500, + "arrows-in-line-horizontal": 58672, + "arrows-in-line-vertical": 58674, + "arrows-in-simple": 57502, + "arrows-left-right": 57504, + "arrows-merge": 60734, + "arrows-out": 57506, + "arrows-out-cardinal": 57508, + "arrows-out-line-horizontal": 58676, + "arrows-out-line-vertical": 58678, + "arrows-out-simple": 57510, + "arrows-split": 60732, + "arrows-vertical": 60164, + "article": 57512, + "article-medium": 58848, + "article-ny-times": 58850, + "asclepius": 60980, + "asterisk": 57514, + "asterisk-simple": 59442, + "at": 57516, + "atom": 58852, + "avocado": 60932, + "axe": 59900, + "baby": 59252, + "baby-carriage": 59416, + "backpack": 59682, + "backspace": 57518, + "bag": 57520, + "bag-simple": 58854, + "balloon": 59244, + "bandaids": 57522, + "bank": 57524, + "barbell": 57526, + "barcode": 57528, + "barn": 60530, + "barricade": 59720, + "baseball": 59162, + "baseball-cap": 59944, + "baseball-helmet": 61002, + "basket": 59748, + "basketball": 59172, + "bathtub": 59422, + "battery-charging": 57530, + "battery-charging-vertical": 57532, + "battery-empty": 57534, + "battery-full": 57536, + "battery-high": 57538, + "battery-low": 57540, + "battery-medium": 57542, + "battery-plus": 59400, + "battery-plus-vertical": 60496, + "battery-vertical-empty": 59334, + "battery-vertical-full": 59332, + "battery-vertical-high": 59330, + "battery-vertical-low": 59326, + "battery-vertical-medium": 59328, + "battery-warning": 57544, + "battery-warning-vertical": 57546, + "beach-ball": 60708, + "beanie": 59946, + "bed": 57548, + "beer-bottle": 59312, + "beer-stein": 60258, + "behance-logo": 59380, + "bell": 57550, + "bell-ringing": 58856, + "bell-simple": 57552, + "bell-simple-ringing": 58858, + "bell-simple-slash": 57554, + "bell-simple-z": 58860, + "bell-slash": 57556, + "bell-z": 58862, + "belt": 59948, + "bezier-curve": 60160, + "bicycle": 57558, + "binary": 61024, + "binoculars": 60004, + "biohazard": 59872, + "bird": 59180, + "blueprint": 60832, + "bluetooth": 57562, + "bluetooth-connected": 57564, + "bluetooth-slash": 57566, + "bluetooth-x": 57568, + "boat": 59270, + "bomb": 60938, + "bone": 59378, + "book": 57570, + "book-bookmark": 57572, + "book-open": 57574, + "book-open-text": 59634, + "book-open-user": 60896, + "bookmark": 57576, + "bookmark-simple": 57578, + "bookmarks": 57580, + "bookmarks-simple": 58864, + "books": 59224, + "boot": 60618, + "boules": 59170, + "bounding-box": 59086, + "bowl-food": 60068, + "bowl-steam": 59620, + "bowling-ball": 59956, + "box-arrow-down": 57358, + "box-arrow-up": 61012, + "boxing-glove": 59958, + "brackets-angle": 59490, + "brackets-curly": 59488, + "brackets-round": 59492, + "brackets-square": 59486, + "brain": 59214, + "brandy": 59060, + "bread": 59420, + "bridge": 60008, + "briefcase": 57582, + "briefcase-metal": 58866, + "broadcast": 57586, + "broom": 60500, + "browser": 57588, + "browsers": 57590, + "bug": 58868, + "bug-beetle": 58870, + "bug-droid": 58872, + "building": 57600, + "building-apartment": 57598, + "building-office": 57599, + "buildings": 57602, + "bulldozer": 60524, + "bus": 57606, + "butterfly": 60014, + "cable-car": 58524, + "cactus": 59672, + "caduceus": 60980, + "cake": 59264, + "calculator": 58680, + "calendar": 57608, + "calendar-blank": 57610, + "calendar-check": 59154, + "calendar-dot": 59314, + "calendar-dots": 59316, + "calendar-heart": 59568, + "calendar-minus": 59924, + "calendar-plus": 59156, + "calendar-slash": 59922, + "calendar-star": 59570, + "calendar-x": 57612, + "call-bell": 59358, + "camera": 57614, + "camera-plus": 60504, + "camera-rotate": 59300, + "camera-slash": 57616, + "campfire": 59864, + "car": 57618, + "car-battery": 60976, + "car-profile": 59596, + "car-simple": 57620, + "cardholder": 58874, + "cards": 57592, + "cards-three": 61008, + "caret-circle-double-down": 57622, + "caret-circle-double-left": 57624, + "caret-circle-double-right": 57626, + "caret-circle-double-up": 57628, + "caret-circle-down": 57630, + "caret-circle-left": 57632, + "caret-circle-right": 57634, + "caret-circle-up": 57636, + "caret-circle-up-down": 57662, + "caret-double-down": 57638, + "caret-double-left": 57640, + "caret-double-right": 57642, + "caret-double-up": 57644, + "caret-down": 57654, + "caret-left": 57656, + "caret-line-down": 57652, + "caret-line-left": 57650, + "caret-line-right": 57648, + "caret-line-up": 57646, + "caret-right": 57658, + "caret-up": 57660, + "caret-up-down": 57664, + "carrot": 60728, + "cash-register": 60800, + "cassette-tape": 60718, + "castle-turret": 59856, + "cat": 59208, + "cell-signal-full": 57666, + "cell-signal-high": 57668, + "cell-signal-low": 57670, + "cell-signal-medium": 57672, + "cell-signal-none": 57674, + "cell-signal-slash": 57676, + "cell-signal-x": 57678, + "cell-tower": 60330, + "certificate": 59238, + "chair": 59728, + "chalkboard": 58876, + "chalkboard-simple": 58878, + "chalkboard-teacher": 58880, + "champagne": 60106, + "charging-station": 59600, + "chart-bar": 57680, + "chart-bar-horizontal": 57682, + "chart-donut": 60070, + "chart-line": 57684, + "chart-line-down": 59574, + "chart-line-up": 57686, + "chart-pie": 57688, + "chart-pie-slice": 57690, + "chart-polar": 60072, + "chart-scatter": 60076, + "chat": 57692, + "chat-centered": 57696, + "chat-centered-dots": 57700, + "chat-centered-slash": 57698, + "chat-centered-text": 57702, + "chat-circle": 57704, + "chat-circle-dots": 57708, + "chat-circle-slash": 57706, + "chat-circle-text": 57710, + "chat-dots": 57712, + "chat-slash": 57694, + "chat-teardrop": 57714, + "chat-teardrop-dots": 57718, + "chat-teardrop-slash": 57716, + "chat-teardrop-text": 57720, + "chat-text": 57722, + "chats": 57724, + "chats-circle": 57726, + "chats-teardrop": 57728, + "check": 57730, + "check-circle": 57732, + "check-fat": 60326, + "check-square": 57734, + "check-square-offset": 57736, + "checkerboard": 59588, + "checks": 58682, + "cheers": 59978, + "cheese": 59902, + "chef-hat": 60814, + "cherries": 59440, + "church": 60650, + "cigarette": 60816, + "cigarette-slash": 60818, + "circle": 57738, + "circle-dashed": 58882, + "circle-half": 57740, + "circle-half-tilt": 57742, + "circle-notch": 60228, + "circle-wavy": 58884, + "circle-wavy-check": 58886, + "circle-wavy-question": 58888, + "circle-wavy-warning": 58892, + "circles-four": 57744, + "circles-three": 57746, + "circles-three-plus": 57748, + "circuitry": 59842, + "city": 60010, + "clipboard": 57750, + "clipboard-text": 57752, + "clock": 57754, + "clock-afternoon": 57756, + "clock-clockwise": 57758, + "clock-countdown": 60716, + "clock-counter-clockwise": 57760, + "clock-user": 60908, + "closed-captioning": 57764, + "cloud": 57770, + "cloud-arrow-down": 57772, + "cloud-arrow-up": 57774, + "cloud-check": 57776, + "cloud-fog": 58684, + "cloud-lightning": 57778, + "cloud-moon": 58686, + "cloud-rain": 57780, + "cloud-slash": 57782, + "cloud-snow": 57784, + "cloud-sun": 58688, + "cloud-warning": 60056, + "cloud-x": 60054, + "clover": 60872, + "club": 57786, + "coat-hanger": 59390, + "coda-logo": 59342, + "code": 57788, + "code-block": 60158, + "code-simple": 57790, + "codepen-logo": 59768, + "codesandbox-logo": 59910, + "coffee": 57794, + "coffee-bean": 57792, + "coin": 58894, + "coin-vertical": 60232, + "coins": 59278, + "columns": 58694, + "columns-plus-left": 58692, + "columns-plus-right": 58690, + "command": 57796, + "compass": 57800, + "compass-rose": 57798, + "compass-tool": 59918, + "computer-tower": 58696, + "confetti": 59418, + "contactless-payment": 60738, + "control": 60582, + "cookie": 59082, + "cooking-pot": 59236, + "copy": 57802, + "copy-simple": 57804, + "copyleft": 59498, + "copyright": 58698, + "corners-in": 57806, + "corners-out": 57808, + "couch": 59382, + "court-basketball": 60982, + "cow": 60094, + "cowboy-hat": 60690, + "cpu": 58896, + "crane": 60744, + "crane-tower": 60745, + "credit-card": 57810, + "cricket": 60946, + "crop": 57812, + "cross": 59552, + "crosshair": 57814, + "crosshair-simple": 57816, + "crown": 58900, + "crown-cross": 61022, + "crown-simple": 58902, + "cube": 57818, + "cube-focus": 60682, + "cube-transparent": 60540, + "currency-btc": 58904, + "currency-circle-dollar": 58700, + "currency-cny": 58702, + "currency-dollar": 58704, + "currency-dollar-simple": 58706, + "currency-eth": 60122, + "currency-eur": 58708, + "currency-gbp": 58710, + "currency-inr": 58712, + "currency-jpy": 58714, + "currency-krw": 58716, + "currency-kzt": 60492, + "currency-ngn": 60242, + "currency-rub": 58718, + "cursor": 57820, + "cursor-click": 59336, + "cursor-text": 59352, + "cylinder": 59644, + "database": 57822, + "desk": 60694, + "desktop": 58720, + "desktop-tower": 58722, + "detective": 59454, + "dev-to-logo": 60686, + "device-mobile": 57824, + "device-mobile-camera": 57826, + "device-mobile-slash": 60998, + "device-mobile-speaker": 57828, + "device-rotate": 60914, + "device-tablet": 57830, + "device-tablet-camera": 57832, + "device-tablet-speaker": 57834, + "devices": 60324, + "diamond": 57836, + "diamonds-four": 59636, + "dice-five": 57838, + "dice-four": 57840, + "dice-one": 57842, + "dice-six": 57844, + "dice-three": 57846, + "dice-two": 57848, + "disc": 58724, + "disco-ball": 60824, + "discord-logo": 58906, + "divide": 57850, + "dna": 59684, + "dog": 59210, + "door": 58908, + "door-open": 59366, + "dot": 60638, + "dot-outline": 60640, + "dots-nine": 57852, + "dots-six": 59284, + "dots-six-vertical": 60130, + "dots-three": 57854, + "dots-three-circle": 57856, + "dots-three-circle-vertical": 57858, + "dots-three-outline": 57860, + "dots-three-outline-vertical": 57862, + "dots-three-vertical": 57864, + "download": 57866, + "download-simple": 57868, + "dress": 60030, + "dresser": 59726, + "dribbble-logo": 57870, + "drone": 60788, + "drop": 57872, + "drop-half": 58726, + "drop-half-bottom": 60224, + "drop-simple": 60978, + "drop-slash": 59732, + "dropbox-logo": 59344, + "ear": 59148, + "ear-slash": 59150, + "egg": 59410, + "egg-crack": 60260, + "eject": 57874, + "eject-simple": 59054, + "elevator": 60608, + "empty": 60860, + "engine": 60032, + "envelope": 57876, + "envelope-open": 57878, + "envelope-simple": 57880, + "envelope-simple-open": 57882, + "equalizer": 60348, + "equals": 57884, + "eraser": 57886, + "escalator-down": 60602, + "escalator-up": 60604, + "exam": 59202, + "exclamation-mark": 60996, + "exclude": 59522, + "exclude-square": 59520, + "export": 60144, + "eye": 57888, + "eye-closed": 57890, + "eye-slash": 57892, + "eyedropper": 58728, + "eyedropper-sample": 60100, + "eyeglasses": 59322, + "eyes": 61020, + "face-mask": 58730, + "facebook-logo": 57894, + "factory": 59232, + "faders": 57896, + "faders-horizontal": 57898, + "fallout-shelter": 59870, + "fan": 59890, + "farm": 60528, + "fast-forward": 59046, + "fast-forward-circle": 57900, + "feather": 59840, + "fediverse-logo": 60774, + "figma-logo": 57902, + "file": 57904, + "file-archive": 60202, + "file-arrow-down": 57906, + "file-arrow-up": 58910, + "file-audio": 59936, + "file-c": 60210, + "file-c-sharp": 60208, + "file-cloud": 59742, + "file-code": 59668, + "file-cpp": 60206, + "file-css": 60212, + "file-csv": 60188, + "file-dashed": 59140, + "file-doc": 60190, + "file-dotted": 59140, + "file-html": 60216, + "file-image": 59940, + "file-ini": 60211, + "file-jpg": 60186, + "file-js": 60196, + "file-jsx": 60218, + "file-lock": 59740, + "file-magnifying-glass": 57912, + "file-md": 60752, + "file-minus": 57908, + "file-pdf": 59138, + "file-plus": 57910, + "file-png": 60184, + "file-ppt": 60192, + "file-py": 60204, + "file-rs": 60200, + "file-search": 57912, + "file-sql": 60750, + "file-svg": 60680, + "file-text": 57914, + "file-ts": 60198, + "file-tsx": 60220, + "file-txt": 60213, + "file-video": 59938, + "file-vue": 60222, + "file-x": 57916, + "file-xls": 60194, + "file-zip": 59736, + "files": 59152, + "film-reel": 59584, + "film-script": 60240, + "film-slate": 59586, + "film-strip": 59282, + "fingerprint": 57918, + "fingerprint-simple": 57920, + "finn-the-human": 58732, + "fire": 57922, + "fire-extinguisher": 59880, + "fire-simple": 58912, + "fire-truck": 58740, + "first-aid": 58734, + "first-aid-kit": 58736, + "fish": 59176, + "fish-simple": 59178, + "flag": 57924, + "flag-banner": 58914, + "flag-banner-fold": 60658, + "flag-checkered": 59960, + "flag-pennant": 60656, + "flame": 58916, + "flashlight": 57926, + "flask": 59294, + "flip-horizontal": 60778, + "flip-vertical": 60780, + "floppy-disk": 57928, + "floppy-disk-back": 60148, + "flow-arrow": 59116, + "flower": 59230, + "flower-lotus": 59084, + "flower-tulip": 60108, + "flying-saucer": 60234, + "folder": 57930, + "folder-dashed": 59640, + "folder-dotted": 59640, + "folder-lock": 59964, + "folder-minus": 57940, + "folder-notch": 57930, + "folder-notch-minus": 57940, + "folder-notch-open": 57942, + "folder-notch-plus": 57944, + "folder-open": 57942, + "folder-plus": 57944, + "folder-simple": 57946, + "folder-simple-dashed": 60458, + "folder-simple-dotted": 60458, + "folder-simple-lock": 60254, + "folder-simple-minus": 57948, + "folder-simple-plus": 57950, + "folder-simple-star": 60462, + "folder-simple-user": 60256, + "folder-star": 60038, + "folder-user": 60230, + "folders": 57952, + "football": 59160, + "football-helmet": 61004, + "footprints": 60040, + "fork-knife": 57954, + "four-k": 59996, + "frame-corners": 58918, + "framer-logo": 57956, + "function": 60388, + "funnel": 57958, + "funnel-simple": 57960, + "funnel-simple-x": 57962, + "funnel-x": 57964, + "game-controller": 57966, + "garage": 60630, + "gas-can": 59598, + "gas-pump": 59240, + "gauge": 58920, + "gavel": 59954, + "gear": 57968, + "gear-fine": 59516, + "gear-six": 57970, + "gender-female": 59104, + "gender-intersex": 59110, + "gender-male": 59106, + "gender-neuter": 59114, + "gender-nonbinary": 59108, + "gender-transgender": 59112, + "ghost": 58922, + "gif": 57972, + "gift": 57974, + "git-branch": 57976, + "git-commit": 57978, + "git-diff": 57980, + "git-fork": 57982, + "git-merge": 57984, + "git-pull-request": 57986, + "github-logo": 58742, + "gitlab-logo": 59028, + "gitlab-logo-simple": 59030, + "globe": 57992, + "globe-hemisphere-east": 57994, + "globe-hemisphere-west": 57996, + "globe-simple": 57998, + "globe-simple-x": 57988, + "globe-stand": 58000, + "globe-x": 57990, + "goggles": 60596, + "golf": 59966, + "goodreads-logo": 60688, + "google-cardboard-logo": 59318, + "google-chrome-logo": 59766, + "google-drive-logo": 59638, + "google-logo": 58002, + "google-photos-logo": 60306, + "google-play-logo": 58004, + "google-podcasts-logo": 60308, + "gps": 60888, + "gps-fix": 60886, + "gps-slash": 60884, + "gradient": 60226, + "graduation-cap": 58924, + "grains": 60520, + "grains-slash": 60522, + "graph": 60248, + "graphics-card": 58898, + "greater-than": 60868, + "greater-than-or-equal": 60834, + "grid-four": 58006, + "grid-nine": 60556, + "guitar": 60042, + "hair-dryer": 60006, + "hamburger": 59280, + "hammer": 59406, + "hand": 58008, + "hand-arrow-down": 59982, + "hand-arrow-up": 61018, + "hand-coins": 60044, + "hand-deposit": 61058, + "hand-eye": 59980, + "hand-fist": 58746, + "hand-grabbing": 58748, + "hand-heart": 59408, + "hand-palm": 58750, + "hand-peace": 59340, + "hand-pointing": 58010, + "hand-soap": 58928, + "hand-swipe-left": 60564, + "hand-swipe-right": 60562, + "hand-tap": 60560, + "hand-waving": 58752, + "hand-withdraw": 61056, + "handbag": 58012, + "handbag-simple": 58926, + "hands-clapping": 59040, + "hands-praying": 60616, + "handshake": 58754, + "hard-drive": 58014, + "hard-drives": 58016, + "hard-hat": 60742, + "hash": 58018, + "hash-straight": 58020, + "head-circuit": 59348, + "headlights": 59134, + "headphones": 58022, + "headset": 58756, + "heart": 58024, + "heart-break": 60392, + "heart-half": 60488, + "heart-straight": 58026, + "heart-straight-break": 60312, + "heartbeat": 58028, + "hexagon": 58030, + "high-definition": 60046, + "high-heel": 59624, + "highlighter": 60534, + "highlighter-circle": 58930, + "hockey": 60550, + "hoodie": 60624, + "horse": 58032, + "hospital": 59460, + "hourglass": 58034, + "hourglass-high": 58036, + "hourglass-low": 58038, + "hourglass-medium": 58040, + "hourglass-simple": 58042, + "hourglass-simple-high": 58044, + "hourglass-simple-low": 58046, + "hourglass-simple-medium": 58048, + "house": 58050, + "house-line": 58052, + "house-simple": 58054, + "hurricane": 59534, + "ice-cream": 59396, + "identification-badge": 59126, + "identification-card": 58056, + "image": 58058, + "image-broken": 59304, + "image-square": 58060, + "images": 59446, + "images-square": 59444, + "infinity": 58932, + "info": 58062, + "instagram-logo": 58064, + "intersect": 58066, + "intersect-square": 59514, + "intersect-three": 60612, + "intersection": 60858, + "invoice": 60994, + "island": 60934, + "jar": 59360, + "jar-label": 59361, + "jeep": 58068, + "joystick": 59998, + "kanban": 60244, + "key": 58070, + "key-return": 59266, + "keyboard": 58072, + "keyhole": 60024, + "knife": 58934, + "ladder": 59876, + "ladder-simple": 60454, + "lamp": 58936, + "lamp-pendant": 60974, + "laptop": 58758, + "lasso": 60870, + "lastfm-logo": 59458, + "layout": 59094, + "leaf": 58074, + "lectern": 59738, + "lego": 59590, + "lego-smiley": 59591, + "lemniscate": 58932, + "less-than": 60844, + "less-than-or-equal": 60836, + "letter-circle-h": 60408, + "letter-circle-p": 60424, + "letter-circle-v": 60436, + "lifebuoy": 58938, + "lightbulb": 58076, + "lightbulb-filament": 58940, + "lighthouse": 59894, + "lightning": 58078, + "lightning-a": 60036, + "lightning-slash": 58080, + "line-segment": 59090, + "line-segments": 59092, + "line-vertical": 60784, + "link": 58082, + "link-break": 58084, + "link-simple": 58086, + "link-simple-break": 58088, + "link-simple-horizontal": 58090, + "link-simple-horizontal-break": 58092, + "linkedin-logo": 58094, + "linktree-logo": 60910, + "linux-logo": 60162, + "list": 58096, + "list-bullets": 58098, + "list-checks": 60124, + "list-dashes": 58100, + "list-heart": 60382, + "list-magnifying-glass": 60384, + "list-numbers": 58102, + "list-plus": 58104, + "list-star": 60380, + "lock": 58106, + "lock-key": 58110, + "lock-key-open": 58112, + "lock-laminated": 58114, + "lock-laminated-open": 58116, + "lock-open": 58118, + "lock-simple": 58120, + "lock-simple-open": 58122, + "lockers": 60600, + "log": 60802, + "magic-wand": 59062, + "magnet": 59008, + "magnet-straight": 59010, + "magnifying-glass": 58124, + "magnifying-glass-minus": 58126, + "magnifying-glass-plus": 58128, + "mailbox": 60446, + "map-pin": 58134, + "map-pin-area": 60986, + "map-pin-line": 58136, + "map-pin-plus": 58132, + "map-pin-simple": 60990, + "map-pin-simple-area": 60988, + "map-pin-simple-line": 60984, + "map-trifold": 58138, + "markdown-logo": 58632, + "marker-circle": 58944, + "martini": 58140, + "mask-happy": 59892, + "mask-sad": 60318, + "mastodon-logo": 60776, + "math-operations": 58142, + "matrix-logo": 60772, + "medal": 58144, + "medal-military": 60668, + "medium-logo": 58146, + "megaphone": 58148, + "megaphone-simple": 58946, + "member-of": 60866, + "memory": 59844, + "messenger-logo": 59096, + "meta-logo": 60674, + "meteor": 59834, + "metronome": 60558, + "microphone": 58150, + "microphone-slash": 58152, + "microphone-stage": 59228, + "microscope": 60538, + "microsoft-excel-logo": 60268, + "microsoft-outlook-logo": 60272, + "microsoft-powerpoint-logo": 60110, + "microsoft-teams-logo": 60262, + "microsoft-word-logo": 60266, + "minus": 58154, + "minus-circle": 58156, + "minus-square": 60748, + "money": 58760, + "money-wavy": 61032, + "monitor": 58158, + "monitor-arrow-up": 58762, + "monitor-play": 58764, + "moon": 58160, + "moon-stars": 58766, + "moped": 59428, + "moped-front": 59426, + "mosque": 60654, + "motorcycle": 59402, + "mountains": 59310, + "mouse": 58170, + "mouse-left-click": 58164, + "mouse-middle-click": 58168, + "mouse-right-click": 58166, + "mouse-scroll": 58162, + "mouse-simple": 58948, + "music-note": 58172, + "music-note-simple": 58174, + "music-notes": 58176, + "music-notes-minus": 60940, + "music-notes-plus": 60284, + "music-notes-simple": 58178, + "navigation-arrow": 60126, + "needle": 59438, + "network": 60894, + "network-slash": 60892, + "network-x": 60890, + "newspaper": 58180, + "newspaper-clipping": 58182, + "not-equals": 60838, + "not-member-of": 60846, + "not-subset-of": 60848, + "not-superset-of": 60850, + "notches": 60730, + "note": 58184, + "note-blank": 58186, + "note-pencil": 58188, + "notebook": 58190, + "notepad": 58942, + "notification": 59130, + "notion-logo": 59808, + "nuclear-plant": 60796, + "number-circle-eight": 58194, + "number-circle-five": 58200, + "number-circle-four": 58206, + "number-circle-nine": 58212, + "number-circle-one": 58218, + "number-circle-seven": 58224, + "number-circle-six": 58230, + "number-circle-three": 58236, + "number-circle-two": 58242, + "number-circle-zero": 58248, + "number-eight": 58192, + "number-five": 58198, + "number-four": 58204, + "number-nine": 58210, + "number-one": 58216, + "number-seven": 58222, + "number-six": 58228, + "number-square-eight": 58196, + "number-square-five": 58202, + "number-square-four": 58208, + "number-square-nine": 58214, + "number-square-one": 58220, + "number-square-seven": 58226, + "number-square-six": 58232, + "number-square-three": 58238, + "number-square-two": 58244, + "number-square-zero": 58250, + "number-three": 58234, + "number-two": 58240, + "number-zero": 58246, + "numpad": 58312, + "nut": 58252, + "ny-times-logo": 58950, + "octagon": 58254, + "office-chair": 59974, + "onigiri": 60972, + "open-ai-logo": 59346, + "option": 59560, + "orange": 60992, + "orange-slice": 60726, + "oven": 60812, + "package": 58256, + "paint-brush": 59120, + "paint-brush-broad": 58768, + "paint-brush-household": 59122, + "paint-bucket": 58258, + "paint-roller": 59124, + "palette": 59080, + "panorama": 60066, + "pants": 60552, + "paper-plane": 58260, + "paper-plane-right": 58262, + "paper-plane-tilt": 58264, + "paperclip": 58266, + "paperclip-horizontal": 58770, + "parachute": 60028, + "paragraph": 59744, + "parallelogram": 60614, + "park": 60594, + "password": 59218, + "path": 58268, + "patreon-logo": 59786, + "pause": 58270, + "pause-circle": 58272, + "paw-print": 58952, + "paypal-logo": 59788, + "peace": 58274, + "pen": 58282, + "pen-nib": 58284, + "pen-nib-straight": 58954, + "pencil": 58286, + "pencil-circle": 58288, + "pencil-line": 58290, + "pencil-ruler": 59654, + "pencil-simple": 58292, + "pencil-simple-line": 60358, + "pencil-simple-slash": 60662, + "pencil-slash": 60664, + "pentagon": 60542, + "pentagram": 60508, + "pepper": 59722, + "percent": 58294, + "person": 58280, + "person-arms-spread": 60670, + "person-simple": 59182, + "person-simple-bike": 59188, + "person-simple-circle": 61016, + "person-simple-hike": 60756, + "person-simple-run": 59184, + "person-simple-ski": 59164, + "person-simple-snowboard": 59166, + "person-simple-swim": 59190, + "person-simple-tai-chi": 60764, + "person-simple-throw": 59186, + "person-simple-walk": 59194, + "perspective": 60390, + "phone": 58296, + "phone-call": 58298, + "phone-disconnect": 58300, + "phone-incoming": 58302, + "phone-list": 58316, + "phone-outgoing": 58304, + "phone-pause": 58314, + "phone-plus": 60502, + "phone-slash": 58306, + "phone-transfer": 58310, + "phone-x": 58308, + "phosphor-logo": 58318, + "pi": 60544, + "piano-keys": 59848, + "picnic-table": 60966, + "picture-in-picture": 58956, + "piggy-bank": 59908, + "pill": 59136, + "ping-pong": 59970, + "pint-glass": 60880, + "pinterest-logo": 58958, + "pinwheel": 60316, + "pipe": 60806, + "pipe-wrench": 60808, + "pix-logo": 60610, + "pizza": 59286, + "placeholder": 58960, + "planet": 58962, + "plant": 60334, + "play": 58320, + "play-circle": 58322, + "play-pause": 59582, + "playlist": 59050, + "plug": 59718, + "plug-charging": 60252, + "plugs": 60246, + "plugs-connected": 60250, + "plus": 58324, + "plus-circle": 58326, + "plus-minus": 58328, + "plus-square": 60746, + "poker-chip": 58772, + "police-car": 60490, + "polygon": 59088, + "popcorn": 60238, + "popsicle": 60350, + "potted-plant": 60450, + "power": 58330, + "prescription": 59298, + "presentation": 58964, + "presentation-chart": 58966, + "printer": 58332, + "prohibit": 58334, + "prohibit-inset": 58336, + "projector-screen": 58968, + "projector-screen-chart": 58970, + "pulse": 57344, + "push-pin": 58338, + "push-pin-simple": 58972, + "push-pin-simple-slash": 58974, + "push-pin-slash": 58340, + "puzzle-piece": 58774, + "qr-code": 58342, + "question": 58344, + "question-mark": 58345, + "queue": 59052, + "quotes": 58976, + "rabbit": 60098, + "racquet": 60930, + "radical": 58346, + "radio": 59262, + "radio-button": 60168, + "radioactive": 59868, + "rainbow": 58776, + "rainbow-cloud": 58778, + "ranking": 60770, + "read-cv-logo": 60684, + "receipt": 58348, + "receipt-x": 60736, + "record": 58350, + "rectangle": 58352, + "rectangle-dashed": 58354, + "recycle": 59226, + "reddit-logo": 58780, + "repeat": 58358, + "repeat-once": 58360, + "replit-logo": 60298, + "resize": 60782, + "rewind": 59048, + "rewind-circle": 58362, + "road-horizon": 59448, + "robot": 59234, + "rocket": 58364, + "rocket-launch": 58366, + "rows": 58786, + "rows-plus-bottom": 58782, + "rows-plus-top": 58784, + "rss": 58368, + "rss-simple": 58370, + "rug": 59930, + "ruler": 59064, + "sailboat": 59274, + "scales": 59216, + "scan": 60342, + "scan-smiley": 60340, + "scissors": 60128, + "scooter": 59424, + "screencast": 58372, + "screwdriver": 59502, + "scribble": 59398, + "scribble-loop": 58978, + "scroll": 60282, + "seal": 58884, + "seal-check": 58886, + "seal-percent": 58890, + "seal-question": 58888, + "seal-warning": 58892, + "seat": 60302, + "seatbelt": 60926, + "security-camera": 60580, + "selection": 59034, + "selection-all": 59206, + "selection-background": 60152, + "selection-foreground": 60150, + "selection-inverse": 59204, + "selection-plus": 59036, + "selection-slash": 59038, + "shapes": 60510, + "share": 58374, + "share-fat": 60754, + "share-network": 58376, + "shield": 58378, + "shield-check": 58380, + "shield-checkered": 59144, + "shield-chevron": 58382, + "shield-plus": 59142, + "shield-slash": 58384, + "shield-star": 60468, + "shield-warning": 58386, + "shipping-container": 59276, + "shirt-folded": 60050, + "shooting-star": 60666, + "shopping-bag": 58390, + "shopping-bag-open": 58392, + "shopping-cart": 58398, + "shopping-cart-simple": 58400, + "shovel": 59878, + "shower": 59254, + "shrimp": 60084, + "shuffle": 58402, + "shuffle-angular": 58404, + "shuffle-simple": 58406, + "sidebar": 60086, + "sidebar-simple": 60452, + "sigma": 60088, + "sign-in": 58408, + "sign-out": 58410, + "signature": 60332, + "signpost": 59548, + "sim-card": 58980, + "siren": 59832, + "sketch-logo": 58412, + "skip-back": 58788, + "skip-back-circle": 58414, + "skip-forward": 58790, + "skip-forward-circle": 58416, + "skull": 59670, + "skype-logo": 59612, + "slack-logo": 58792, + "sliders": 58418, + "sliders-horizontal": 58420, + "slideshow": 60722, + "smiley": 58422, + "smiley-angry": 60514, + "smiley-blank": 58424, + "smiley-meh": 58426, + "smiley-melting": 61014, + "smiley-nervous": 58428, + "smiley-sad": 58430, + "smiley-sticker": 58432, + "smiley-wink": 58982, + "smiley-x-eyes": 58434, + "snapchat-logo": 58984, + "sneaker": 59404, + "sneaker-move": 60768, + "snowflake": 58794, + "soccer-ball": 59158, + "sock": 60622, + "solar-panel": 60794, + "solar-roof": 60795, + "sort-ascending": 58436, + "sort-descending": 58438, + "soundcloud-logo": 59614, + "spade": 58440, + "sparkle": 59042, + "speaker-hifi": 59912, + "speaker-high": 58442, + "speaker-low": 58444, + "speaker-none": 58446, + "speaker-simple-high": 58448, + "speaker-simple-low": 58450, + "speaker-simple-none": 58452, + "speaker-simple-slash": 58454, + "speaker-simple-x": 58456, + "speaker-slash": 58458, + "speaker-x": 58460, + "speedometer": 61044, + "sphere": 61030, + "spinner": 58986, + "spinner-ball": 60968, + "spinner-gap": 58988, + "spiral": 59898, + "split-horizontal": 59506, + "split-vertical": 59510, + "spotify-logo": 58990, + "spray-bottle": 59364, + "square": 58462, + "square-half": 58466, + "square-half-bottom": 60182, + "square-logo": 59024, + "square-split-horizontal": 59504, + "square-split-vertical": 59508, + "squares-four": 58468, + "stack": 58470, + "stack-minus": 60916, + "stack-overflow-logo": 60280, + "stack-plus": 60918, + "stack-simple": 58472, + "stairs": 59628, + "stamp": 59976, + "standard-definition": 60048, + "star": 58474, + "star-and-crescent": 60660, + "star-four": 59044, + "star-half": 59146, + "star-of-david": 59550, + "steam-logo": 60116, + "steering-wheel": 59820, + "steps": 60606, + "stethoscope": 59370, + "sticker": 58796, + "stool": 59972, + "stop": 58476, + "stop-circle": 58478, + "storefront": 58480, + "strategy": 59962, + "stripe-logo": 59032, + "student": 59198, + "subset-of": 60864, + "subset-proper-of": 60854, + "subtitles": 57768, + "subtitles-slash": 57766, + "subtract": 60374, + "subtract-square": 60372, + "subway": 58520, + "suitcase": 58798, + "suitcase-rolling": 59824, + "suitcase-simple": 58800, + "sun": 58482, + "sun-dim": 58484, + "sun-horizon": 58806, + "sunglasses": 59414, + "superset-of": 60856, + "superset-proper-of": 60852, + "swap": 59452, + "swatches": 58808, + "swimming-pool": 60598, + "sword": 58810, + "synagogue": 60652, + "syringe": 59752, + "t-shirt": 58992, + "table": 58486, + "tabs": 59256, + "tag": 58488, + "tag-chevron": 58994, + "tag-simple": 58490, + "target": 58492, + "taxi": 59650, + "tea-bag": 59622, + "telegram-logo": 58812, + "television": 59220, + "television-simple": 60134, + "tennis-ball": 59168, + "tent": 59578, + "terminal": 58494, + "terminal-window": 60136, + "test-tube": 59296, + "text-a-underline": 60724, + "text-aa": 59118, + "text-align-center": 58496, + "text-align-justify": 58498, + "text-align-left": 58500, + "text-align-right": 58502, + "text-b": 58814, + "text-bolder": 58814, + "text-columns": 60566, + "text-h": 59066, + "text-h-five": 59076, + "text-h-four": 59074, + "text-h-one": 59068, + "text-h-six": 59078, + "text-h-three": 59072, + "text-h-two": 59070, + "text-indent": 59934, + "text-italic": 58816, + "text-outdent": 59932, + "text-strikethrough": 58818, + "text-subscript": 60568, + "text-superscript": 60570, + "text-t": 58506, + "text-t-slash": 58504, + "text-underline": 58820, + "textbox": 60170, + "thermometer": 58822, + "thermometer-cold": 58824, + "thermometer-hot": 58826, + "thermometer-simple": 58828, + "threads-logo": 60830, + "three-d": 59994, + "thumbs-down": 58508, + "thumbs-up": 58510, + "ticket": 58512, + "tidal-logo": 60700, + "tiktok-logo": 60146, + "tilde": 60840, + "timer": 58514, + "tip-jar": 59362, + "tipi": 60720, + "tire": 60882, + "toggle-left": 58996, + "toggle-right": 58998, + "toilet": 59290, + "toilet-paper": 59292, + "toolbox": 60576, + "tooth": 59852, + "tornado": 59532, + "tote": 58516, + "tote-simple": 59000, + "towel": 60902, + "tractor": 60526, + "trademark": 59888, + "trademark-registered": 58356, + "traffic-cone": 59816, + "traffic-sign": 59002, + "traffic-signal": 59818, + "train": 58518, + "train-regional": 58526, + "train-simple": 58528, + "tram": 59884, + "translate": 58530, + "trash": 58534, + "trash-simple": 58536, + "tray": 58538, + "tray-arrow-down": 57360, + "tray-arrow-up": 61010, + "treasure-chest": 60898, + "tree": 59098, + "tree-evergreen": 59100, + "tree-palm": 59674, + "tree-structure": 59004, + "tree-view": 61000, + "trend-down": 58540, + "trend-up": 58542, + "triangle": 58544, + "triangle-dashed": 58546, + "trolley": 58802, + "trolley-suitcase": 58804, + "trophy": 59006, + "truck": 58548, + "truck-trailer": 58550, + "tumblr-logo": 59604, + "twitch-logo": 58830, + "twitter-logo": 58554, + "umbrella": 59012, + "umbrella-simple": 59014, + "union": 60862, + "unite": 59518, + "unite-square": 59512, + "upload": 58558, + "upload-simple": 58560, + "usb": 59734, + "user": 58562, + "user-check": 60154, + "user-circle": 58564, + "user-circle-check": 60472, + "user-circle-dashed": 60470, + "user-circle-gear": 58566, + "user-circle-minus": 58568, + "user-circle-plus": 58570, + "user-focus": 59132, + "user-gear": 58572, + "user-list": 59196, + "user-minus": 58574, + "user-plus": 58576, + "user-rectangle": 58578, + "user-sound": 60584, + "user-square": 58580, + "user-switch": 59222, + "users": 58582, + "users-four": 59020, + "users-three": 59022, + "van": 59430, + "vault": 59246, + "vector-three": 61026, + "vector-two": 61028, + "vibrate": 58584, + "video": 59200, + "video-camera": 58586, + "video-camera-slash": 58588, + "video-conference": 60878, + "vignette": 60322, + "vinyl-record": 60588, + "virtual-reality": 59320, + "virus": 59350, + "visor": 60970, + "voicemail": 58590, + "volleyball": 59174, + "wall": 59016, + "wallet": 59018, + "warehouse": 60628, + "warning": 58592, + "warning-circle": 58594, + "warning-diamond": 59388, + "warning-octagon": 58596, + "washing-machine": 60904, + "watch": 58598, + "wave-sawtooth": 60060, + "wave-sine": 60058, + "wave-square": 60062, + "wave-triangle": 60064, + "waveform": 59394, + "waveform-slash": 59392, + "waves": 59102, + "webcam": 59826, + "webcam-slash": 60636, + "webhooks-logo": 60590, + "wechat-logo": 59602, + "whatsapp-logo": 58832, + "wheelchair": 58600, + "wheelchair-motion": 59546, + "wifi-high": 58602, + "wifi-low": 58604, + "wifi-medium": 58606, + "wifi-none": 58608, + "wifi-slash": 58610, + "wifi-x": 58612, + "wind": 58834, + "windmill": 59896, + "windows-logo": 59026, + "wine": 59058, + "wrench": 58836, + "x": 58614, + "x-circle": 58616, + "x-logo": 58556, + "x-square": 58618, + "yarn": 60826, + "yin-yang": 59690, + "youtube-logo": 58620 + } + } + } +} diff --git a/pubspec.lock b/pubspec.lock index 1f19166..162afbf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -214,8 +214,8 @@ packages: dependency: transitive description: path: "packages/editor" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.1.0" @@ -223,8 +223,8 @@ packages: dependency: transitive description: path: "packages/mcp" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.1.0" @@ -232,8 +232,8 @@ packages: dependency: transitive description: path: "packages/preview" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.1.0" @@ -241,8 +241,8 @@ packages: dependency: transitive description: path: "packages/project" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.1.0" @@ -250,8 +250,8 @@ packages: dependency: transitive description: path: "packages/runtime" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.0.1" @@ -259,17 +259,17 @@ packages: dependency: "direct main" description: path: "." - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + tag-pattern: "v{{version}}" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git - version: "0.1.0" + version: "0.1.1" cutdex_timeline: dependency: transitive description: path: "packages/timeline" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.2.0" @@ -277,8 +277,8 @@ packages: dependency: transitive description: path: "packages/timeline_ui" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.1.0" @@ -286,8 +286,8 @@ packages: dependency: transitive description: path: "packages/tools" - ref: "58088065ee707e94dbd154265aa287ddbf33109c" - resolved-ref: "58088065ee707e94dbd154265aa287ddbf33109c" + ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" + resolved-ref: "8f8fb5bbeab604a7d60b6dfdfe4aec5ac92ea0d4" url: "ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git" source: git version: "0.1.0" diff --git a/pubspec.yaml b/pubspec.yaml index b3cdf53..455419c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cutdex description: "Cutdex video editing application." publish_to: none -version: 0.1.1+2 +version: 0.1.2+3 environment: sdk: ^3.13.4 @@ -28,7 +28,8 @@ dependencies: cutdex_sdk: git: url: ssh://git@git.orangraph.com:2222/lingjhf/cutdex_sdk.git - ref: 58088065ee707e94dbd154265aa287ddbf33109c + tag_pattern: v{{version}} + version: ^0.1.1 cutdex_agent: git: url: https://github.com/cutdex-ai/cutdex_agent.git diff --git a/test/adaptive_workspace_test.dart b/test/adaptive_workspace_test.dart index 50f1183..9885e3b 100644 --- a/test/adaptive_workspace_test.dart +++ b/test/adaptive_workspace_test.dart @@ -1,8 +1,11 @@ import 'package:cutdex/errors/app_failure.dart'; +import 'package:cutdex/features/settings/appearance_settings.dart'; import 'dart:async'; import 'package:cutdex/features/assistant/agent_composer_store.dart'; +import 'package:cutdex/features/assistant/floating_agent_panel.dart'; +import 'package:cutdex/features/assistant/chat_controller.dart'; import 'package:cutdex/features/projects/conversation_sidebar.dart'; import 'package:cutdex/integrations/platform/file_picker.dart'; import 'package:cutdex/workspace/external_media_import.dart'; @@ -14,24 +17,33 @@ import 'package:cutdex/features/editor/editor_page.dart'; import 'package:cutdex/features/media/media_browser_controller.dart'; import 'package:cutdex/features/media/media_browser_page.dart'; import 'package:cutdex/features/media/media_panel.dart'; +import 'package:cutdex/features/media/media_browser_body.dart'; +import 'package:cutdex/features/media/resource_navigation.dart'; import 'package:cutdex/features/properties/properties_editor_page.dart'; import 'package:cutdex/features/properties/properties_panel.dart'; import 'package:cutdex/features/preview/preview_panel.dart'; import 'package:cutdex/features/timeline/timeline_panel.dart'; import 'package:cutdex/integrations/agent/conversation_repository.dart'; import 'package:cutdex/integrations/platform/device_experience.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; import 'package:cutdex/persistence/app_database.dart'; import 'package:cutdex/persistence/app_settings_repositories.dart'; import 'package:cutdex/workspace/media_availability.dart'; import 'package:cutdex/workspace/project_state.dart'; import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/preview_target.dart'; import 'package:cutdex/workspace/timeline_provider.dart'; import 'package:cutdex/workspace/timeline_session.dart'; import 'package:cutdex/workspace/view_settings.dart'; import 'package:cutdex/workspace/workspace_mode.dart'; import 'package:cutdex_sdk/project.dart'; import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:cutdex_sdk/timeline/engine.dart'; +import 'package:cutdex_sdk/timeline/layout.dart'; import 'package:drift/native.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; @@ -40,12 +52,17 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'support/empty_conversation_repository.dart'; +import 'support/memory_app_settings.dart'; import 'support/preview_fixture.dart'; +Future floatOrDockChat(WidgetTester tester) async { + await tester.tap(find.byKey(const Key('agent-minimize-button'))); +} + void main() { test('space classes and two-pane decisions do not depend on workflow', () { - expect(WorkspaceLayoutPolicy.desktopNavigationFits(560), isFalse); - expect(WorkspaceLayoutPolicy.desktopNavigationFits(561), isTrue); + expect(WorkspaceLayoutPolicy.desktopNavigationFits(545), isFalse); + expect(WorkspaceLayoutPolicy.desktopNavigationFits(546), isTrue); expect(WorkspaceLayoutPolicy.showAgentBesideEditor(839), isFalse); expect(WorkspaceLayoutPolicy.showAgentBesideEditor(840), isTrue); }); @@ -66,6 +83,7 @@ void main() { AppFilePicker? picker, ConversationRepository? conversations, MediaImportResult? importResult, + PreviewTarget? previewTarget, }) async { tester.view.physicalSize = size; tester.view.devicePixelRatio = 1; @@ -84,6 +102,12 @@ void main() { if (delayedResolver != null) mediaFileResolverProvider.overrideWithValue(delayedResolver), appDatabaseProvider.overrideWithValue(database), + appearanceSettingsRepositoryProvider.overrideWithValue( + MemoryAppearanceSettingsRepository(), + ), + paletteSettingsRepositoryProvider.overrideWithValue( + MemoryPaletteSettingsRepository(), + ), timelineViewSettingsRepositoryProvider.overrideWithValue( _TimelineViewRepository(), ), @@ -94,6 +118,11 @@ void main() { (ref) async => conversations ?? EmptyConversationRepository(), ), editorPreviewProvider.overrideWith((ref, ids) => null), + if (previewTarget != null) + previewTargetProvider.overrideWith((ref, ids) { + ref.onDispose(previewTarget.dispose); + return previewTarget; + }), mediaAvailabilityProvider.overrideWith( (ref, ids) async => MediaAvailability.missing, ), @@ -138,48 +167,650 @@ void main() { await tester.pumpAndSettle(); } + testWidgets('desktop project hierarchy separates chat, media and timeline', ( + tester, + ) async { + final mounted = await mount(tester, const Size(1200, 800)); + final header = tester.getRect( + find.byKey(const Key('desktop-window-header')), + ); + final projectTab = find.byKey(ValueKey('project-tab-${mounted.projectId}')); + expect(header.contains(tester.getCenter(projectTab)), isTrue); + expect(find.byKey(const Key('sidebar-tab-chat')), findsNothing); + expect(find.byKey(const Key('sidebar-tab-resources')), findsNothing); + expect(find.byKey(const Key('desktop-navigation-rail')), findsNothing); + expect(find.byKey(const Key('media-project-button')), findsNothing); + expect(find.byKey(const Key('media-panel-close')), findsNothing); + final mediaHeader = find.byKey(const Key('media-panel-header')); + final l10n = AppLocalizations.of(tester.element(mediaHeader))!; + expect( + find.descendant(of: mediaHeader, matching: find.text(l10n.materials)), + findsNothing, + ); + final chat = tester.element(find.byType(AgentChatPanel)); + final editor = tester.element(find.byType(EditorWorkspace)); + final input = find.descendant( + of: find.byType(AgentChatPanel), + matching: find.byType(TextField), + ); + await tester.enterText(input, 'Keep project chat draft'); + final media = tester.getRect(find.byKey(const Key('editor-media-card'))); + final preview = tester.getRect( + find.byKey(const Key('editor-preview-card')), + ); + final timeline = tester.getRect( + find.byKey(const Key('editor-timeline-card')), + ); + final chatRect = tester.getRect(find.byKey(const Key('desktop-chat-card'))); + expect(media.left - chatRect.right, 6); + expect(preview.left - media.right, 6); + expect(media.top, preview.top); + expect(timeline.left, media.left); + expect(timeline.right, preview.right); + final previewElement = tester.element(find.byType(EditorPreviewPanel)); + await tester.tap(find.byKey(const Key('editor-media-button'))); + await tester.pumpAndSettle(); + expect(find.byType(MediaPanel), findsNothing); + expect( + tester.element(find.byType(EditorPreviewPanel)), + same(previewElement), + ); + await tester.tap(find.byKey(const Key('editor-media-button'))); + await tester.pumpAndSettle(); + expect(find.byType(MediaPanel), findsOneWidget); + expect(tester.element(find.byType(AgentChatPanel)), same(chat)); + expect(tester.element(find.byType(EditorWorkspace)), same(editor)); + expect( + tester.widget(input).controller!.text, + 'Keep project chat draft', + ); + expect(tester.takeException(), isNull); + await mounted.close(); + }); + + testWidgets('project tabs switch scoped drafts and preserve failed close', ( + tester, + ) async { + final mounted = await mount(tester, const Size(1800, 800)); + final projects = + mounted.container.read(projectsProvider.notifier) as _FixtureProjects; + projects.addRecent(); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-tab-other')), findsNothing); + final input = find.descendant( + of: find.byKey(const Key('agent-composer')), + matching: find.byType(TextField), + ); + await tester.enterText(input, 'Draft in first project'); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const ValueKey('project-menu-other'))); + await tester.pumpAndSettle(); + expect( + mounted.container.read(projectsProvider).requireValue.activeProject?.id, + 'other', + ); + expect(find.byKey(const ValueKey('project-tab-other')), findsOneWidget); + expect(tester.widget(input).controller!.text, isEmpty); + await tester.enterText(input, 'Draft in second project'); + await tester.tap(find.byKey(ValueKey('project-tab-${mounted.projectId}'))); + await tester.pumpAndSettle(); + expect( + tester.widget(input).controller!.text, + 'Draft in first project', + ); + await tester.tap( + find.byKey(ValueKey('project-tab-close-${mounted.projectId}')), + ); + await tester.pumpAndSettle(); + expect( + find.byKey(ValueKey('project-tab-${mounted.projectId}')), + findsNothing, + ); + expect( + mounted.container.read(projectsProvider).requireValue.activeProject?.id, + 'other', + ); + expect( + tester.widget(input).controller!.text, + 'Draft in second project', + ); + projects.closeSucceeds = false; + await tester.tap(find.byKey(const ValueKey('project-tab-close-other'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-tab-other')), findsOneWidget); + expect( + mounted.container.read(projectsProvider).requireValue.activeProject?.id, + 'other', + ); + projects.closeSucceeds = true; + await tester.tap(find.byKey(const ValueKey('project-tab-close-other'))); + await tester.pumpAndSettle(); + expect( + mounted.container.read(projectsProvider).requireValue.activeProject, + isNull, + ); + expect(find.byKey(const ValueKey('project-tab-other')), findsNothing); + expect( + mounted.container.read(projectsProvider).requireValue.recent.length, + 2, + ); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(ValueKey('project-menu-${mounted.projectId}'))); + await tester.pumpAndSettle(); + expect( + find.byKey(ValueKey('project-tab-${mounted.projectId}')), + findsOneWidget, + ); + expect( + tester.widget(input).controller!.text, + 'Draft in first project', + ); + expect(tester.takeException(), isNull); + await mounted.close(); + }); + testWidgets( - 'desktop navigation switches sidebar content and retains workspace', + 'header tabs survive history removal and close to an opened neighbor', (tester) async { - final mounted = await mount(tester, const Size(1200, 800)); - final headerToggle = find.byKey(const Key('project-sidebar-toggle')); - final headerTasks = find.byKey(const ValueKey('background-tasks-button')); - expect(tester.getSize(headerToggle), const Size.square(28)); - expect(tester.getSize(headerTasks), const Size.square(28)); - expect( - tester.getRect(headerToggle).center.dx, - tester.getRect(find.byKey(const Key('desktop-rail-cut'))).center.dx, - ); - expect( - tester.getRect(headerTasks).center.dx - - tester.getRect(headerToggle).center.dx, - 32, - ); - expect(find.byKey(const Key('desktop-rail-agent')), findsNothing); - expect(find.byKey(const Key('desktop-rail-cut')), findsOneWidget); - final library = find.byKey(const Key('desktop-rail-library')); - final editorElement = tester.element(find.byType(EditorWorkspace)); - await tester.tap(library); + final mounted = await mount(tester, const Size(1800, 800)); + final projects = + mounted.container.read(projectsProvider.notifier) as _FixtureProjects; + projects.addRecent(); await tester.pumpAndSettle(); - expect(find.byKey(const Key('desktop-library-workspace')), findsNothing); - expect(find.byType(EditorWorkspace), findsOneWidget); - expect( - tester.element(find.byType(EditorWorkspace, skipOffstage: false)), - same(editorElement), - ); - expect(find.byType(MediaPanel), findsOneWidget); - expect(tester.widget(library).isSelected, isTrue); - expect(find.byKey(const Key('project-settings-button')), findsOneWidget); - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); await tester.pumpAndSettle(); - expect(find.byKey(const Key('desktop-library-workspace')), findsNothing); - expect(tester.element(find.byType(EditorWorkspace)), same(editorElement)); - expect(find.byType(MediaPanel), findsNothing); + await tester.tap(find.byKey(const ValueKey('project-menu-other'))); + await tester.pumpAndSettle(); + projects.forgetRecent(mounted.projectId); + await tester.pumpAndSettle(); + expect( + find.byKey(ValueKey('project-tab-${mounted.projectId}')), + findsOneWidget, + ); + expect(find.byKey(const ValueKey('project-tab-other')), findsOneWidget); + expect(find.byKey(const Key('project-chat-sidebar')), findsOneWidget); + expect( + find.byKey(const Key('sidebar-projects-conversations')), + findsNothing, + ); + await tester.tap(find.byKey(const Key('project-tabs-list'))); + await tester.pumpAndSettle(); + expect( + find.byKey(ValueKey('project-tabs-menu-${mounted.projectId}')), + findsOneWidget, + ); + await tester.tap( + find.byKey(ValueKey('project-tabs-menu-${mounted.projectId}')), + ); + await tester.pumpAndSettle(); + expect( + mounted.container.read(projectsProvider).requireValue.activeProject?.id, + mounted.projectId, + ); + projects.forgetRecent('other'); + await tester.pumpAndSettle(); + await tester.tap( + find.byKey(ValueKey('project-tab-close-${mounted.projectId}')), + ); + await tester.pumpAndSettle(); + expect( + mounted.container.read(projectsProvider).requireValue.activeProject?.id, + 'other', + ); + expect( + find.byKey(ValueKey('project-tab-${mounted.projectId}')), + findsNothing, + ); + expect(find.byKey(const ValueKey('project-tab-other')), findsOneWidget); expect(tester.takeException(), isNull); await mounted.close(); }, ); + testWidgets( + 'header controls switch drawer and floating Agent at narrow widths', + (tester) async { + final mounted = await mount(tester, const Size(500, 800)); + final sidebar = find.byKey(const Key('project-sidebar-toggle')); + final minimize = find.byKey(const Key('agent-minimize-button')); + await tester.tap(sidebar); + await tester.pumpAndSettle(); + expect(find.byType(AgentChatPanel), findsOneWidget); + final input = find.descendant( + of: find.byKey(const Key('agent-composer')), + matching: find.byType(TextField), + ); + await tester.enterText(input, 'Narrow header draft'); + final controller = tester.widget(input).controller; + await tester.tap(minimize); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsOneWidget); + expect(find.byType(AgentChatPanel), findsNothing); + expect( + tester + .widget(find.byKey(const Key('floating-agent-input'))) + .controller, + same(controller), + ); + await tester.tap(minimize); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsNothing); + expect(find.byType(AgentChatPanel), findsOneWidget); + expect( + tester.widget(input).controller!.text, + 'Narrow header draft', + ); + await tester.tap(sidebar); + await tester.pumpAndSettle(); + expect(find.byType(AgentChatPanel), findsNothing); + await tester.tap(minimize); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsOneWidget); + await tester.tap(sidebar); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsNothing); + expect(find.byType(AgentChatPanel), findsOneWidget); + expect( + tester.widget(input).controller!.text, + 'Narrow header draft', + ); + expect(tester.takeException(), isNull); + await mounted.close(); + }, + ); + + testWidgets('chat collapse retains draft and editing session', ( + tester, + ) async { + final mounted = await mount(tester, const Size(1800, 800)); + final editor = tester.element(find.byType(EditorWorkspace)); + final input = find.descendant( + of: find.byKey(const Key('agent-composer')), + matching: find.byType(TextField), + ); + await tester.enterText(input, 'Keep this desktop draft'); + final initialWidth = tester + .getSize(find.byKey(const Key('desktop-editor-card'))) + .width; + await tester.tap(find.byKey(const Key('project-sidebar-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('desktop-chat-card')), findsNothing); + expect( + tester.getSize(find.byKey(const Key('desktop-editor-card'))).width, + greaterThan(initialWidth), + ); + await tester.tap(find.byKey(const Key('project-sidebar-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); + expect( + tester.getSize(find.byKey(const Key('desktop-editor-card'))).width, + initialWidth, + ); + expect( + tester.widget(input).controller!.text, + 'Keep this desktop draft', + ); + tester.view.physicalSize = const Size(900, 800); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsNothing); + expect(find.byType(EditorWorkspace), findsOneWidget); + expect( + tester.widget(input).controller!.text, + 'Keep this desktop draft', + ); + tester.view.physicalSize = const Size(1800, 800); + await tester.pumpAndSettle(); + expect(tester.element(find.byType(EditorWorkspace)), same(editor)); + expect( + mounted.container + .read(editorTimelineProvider(mounted.projectId, 'project')) + .value, + same(mounted.session), + ); + expect(tester.takeException(), isNull); + await mounted.close(); + }); + + testWidgets( + 'desktop workspace retains layout and playback controls in all six themes', + (tester) async { + final mounted = await mount(tester, const Size(1440, 900)); + await setMode(tester, mounted.container, WorkspaceMode.cut); + await tester.tap(find.byKey(const Key('editor-properties-button'))); + await tester.pumpAndSettle(); + final editor = tester.element(find.byType(EditorWorkspace)); + for (final palette in AppPalette.values) { + for (final appearance in [ + AppAppearance.penLight, + AppAppearance.penDark, + ]) { + await mounted.container + .read(paletteSettingsProvider.notifier) + .setPalette(palette); + await mounted.container + .read(appearanceSettingsProvider.notifier) + .setMode(appearance); + await tester.pumpAndSettle(); + final preview = tester.getRect( + find.byKey(const Key('editor-preview-card')), + ); + final properties = tester.getRect( + find.byKey(const Key('editor-properties-region')), + ); + final playback = tester.getRect( + find.byKey(const Key('preview-toolbar')), + ); + expect(preview.top, properties.top); + expect(preview.bottom, properties.bottom); + expect(properties.left - preview.right, 6); + expect(playback.bottom, preview.bottom - 1); + expect(playback.height, 36); + expect( + tester.getSize(find.byKey(const Key('timeline-tabs-bar'))).height, + 32, + ); + final tabBackground = tester + .widget( + find.byKey(const Key('timeline-tabs-background')), + ) + .color; + expect( + tabBackground, + isNot( + Theme.of( + tester.element(find.byKey(const Key('timeline-toolbar'))), + ).colorScheme.surface, + ), + reason: 'Tabs and commands have distinct surfaces in every theme', + ); + expect( + tester.getSize(find.byKey(const Key('timeline-toolbar'))).height, + 36, + ); + expect(tester.element(find.byType(EditorWorkspace)), same(editor)); + expect(AppColors.of(Theme.of(editor)).family, palette); + expect(tester.takeException(), isNull); + } + } + await mounted.close(); + }, + ); + + testWidgets('header floats and docks Agent without losing its draft', ( + tester, + ) async { + tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark; + addTearDown(tester.platformDispatcher.clearPlatformBrightnessTestValue); + final mounted = await mount(tester, const Size(1800, 800)); + expect( + find.descendant( + of: find.byKey(const Key('desktop-window-header')), + matching: find.byKey(const Key('agent-minimize-button')), + ), + findsOneWidget, + ); + expect(find.byKey(const Key('agent-fullscreen-button')), findsNothing); + final editor = tester.element(find.byType(EditorWorkspace)); + final selection = mounted.container.read( + conversationSelectionProvider(mounted.projectId), + ); + final chatProvider = chatControllerProvider( + mounted.projectId, + conversationId: selection.selectedId, + draftKey: selection.selectedId == null ? selection.draftKey : null, + ); + final chatController = mounted.container.read(chatProvider.notifier); + final input = find.descendant( + of: find.byKey(const Key('agent-composer')), + matching: find.byType(TextField), + ); + await tester.enterText(input, 'Floating draft'); + final draftController = tester.widget(input).controller; + final initialWidth = tester + .getSize(find.byKey(const Key('desktop-editor-card'))) + .width; + await floatOrDockChat(tester); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsOneWidget); + expect(find.byKey(const Key('agent-floating-title')), findsNothing); + expect(find.byKey(const Key('agent-conversation')), findsNothing); + expect( + tester.getSize(find.byKey(const Key('agent-floating-window'))).height, + lessThan(70), + ); + expect( + tester.getSize(find.byKey(const Key('agent-floating-window'))).width, + 560, + ); + expect(find.byKey(const Key('desktop-agent-slot')), findsNothing); + expect( + tester.getSize(find.byKey(const Key('desktop-editor-card'))).width, + greaterThan(initialWidth), + ); + expect(tester.element(find.byType(EditorWorkspace)), same(editor)); + expect(find.byType(AgentChatPanel), findsNothing); + expect(find.byType(FloatingAgentPanel), findsOneWidget); + expect(mounted.container.read(chatProvider.notifier), same(chatController)); + final floatingInput = find.byKey(const Key('floating-agent-input')); + expect(tester.widget(floatingInput).minLines, 1); + expect(tester.getSize(floatingInput).height, lessThanOrEqualTo(28)); + expect( + tester.widget(floatingInput).controller, + same(draftController), + ); + final inputElement = tester.element(floatingInput); + final editable = find.descendant( + of: floatingInput, + matching: find.byType(EditableText), + ); + final editableElement = tester.element(editable); + final retainedMessages = find.byKey( + const Key('floating-agent-messages'), + skipOffstage: false, + ); + final retainedTitle = find.byKey( + const Key('agent-floating-title'), + skipOffstage: false, + ); + final messagesElement = tester.element(retainedMessages); + final titleElement = tester.element(retainedTitle); + final conversationRegion = find.byKey( + const Key('floating-agent-conversation-region'), + ); + expect(tester.getSize(conversationRegion).height, 0); + final inputRect = tester.getRect(floatingInput); + final composer = find.byKey(const Key('floating-agent-composer')); + final composerRect = tester.getRect(composer); + final collapsedHeight = tester + .getSize(find.byKey(const Key('agent-floating-window'))) + .height; + final floatingDialog = find.byKey(const Key('floating-agent-dialog')); + final dialogShape = tester.widget(floatingDialog).shape; + final maxInputLines = tester.widget(floatingInput).maxLines; + await tester.tap(floatingInput); + final focus = tester.widget(floatingInput).focusNode; + final editingValue = draftController!.value; + await tester.pump(); + await tester.pump(const Duration(milliseconds: 80)); + expect( + tester.getSize(find.byKey(const Key('agent-floating-window'))).height, + allOf(greaterThan(collapsedHeight), lessThan(640)), + ); + expect(tester.getRect(floatingInput), inputRect); + expect(tester.getRect(composer), composerRect); + expect(tester.element(retainedMessages), same(messagesElement)); + expect(tester.element(retainedTitle), same(titleElement)); + expect( + tester.getSize(conversationRegion).height, + allOf(greaterThan(0), lessThan(596)), + ); + expect(tester.element(floatingInput), same(inputElement)); + expect(tester.element(editable), same(editableElement)); + expect(draftController.value, editingValue); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('floating-agent-messages')), findsOneWidget); + expect(find.byKey(const Key('agent-floating-title')), findsOneWidget); + expect(tester.widget(floatingInput).focusNode!.hasFocus, isTrue); + expect(tester.widget(floatingInput).focusNode, same(focus)); + expect(tester.element(floatingInput), same(inputElement)); + expect(tester.element(editable), same(editableElement)); + expect(tester.element(retainedMessages), same(messagesElement)); + expect(tester.element(retainedTitle), same(titleElement)); + expect(tester.widget(floatingDialog).shape, dialogShape); + expect(tester.getRect(floatingInput), inputRect); + expect(tester.getRect(composer), composerRect); + expect(tester.widget(floatingInput).maxLines, maxInputLines); + final dividerFinder = find.byKey(const Key('floating-agent-input-divider')); + final divider = tester.widget(dividerFinder); + final floatingBackground = AppSurfaces.of(tester.element(floatingInput)) + .composerBackground; + final dividerContrast = + (divider.color!.computeLuminance() + .05) / + (floatingBackground.computeLuminance() + .05); + expect(divider.thickness, 1); + expect(dividerContrast, greaterThan(1.5)); + expect(tester.getSize(dividerFinder).width, 560); + expect( + tester.getRect(dividerFinder).bottom, + tester.getRect(conversationRegion).bottom, + ); + expect( + tester.getRect(find.byKey(const Key('floating-agent-messages'))).bottom, + lessThan(tester.getRect(floatingInput).top), + ); + expect( + tester.getSize(find.byKey(const Key('agent-floating-window'))).width, + 560, + ); + expect( + tester.getSize(find.byKey(const Key('agent-floating-window'))).height, + greaterThan(300), + ); + // An unfinished IME composition must survive collapsing the conversation. + final composingValue = draftController.value.copyWith( + selection: const TextSelection.collapsed(offset: 8), + composing: const TextRange(start: 0, end: 8), + ); + tester.testTextInput.updateEditingValue(composingValue); + await tester.pump(); + await tester.tap(find.byKey(const Key('floating-agent-collapse'))); + await tester.pump(); + await tester.pump(const Duration(milliseconds: 80)); + expect(tester.getRect(floatingInput), inputRect); + expect(tester.getRect(composer), composerRect); + await tester.pumpAndSettle(); + expect(tester.element(editable), same(editableElement)); + expect(tester.element(retainedMessages), same(messagesElement)); + expect(tester.element(retainedTitle), same(titleElement)); + expect(tester.getSize(conversationRegion).height, 0); + expect(draftController.value, composingValue); + expect(find.byKey(const Key('floating-agent-messages')), findsNothing); + expect(find.byKey(const Key('agent-floating-title')), findsNothing); + expect(find.byKey(const Key('agent-floating-window')), findsOneWidget); + expect( + tester.widget(floatingInput).controller!.text, + 'Floating draft', + ); + final resizeHandle = find.byKey(const Key('floating-agent-resize-handle')); + final dragOpen = await tester.startGesture(tester.getCenter(resizeHandle)); + await dragOpen.moveBy(const Offset(0, -240)); + await tester.pump(); + expect(tester.getSize(conversationRegion).height, closeTo(240, 1)); + expect(tester.getRect(composer), composerRect); + expect(tester.element(editable), same(editableElement)); + expect(tester.element(retainedMessages), same(messagesElement)); + expect(draftController.value, composingValue); + await dragOpen.moveBy(const Offset(0, 40)); + await tester.pump(); + expect(tester.getSize(conversationRegion).height, closeTo(200, 1)); + await dragOpen.moveBy(const Offset(0, -40)); + await dragOpen.up(); + await tester.pumpAndSettle(); + expect(tester.getSize(conversationRegion).height, 596); + final dragClosed = await tester.startGesture( + tester.getCenter(resizeHandle), + ); + await dragClosed.moveBy(const Offset(0, 500)); + await tester.pump(); + expect(tester.getSize(conversationRegion).height, closeTo(96, 1)); + expect(tester.getRect(composer), composerRect); + await dragClosed.up(); + await tester.pumpAndSettle(); + expect(tester.getSize(conversationRegion).height, 0); + expect(tester.element(editable), same(editableElement)); + final cancelledDrag = await tester.startGesture( + tester.getCenter(resizeHandle), + ); + await cancelledDrag.moveBy(const Offset(0, -60)); + await tester.pump(); + await cancelledDrag.cancel(); + await tester.pumpAndSettle(); + expect(tester.getSize(conversationRegion).height, 0); + await floatOrDockChat(tester); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsNothing); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); + expect(find.byKey(const Key('agent-conversation')), findsOneWidget); + expect(find.byType(AgentChatPanel), findsOneWidget); + expect(mounted.container.read(chatProvider.notifier), same(chatController)); + await floatOrDockChat(tester); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsOneWidget); + expect(find.byType(EditorWorkspace), findsOneWidget); + await tester.tap(floatingInput); + await tester.pumpAndSettle(); + tester.view.physicalSize = const Size(600, 360); + await tester.pumpAndSettle(); + final floatingRect = tester.getRect( + find.byKey(const Key('agent-floating-window')), + ); + expect(floatingRect.left, greaterThanOrEqualTo(0)); + expect(floatingRect.top, greaterThanOrEqualTo(40)); + expect(floatingRect.right, lessThanOrEqualTo(600)); + expect(floatingRect.bottom, lessThanOrEqualTo(360)); + final boundedDrag = await tester.startGesture( + tester.getCenter(resizeHandle), + ); + await boundedDrag.moveBy(const Offset(0, -900)); + await tester.pump(); + expect( + tester.getRect(find.byKey(const Key('agent-floating-window'))).top, + greaterThanOrEqualTo(40), + ); + await boundedDrag.up(); + await tester.pumpAndSettle(); + expect( + tester.getRect(composer).bottom, + lessThanOrEqualTo(floatingRect.bottom), + ); + await tester.enterText( + floatingInput, + 'First line\nSecond line\nThird line', + ); + await tester.pumpAndSettle(); + expect( + tester.getRect(composer).bottom, + lessThanOrEqualTo(floatingRect.bottom), + ); + await tester.enterText(floatingInput, 'Floating draft'); + await tester.pumpAndSettle(); + expect( + tester.widget(floatingInput).controller, + same(draftController), + ); + expect(tester.takeException(), isNull); + tester.view.physicalSize = const Size(1800, 800); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('floating-agent-dock'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('agent-floating-window')), findsNothing); + expect(tester.widget(input).controller!.text, 'Floating draft'); + expect(tester.takeException(), isNull); + await mounted.close(); + }); + testWidgets('Windows caption space follows real workspace pane changes', ( tester, ) async { @@ -208,12 +839,16 @@ void main() { contentRect.top, tester.getRect(find.byKey(const Key('desktop-window-header'))).bottom, ); + expect(contentRect.left, 6); + expect(contentRect.right, 1194); + expect(contentRect.bottom, 794); expect( - contentRect.left, - tester.getRect(find.byKey(const Key('desktop-navigation-rail'))).right, + tester.getRect(find.byKey(const Key('window-minimize'))).left - + tester + .getRect(find.byKey(const Key('background-tasks-button'))) + .right, + 12, ); - expect(contentRect.right, 1199); - expect(contentRect.bottom, 799); for (final mode in [WorkspaceMode.agent, WorkspaceMode.cut]) { await setMode(tester, mounted.container, mode); for (final width in [1200.0, 700.0, 400.0, 1200.0]) { @@ -227,7 +862,11 @@ void main() { for (final key in [ 'editor-media-button', 'editor-properties-button', - 'project-settings-button', + 'project-tabs-projects', + 'project-tabs-list', + 'project-sidebar-toggle', + 'agent-minimize-button', + 'background-tasks-button', 'expand-editor-button', ]) { final finder = find.byKey(Key(key)); @@ -273,7 +912,7 @@ void main() { ); await tester.enterText(input, 'Keep my draft'); await tester.drag( - find.byKey(const Key('agent-panel-resize')), + find.byKey(const Key('project-sidebar-resize')), const Offset(40, 0), ); await tester.pumpAndSettle(); @@ -321,10 +960,12 @@ void main() { expect(rect.right, lessThanOrEqualTo(size.width)); expect(rect.bottom, lessThanOrEqualTo(size.height)); await setMode(tester, mounted.container, WorkspaceMode.agent); - expect( - tester.widget(input).controller!.text, - 'Keep my draft', - ); + if (input.evaluate().isNotEmpty) { + expect( + tester.widget(input).controller!.text, + 'Keep my draft', + ); + } expect(tester.takeException(), isNull); } expect(tester.getSize(find.byType(AgentChatPanel)).width, agentWidth); @@ -341,45 +982,266 @@ void main() { }, ); - testWidgets('desktop resources retain state across navigation switches', ( + testWidgets( + 'desktop preview header centers the active name between media and properties', + (tester) async { + final target = PreviewTarget(); + addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue); + final mounted = await mount( + tester, + const Size(1800, 800), + previewTarget: target, + ); + final header = find.byKey(const Key('editor-content-header')); + final title = find.byKey(const Key('editor-preview-title')); + final mediaButton = find.byKey(const Key('editor-media-button')); + final propertiesButton = find.byKey( + const Key('editor-properties-button'), + ); + final preview = tester.element(find.byType(EditorPreviewPanel)); + expect(tester.widget(title).data, mounted.session.document.name); + await target.openSource( + AssetDocument( + id: 'long-source', + name: '这是一段名称很长的旅行素材文件用于检查预览头部不会挤压两侧按钮.mov', + storage: AssetStorage.external, + location: 'file:///test/travel.mov', + ), + ); + await tester.pumpAndSettle(); + expect(tester.widget(title).data, target.asset!.name); + expect(tester.element(find.byType(EditorPreviewPanel)), same(preview)); + for (final width in [1800.0, 1000.0, 700.0, 200.0]) { + tester.view.physicalSize = Size(width, 800); + tester.platformDispatcher.textScaleFactorTestValue = 1.5; + await tester.pumpAndSettle(); + final headerRect = tester.getRect(header); + final left = tester.getRect(mediaButton); + final right = tester.getRect(propertiesButton); + final middle = tester.getRect(title); + expect(left.left - headerRect.left, AppSidebarMetrics.outerPadding); + expect(headerRect.right - right.right, AppSidebarMetrics.outerPadding); + expect(middle.center.dx, closeTo(headerRect.center.dx, 0.01)); + expect(middle.left, greaterThanOrEqualTo(left.right)); + expect(middle.right, lessThanOrEqualTo(right.left)); + expect(left.center.dy, right.center.dy); + expect(tester.widget(title).overflow, TextOverflow.ellipsis); + expect(tester.takeException(), isNull); + } + tester.platformDispatcher.clearTextScaleFactorTestValue(); + tester.view.physicalSize = const Size(1800, 800); + target.showTimeline(); + await tester.pumpAndSettle(); + expect(tester.widget(title).data, mounted.session.document.name); + await tester.tap(mediaButton); + await tester.pumpAndSettle(); + expect(find.byType(MediaPanel), findsNothing); + await tester.tap(mediaButton); + await tester.pumpAndSettle(); + expect(find.byType(MediaPanel), findsOneWidget); + await tester.tap(propertiesButton); + await tester.pumpAndSettle(); + expect(find.byType(EditorPropertiesPanel), findsOneWidget); + expect(tester.takeException(), isNull); + await mounted.close(); + }, + ); + + testWidgets('timeline interaction clears media selection', (tester) async { + final target = PreviewTarget(); + final mounted = await mount( + tester, + const Size(1800, 800), + previewTarget: target, + ); + await setMode(tester, mounted.container, WorkspaceMode.cut); + final browser = mounted.container.read( + mediaBrowserProvider(mounted.projectId), + ); + final otherBrowser = mounted.container.read( + mediaBrowserProvider('other-project'), + ); + otherBrowser.selectedAssetId = 'other-media'; + final view = mounted.session.view(mounted.session.activeSequenceId!); + final clip = view.version.kernelVersion.query().elementById( + ElementId('clip'), + )!; + final surface = tester.getRect( + find.byKey(const Key('editor-timeline-surface')), + ); + final frame = view.project( + TimelineViewportRect(width: surface.width, height: surface.height), + ); + final index = List.generate(frame.length, (i) => i).firstWhere( + (i) => switch (frame.identityAt(i)) { + ElementHandle h => h == clip, + LayoutBodyId body => body.owner == clip, + _ => false, + }, + ); + final clipPoint = + surface.topLeft + + Offset(frame.screenLeftAt(index) + 20, frame.screenTopAt(index) + 20); + + bool mediaHighlighted() => tester + .widget( + find + .ancestor( + of: find.descendant( + of: find.byType(MediaPanel), + matching: find.text('Photo'), + ), + matching: find.byWidgetPredicate( + (widget) => + widget is Semantics && widget.properties.selected != null, + ), + ) + .first, + ) + .properties + .selected!; + + Future selectMedia() async { + await tester.tap( + find.descendant( + of: find.byType(MediaPanel), + matching: find.text('Photo'), + ), + ); + await tester.pumpAndSettle(); + expect(browser.selectedAssetId, 'media'); + expect(target.asset?.id, 'media'); + expect(mediaHighlighted(), isTrue); + } + + await selectMedia(); + await tester.tapAt(clipPoint); + await tester.pumpAndSettle(); + expect(view.selectedIdentities, isNotEmpty); + expect(browser.selectedAssetId, isNull); + expect(mediaHighlighted(), isFalse); + expect(target.asset, isNull); + expect(otherBrowser.selectedAssetId, 'other-media'); + + // Re-selecting the same clip still transfers focus from the media browser. + await selectMedia(); + view.seekTo(TimelineClock.ticksPerSecond); + await tester.pumpAndSettle(); + expect(browser.selectedAssetId, 'media'); + await tester.tapAt(clipPoint); + await tester.pumpAndSettle(); + expect(browser.selectedAssetId, isNull); + expect(target.asset, isNull); + + // Selection commands also activate the timeline without a pointer event. + view.clearSelection(); + await tester.pumpAndSettle(); + await selectMedia(); + view.setSelection([clip]); + await tester.pumpAndSettle(); + expect(browser.selectedAssetId, isNull); + expect(target.asset, isNull); + expect(tester.takeException(), isNull); + await mounted.close(); + }); + + testWidgets('desktop media retains browsing state while collapsed', ( tester, ) async { final mounted = await mount(tester, const Size(1800, 800)); - await setMode(tester, mounted.container, WorkspaceMode.cut); - expect(find.byKey(const Key('editor-media-button')), findsNothing); - await tester.tap(find.byKey(const Key('desktop-rail-library'))); - await tester.pumpAndSettle(); final mediaElement = tester.element(find.byType(MediaPanel)); - expect( - tester - .getRect(find.byKey(const Key('desktop-project-card'))) - .contains(tester.getRect(find.byType(MediaPanel)).center), - isTrue, - ); final browser = mounted.container.read( mediaBrowserProvider(mounted.projectId), ); browser.filter = MediaFilter.image; + browser.query = 'photo'; + browser.sort = MediaSort.nameAscending; + browser.grid = false; browser.selectedAssetId = 'media'; - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); - await tester.pumpAndSettle(); - expect(find.byType(MediaPanel), findsNothing); - await tester.tap(find.byKey(const Key('desktop-rail-library'))); - await tester.pumpAndSettle(); - expect(tester.element(find.byType(MediaPanel)), same(mediaElement)); - expect(browser.filter, MediaFilter.image); - expect(browser.selectedAssetId, 'media'); - expect(find.byKey(const Key('sidebar-tab-resources')), findsNothing); - expect(find.byType(EditorWorkspace), findsOneWidget); - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); + browser.resourceSection = ResourceSection.effects; await tester.pumpAndSettle(); + final editor = tester.element(find.byType(EditorWorkspace)); + for (var i = 0; i < 2; i++) { + await tester.tap(find.byKey(const Key('editor-media-button'))); + await tester.pumpAndSettle(); + expect(find.byType(MediaPanel), findsNothing); + expect(tester.element(find.byType(EditorWorkspace)), same(editor)); + await tester.tap(find.byKey(const Key('editor-media-button'))); + await tester.pumpAndSettle(); + expect(tester.element(find.byType(MediaPanel)), same(mediaElement)); + expect(browser.filter, MediaFilter.image); + expect(browser.selectedAssetId, 'media'); + expect(browser.query, 'photo'); + expect(browser.sort, MediaSort.nameAscending); + expect(browser.grid, isFalse); + expect(browser.resourceSection, ResourceSection.effects); + expect(find.byKey(const Key('media-search')), findsNothing); + } await tester.tap(find.byKey(const Key('editor-properties-button'))); await tester.pumpAndSettle(); expect(find.byType(EditorPropertiesPanel), findsOneWidget); - expect(find.byKey(const Key('editor-media-region')), findsNothing); + expect(find.byKey(const Key('editor-media-region')), findsOneWidget); expect(tester.takeException(), isNull); await mounted.close(); }); + testWidgets('desktop resource tabs retain imported media state', ( + tester, + ) async { + final mounted = await mount(tester, const Size(1800, 800)); + final browser = mounted.container.read( + mediaBrowserProvider(mounted.projectId), + ); + browser.query = 'photo'; + browser.filter = MediaFilter.image; + browser.grid = false; + await tester.pumpAndSettle(); + final mediaBody = tester.element(find.byType(MediaBrowserBody)); + final audioTab = find.byKey(const ValueKey('resource-tab-audio')); + await tester.ensureVisible(audioTab); + await tester.tap(audioTab); + await tester.pumpAndSettle(); + expect(browser.resourceSection, ResourceSection.audio); + expect(find.byType(ResourceLibraryEmpty), findsOneWidget); + expect(find.byKey(const Key('media-search')), findsNothing); + expect(find.byKey(const Key('media-import-button')), findsNothing); + final l10n = AppLocalizations.of( + tester.element(find.byType(ResourceLibraryEmpty)), + )!; + expect(find.text(l10n.resourceImportedAudioHint), findsOneWidget); + await tester.ensureVisible( + find.byKey(const ValueKey('resource-tab-imported')), + ); + await tester.tap(find.byKey(const ValueKey('resource-tab-imported'))); + await tester.pumpAndSettle(); + expect(tester.element(find.byType(MediaBrowserBody)), same(mediaBody)); + expect(browser.query, 'photo'); + expect(browser.filter, MediaFilter.image); + expect(browser.grid, isFalse); + expect(find.byKey(const Key('media-search')), findsOneWidget); + expect(find.byKey(const Key('media-import-button')), findsOneWidget); + expect(tester.takeException(), isNull); + await mounted.close(); + }); + + testWidgets( + 'medium desktop keeps media docked while properties open in an overlay', + (tester) async { + final mounted = await mount(tester, const Size(1000, 800)); + expect(find.byKey(const Key('editor-media-card')), findsOneWidget); + await tester.tap(find.byKey(const Key('editor-properties-button'))); + await tester.pumpAndSettle(); + expect(find.byType(EditorPropertiesPanel), findsOneWidget); + expect(find.byKey(const Key('editor-tool-surface')), findsOneWidget); + expect(find.byType(MediaPanel), findsOneWidget); + await tester.tap(find.byKey(const Key('editor-tool-close'))); + await tester.pumpAndSettle(); + expect(find.byType(EditorPropertiesPanel), findsNothing); + expect(find.byKey(const Key('editor-media-card')), findsOneWidget); + expect(tester.takeException(), isNull); + await mounted.close(); + }, + ); + testWidgets( 'phone tools use independent pages without changing desktop preferences', (tester) async { @@ -481,16 +1343,10 @@ void main() { experience: experience, ); await setMode(tester, mounted.container, WorkspaceMode.cut); - await tester.tap( - find.byKey( - Key( - experience == DeviceExperience.desktop - ? 'desktop-rail-library' - : 'editor-media-button', - ), - ), - ); - await tester.pumpAndSettle(); + if (experience != DeviceExperience.desktop) { + await tester.tap(find.byKey(const Key('editor-media-button'))); + await tester.pumpAndSettle(); + } final browser = mounted.container.read( mediaBrowserProvider(mounted.projectId), ); @@ -503,12 +1359,9 @@ void main() { ]) { tester.view.physicalSize = size; await tester.pumpAndSettle(); - if (experience == DeviceExperience.desktop) { - if (size.width < 700) { - await tester.tap(find.byKey(const Key('project-sidebar-toggle'))); - await tester.pumpAndSettle(); - } - await tester.tap(find.byKey(const Key('desktop-rail-library'))); + if (experience == DeviceExperience.desktop && + find.byType(MediaPanel).evaluate().isEmpty) { + await tester.tap(find.byKey(const Key('editor-media-button'))); await tester.pumpAndSettle(); } expect( @@ -843,7 +1696,7 @@ void main() { .composer(mounted.projectId, selection.draftKey); final add = find.descendant( of: find.byKey(const Key('agent-composer')), - matching: find.byIcon(Icons.add), + matching: find.byIcon(AppIcons.add), ); await tester.tap(add); await tester.pump(); @@ -919,7 +1772,7 @@ void main() { await tester.tap( find.descendant( of: find.byKey(const Key('agent-composer')), - matching: find.byIcon(Icons.add), + matching: find.byIcon(AppIcons.add), ), ); await tester.pump(); @@ -1001,7 +1854,7 @@ void main() { await tester.tap( find.descendant( of: find.byKey(const Key('agent-composer')), - matching: find.byIcon(Icons.add), + matching: find.byIcon(AppIcons.add), ), ); } @@ -1060,21 +1913,21 @@ void main() { (tester) async { final mounted = await mount(tester, const Size(200, 800)); expect(find.byKey(const Key('desktop-workspace-shell')), findsOneWidget); - expect(find.byKey(const Key('agent-panel-resize')), findsNothing); + expect(find.byKey(const Key('project-sidebar-resize')), findsNothing); expect(tester.takeException(), isNull); tester.view.physicalSize = const Size(308, 800); await tester.pumpAndSettle(); - expect(find.byKey(const Key('agent-panel-resize')), findsNothing); + expect(find.byKey(const Key('project-sidebar-resize')), findsNothing); expect(tester.takeException(), isNull); tester.view.physicalSize = const Size(200, 800); await tester.pumpAndSettle(); - expect(find.byKey(const Key('agent-panel-resize')), findsNothing); + expect(find.byKey(const Key('project-sidebar-resize')), findsNothing); expect(tester.takeException(), isNull); tester.view.physicalSize = const Size(1200, 800); await tester.pumpAndSettle(); - expect(find.byKey(const Key('agent-panel-resize')), findsOneWidget); + expect(find.byKey(const Key('project-sidebar-resize')), findsOneWidget); await tester.drag( - find.byKey(const Key('agent-panel-resize')), + find.byKey(const Key('project-sidebar-resize')), const Offset(-20, 0), ); await tester.pumpAndSettle(); @@ -1090,6 +1943,7 @@ class _FixtureProjects extends Projects { final MediaImportResult? importResult; final String projectId; final EditorTimelineSession session; + final _knownProjects = {}; @override Future build() async { final project = RecentProject( @@ -1097,6 +1951,7 @@ class _FixtureProjects extends Projects { name: 'Adaptive test', path: '/test/Adaptive.cutdex', ); + _knownProjects[project.path] = project; return ProjectState( activeProject: project, recent: [project], @@ -1117,6 +1972,67 @@ class _FixtureProjects extends Projects { ); } + @visibleForTesting + bool closeSucceeds = true; + void forgetRecent(String id) => state = AsyncData( + state.requireValue.copyWith( + recent: state.requireValue.recent + .where((project) => project.id != id) + .toList(), + ), + ); + void addRecent() { + const other = RecentProject( + id: 'other', + name: 'Other project', + path: '/test/Other.cutdex', + ); + _knownProjects[other.path] = other; + state = AsyncData( + state.requireValue.copyWith( + recent: [...state.requireValue.recent, other], + ), + ); + } + + @override + Future open( + String path, { + String? name, + String? expectedId, + String? timelineId, + String? initialTimelineName, + bool Function()? isCurrent, + }) async { + final next = _knownProjects[path]; + if (next == null || isCurrent?.call() == false) return false; + state = AsyncData( + state.requireValue.copyWith( + activeProject: next, + recent: + state.requireValue.recent.any((project) => project.id == next.id) + ? state.requireValue.recent + : [next, ...state.requireValue.recent], + timeline: session.document, + ), + ); + return true; + } + + @override + Future closeActiveProject() async { + if (!closeSucceeds) return false; + state = AsyncData( + state.requireValue.copyWith( + activeProject: null, + timeline: null, + timelines: const [], + assets: const [], + ), + ); + return true; + } + @override Future importExternalMedia( String projectId, diff --git a/test/agent_attachment_composer_test.dart b/test/agent_attachment_composer_test.dart index f9bf28b..36ef442 100644 --- a/test/agent_attachment_composer_test.dart +++ b/test/agent_attachment_composer_test.dart @@ -10,6 +10,7 @@ import 'package:cutdex/features/assistant/composer_suggestion_surface.dart'; import 'package:cutdex/features/media/media_asset_drag.dart'; import 'package:cutdex/integrations/agent/agent_provider.dart'; import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex/shared/widgets/drop_to_add_overlay.dart'; import 'package:cutdex/workspace/project_state.dart'; @@ -327,7 +328,7 @@ void main() { final assetIcon = ((assetSpan.children!.first as WidgetSpan).child as Padding).child as Icon; - expect(assetIcon.icon, Icons.attach_file); + expect(assetIcon.icon, AppIcons.attachment); expect(assetIcon.color, referenceColor); expect((assetSpan.children![1] as TextSpan).style?.color, referenceColor); expect( @@ -373,7 +374,7 @@ void main() { final timelineIcon = ((timelineSpan.children!.first as WidgetSpan).child as Padding).child as Icon; - expect(timelineIcon.icon, Icons.view_timeline_outlined); + expect(timelineIcon.icon, AppIcons.timeline); expect(timelineIcon.color, referenceColor); final timelineLabel = timelineSpan.children![1] as TextSpan; expect(timelineLabel.text, '主时间线'); diff --git a/test/agent_composer_store_test.dart b/test/agent_composer_store_test.dart new file mode 100644 index 0000000..9fb785a --- /dev/null +++ b/test/agent_composer_store_test.dart @@ -0,0 +1,43 @@ +import 'package:cutdex/features/assistant/agent_composer_controller.dart'; +import 'package:cutdex/features/assistant/agent_composer_store.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + late AgentComposerStore store; + setUp(() { + store = AgentComposerStore( + createComposer: (_) => AgentComposerController( + canImport: () => false, + pickFiles: () async => [], + importMedia: (_) async => null, + ), + ); + }); + tearDown(() => store.dispose()); + + test('the initial unassigned draft follows only the first project', () { + final initial = store.input(null, null, projectScoped: true) + ..text = 'Create a travel film'; + expect(store.input('a', null, projectScoped: true), same(initial)); + expect(store.input('b', null, projectScoped: true).text, isEmpty); + expect( + store.input('a', null, projectScoped: true).text, + 'Create a travel film', + ); + expect(store.draft.text, isEmpty); + }); + + test('creating a conversation keeps follow-up input in its project', () { + final first = store.input('a', null, projectScoped: true) + ..text = 'Follow-up while the first reply streams'; + final second = store.input('b', null, projectScoped: true) + ..text = 'Another project draft'; + final attachments = store.composer('a', 'draft-a'); + store.promoteDraft('a', 'draft-a', 'chat-a'); + expect(store.input('a', 'chat-a'), same(first)); + expect(store.composer('a', 'chat-a'), same(attachments)); + expect(store.input('a', null, projectScoped: true).text, isEmpty); + expect(store.input('b', null, projectScoped: true), same(second)); + expect(second.text, 'Another project draft'); + }); +} diff --git a/test/agent_model_picker_test.dart b/test/agent_model_picker_test.dart index 4214b59..18cac7f 100644 --- a/test/agent_model_picker_test.dart +++ b/test/agent_model_picker_test.dart @@ -16,6 +16,7 @@ import 'package:cutdex/integrations/editor_tools.dart'; import 'package:cutdex/l10n/app_localizations.dart'; import 'package:cutdex/persistence/app_settings_repositories.dart'; import 'package:cutdex_agent/cutdex_agent.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -215,7 +216,7 @@ void main() { expect( tester .widget( - find.widgetWithIcon(IconButton, Icons.arrow_upward), + find.widgetWithIcon(IconButton, AppIcons.arrowUp), ) .onPressed, isNull, @@ -255,7 +256,7 @@ void main() { expect( tester .widget( - find.widgetWithIcon(IconButton, Icons.arrow_upward), + find.widgetWithIcon(IconButton, AppIcons.arrowUp), ) .onPressed, isNull, diff --git a/test/app_database_test.dart b/test/app_database_test.dart index 043d29a..606e042 100644 --- a/test/app_database_test.dart +++ b/test/app_database_test.dart @@ -91,7 +91,7 @@ void main() { expect( (await database.customSelect('PRAGMA user_version').getSingle()) .read('user_version'), - 2, + 4, ); final appearance = DriftAppearanceSettingsRepository(database); diff --git a/test/assistant_presentation_isolation_test.dart b/test/assistant_presentation_isolation_test.dart new file mode 100644 index 0000000..acfc767 --- /dev/null +++ b/test/assistant_presentation_isolation_test.dart @@ -0,0 +1,141 @@ +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/assistant/agent_chat_panel.dart'; +import 'package:cutdex/features/assistant/agent_reply_region.dart'; +import 'package:cutdex/features/assistant/chat_controller.dart'; +import 'package:cutdex/features/assistant/chat_state.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +class _Chat extends ChatController { + @override + ChatState build( + String projectId, { + String? conversationId, + String? draftKey, + }) => const ChatState( + busy: true, + messages: [ChatMessage(text: 'Previous answer')], + ); + void stream(String text) => state = state.copyWith(partialResponse: text); +} + +class _Projects extends Projects { + @override + Future build() async => const ProjectState(); +} + +void main() { + testWidgets( + 'streaming updates reply without rebuilding history or composer', + (tester) async { + final chat = _Chat(); + final container = ProviderContainer( + overrides: [ + projectsProvider.overrideWith(_Projects.new), + chatControllerProvider('project').overrideWith(() => chat), + ], + ); + addTearDown(container.dispose); + var visible = true; + late StateSetter visibility; + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + theme: EditorTheme.penDark, + home: StatefulBuilder( + builder: (context, setState) { + visibility = setState; + return TickerMode( + enabled: visible, + child: const Scaffold( + body: AgentChatPanel( + projectId: 'project', + timelineId: 'timeline', + ), + ), + ); + }, + ), + ), + ), + ); + await tester.pumpAndSettle(); + final input = tester.element(find.byType(TextField)); + final history = tester.element(find.text('Previous answer')); + var panelBuilds = 0; + var historyBuilds = 0; + var replyBuilds = 0; + final previous = debugOnRebuildDirtyWidget; + debugOnRebuildDirtyWidget = (element, built) { + previous?.call(element, built); + if (element.widget is AgentChatPanel) panelBuilds++; + if (element.widget is AgentReplyRegion) replyBuilds++; + if (identical(element, history)) historyBuilds++; + }; + addTearDown(() => debugOnRebuildDirtyWidget = previous); + for (var chunk = 0; chunk < 120; chunk++) { + chat.stream('Reply $chunk'); + await tester.pump(); + } + expect(find.text('Reply 119'), findsOneWidget); + expect(panelBuilds, 0); + expect(historyBuilds, 0); + expect(replyBuilds, 120); + expect(tester.element(find.byType(TextField)), same(input)); + visibility(() => visible = false); + await tester.pumpAndSettle(); + replyBuilds = 0; + for (var chunk = 120; chunk < 240; chunk++) { + chat.stream('Reply $chunk'); + await tester.pump(); + } + expect(replyBuilds, 0); + visibility(() => visible = true); + await tester.pumpAndSettle(); + expect(find.text('Reply 239'), findsOneWidget); + expect(tester.element(find.byType(TextField)), same(input)); + expect(tester.takeException(), isNull); + String? copied; + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + SystemChannels.platform, + (call) async { + if (call.method == 'Clipboard.setData') { + copied = (call.arguments as Map)['text'] as String; + } + return null; + }, + ); + addTearDown( + () => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + SystemChannels.platform, + null, + ), + ); + final selection = tester + .state( + find.descendant( + of: find.byType(AgentReplyRegion), + matching: find.byType(SelectionArea), + ), + ) + .selectableRegion; + selection.selectAll(SelectionChangedCause.keyboard); + await tester.pump(); + selection.contextMenuButtonItems + .singleWhere((item) => item.type == ContextMenuButtonType.copy) + .onPressed!(); + await tester.pump(); + expect(copied, 'Reply 239'); + await tester.pumpWidget(const SizedBox()); + }, + ); +} diff --git a/test/caption_edit_context_test.dart b/test/caption_edit_context_test.dart new file mode 100644 index 0000000..24df7c6 --- /dev/null +++ b/test/caption_edit_context_test.dart @@ -0,0 +1,177 @@ +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/properties/caption_properties.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/timeline_session.dart'; +import 'package:cutdex_sdk/editor.dart'; +import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'support/preview_fixture.dart'; + +final _sequence = SequenceId('one'); + +void main() { + for (final desktop in [false, true]) { + for (final field in ['text', 'color', 'strokeColor']) { + testWidgets( + '$field draft cannot overwrite a newer caption edit desktop=$desktop', + (tester) async { + final (session, id, _) = await _fixture(tester); + final host = _host(session, id, desktop: desktop); + await tester.pumpWidget(host); + await tester.pumpAndSettle(); + final input = _input(id, field); + final element = tester.element(input); + await tester.enterText(input, _local(field)); + + await tester.runAsync(() async { + session.setCaption(_sequence, _edit(id, field, _external(field))); + await session.flush(); + }); + await tester.pump(); + expect(tester.element(input), same(element)); + expect( + tester.widget(input).controller!.text, + _external(field), + ); + await tester.testTextInput.receiveAction(TextInputAction.done); + await tester.pump(); + expect(_value(session, id, field), _external(field)); + + // A fresh draft in the new binding still commits normally. + await tester.enterText(input, _local(field)); + await tester.testTextInput.receiveAction(TextInputAction.done); + await tester.pump(); + expect(_value(session, id, field), _local(field)); + expect(tester.takeException(), isNull); + await tester.runAsync(session.flush); + await tester.pumpWidget(const SizedBox()); + }, + ); + } + } + + testWidgets('ordinary rebuilds retain a valid unsubmitted caption draft', ( + tester, + ) async { + final (session, id, _) = await _fixture(tester); + await tester.pumpWidget(_host(session, id)); + await tester.pumpAndSettle(); + final input = _input(id, 'text'); + await tester.enterText(input, 'Unsubmitted draft'); + await tester.pumpWidget(_host(session, id)); + await tester.pump(); + expect( + tester.widget(input).controller!.text, + 'Unsubmitted draft', + ); + await tester.testTextInput.receiveAction(TextInputAction.done); + await tester.pump(); + expect(session.caption(_sequence, id).text, 'Unsubmitted draft'); + await tester.runAsync(session.flush); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets('selection changes do not carry a draft into another caption', ( + tester, + ) async { + final (session, first, second) = await _fixture(tester); + await tester.pumpWidget(_host(session, first)); + await tester.pumpAndSettle(); + await tester.enterText(_input(first, 'text'), 'First cue draft'); + await tester.pumpWidget(_host(session, second)); + await tester.pumpAndSettle(); + expect( + tester.widget(_input(second, 'text')).controller!.text, + 'Second caption', + ); + expect(session.caption(_sequence, second).text, 'Second caption'); + expect(session.caption(_sequence, first).text, 'Original'); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); +} + +Future<(EditorTimelineSession, String, String)> _fixture( + WidgetTester tester, +) async { + final fixture = (await tester.runAsync( + () => createPreviewFixture(Uri.file('/fixture.mov')), + ))!; + addTearDown( + () => tester.runAsync(() async { + await fixture.workspace.close(); + await fixture.directory.delete(recursive: true); + }), + ); + final session = fixture.timeline; + final ids = (await tester.runAsync(() async { + final role = + session.createCaptionTrack( + _sequence, + const CreateCaptionTrack(name: 'Captions', language: 'en'), + )['roleId'] + as String; + final result = session.addCaptions( + _sequence, + AddCaptions( + roleId: role, + cues: [ + CaptionCueInput( + text: 'Original', + start: CommandTime(0, 1), + duration: CommandTime(1, 1), + ), + CaptionCueInput( + text: 'Second caption', + start: CommandTime(1, 1), + duration: CommandTime(1, 1), + ), + ], + ), + ); + await session.flush(); + return (result['captionIds'] as List).cast(); + }))!; + return (session, ids[0], ids[1]); +} + +Widget _host( + EditorTimelineSession session, + String id, { + bool desktop = false, +}) => MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + theme: desktop + ? EditorTheme.desktop(EditorTheme.penDark) + : EditorTheme.penDark, + home: Scaffold( + body: CaptionProperties(session: session, sequence: _sequence, clipId: id), + ), +); + +Finder _input(String id, String field) => find.descendant( + of: find.byKey(ValueKey(('caption-$field', id))), + matching: find.byType(TextField), +); + +String _local(String field) => field == 'text' ? 'Local draft' : '#123456'; +String _external(String field) => + field == 'text' ? 'New external edit' : '#ABCDEF'; + +SetCaption _edit(String id, String field, String value) => switch (field) { + 'text' => SetCaption(captionId: id, text: value), + 'color' => SetCaption(captionId: id, color: value), + _ => SetCaption(captionId: id, strokeColor: value), +}; + +String _value(EditorTimelineSession session, String id, String field) { + final caption = session.caption(_sequence, id); + return switch (field) { + 'text' => caption.text, + 'color' => caption.color, + _ => caption.strokeColor, + }; +} diff --git a/test/chat_controller_test.dart b/test/chat_controller_test.dart index 6892803..0a2b48c 100644 --- a/test/chat_controller_test.dart +++ b/test/chat_controller_test.dart @@ -8,6 +8,7 @@ import 'package:cutdex/features/assistant/chat_controller.dart'; import 'package:cutdex/features/assistant/agent_conversation_service.dart'; import 'package:cutdex/features/assistant/agent_chat_panel.dart'; import 'package:cutdex/features/assistant/chat_state.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -313,7 +314,7 @@ void main() { await tester.pump(); expect(find.text('尚未发送的消息'), findsOneWidget); final send = tester.widget( - find.widgetWithIcon(IconButton, Icons.arrow_upward), + find.widgetWithIcon(IconButton, AppIcons.arrowUp), ); expect(send.onPressed, isNull); final conversation = find.byKey(const Key('agent-conversation')); @@ -374,7 +375,7 @@ void main() { expect(composerInput.style?.fontSize, 13); expect(composerInput.decoration?.hintStyle?.fontSize, 13); final sendButton = tester.widget( - find.widgetWithIcon(IconButton, Icons.arrow_upward), + find.widgetWithIcon(IconButton, AppIcons.arrowUp), ); expect( sendButton.style?.shape?.resolve({}), @@ -557,7 +558,7 @@ void main() { expect( tester .widget( - find.widgetWithIcon(IconButton, Icons.arrow_upward), + find.widgetWithIcon(IconButton, AppIcons.arrowUp), ) .onPressed, isNull, diff --git a/test/chat_header_test.dart b/test/chat_header_test.dart new file mode 100644 index 0000000..d182aba --- /dev/null +++ b/test/chat_header_test.dart @@ -0,0 +1,289 @@ +import 'package:cutdex/features/projects/chat_header.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + const entries = [ + (id: 'rough', title: '旅行短片粗剪'), + (id: 'opening', title: '调整片头节奏与镜头衔接,让画面更自然'), + (id: 'captions', title: '字幕与配乐'), + ]; + + Widget host(Widget child, {double width = 240, ThemeData? theme}) => + MaterialApp( + theme: theme ?? AppTheme.desktopWorkspaceTheme(AppTheme.penDark), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox(width: width, child: child), + ), + ), + ); + + testWidgets('title, new and more controls fit palettes and narrow widths', ( + tester, + ) async { + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + for (final width in [120.0, 240.0, 400.0]) { + await tester.pumpWidget( + host( + ChatHeader( + title: entries[1].title, + onNew: () {}, + actions: [AppMenuItem(label: '重命名', onPressed: () {})], + historyBuilder: (_, close) => + ChatHistoryMenu(entries: entries, onSelect: (_) => close()), + ), + width: width, + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(palette, brightness), + ), + ), + ); + await tester.pumpAndSettle(); + final header = tester.getRect( + find.byKey(const Key('project-chat-header')), + ); + final history = tester.getRect( + find.byKey(const Key('project-chat-history')), + ); + final create = tester.getRect( + find.byKey(const Key('project-chat-new')), + ); + final more = tester.getRect( + find.byKey(const Key('project-chat-more')), + ); + expect(header.height, 36); + expect(create.size, const Size.square(26)); + expect(more.size, const Size.square(26)); + expect(create.center.dy, header.center.dy); + expect(more.center.dy, header.center.dy); + expect(history.left - header.left, 10); + expect(header.right - more.right, 10); + expect(create.left - history.right, 4); + expect(more.left - create.right, 4); + final title = tester.widget( + find.byKey(const Key('project-chat-title')), + ); + expect(title.maxLines, 1); + expect(title.overflow, TextOverflow.ellipsis); + expect( + tester.takeException(), + isNull, + reason: '$palette $brightness $width', + ); + } + } + } + }); + + testWidgets('history search, selection, new chat and actions work', ( + tester, + ) async { + String? selected = 'rough'; + var actionCount = 0; + await tester.pumpWidget( + host( + StatefulBuilder( + builder: (context, setState) => ChatHeader( + title: + entries + .where((entry) => entry.id == selected) + .firstOrNull + ?.title ?? + '新聊天', + onNew: () => setState(() => selected = null), + actions: selected == null + ? const [] + : [AppMenuItem(label: '重命名', onPressed: () => actionCount++)], + historyBuilder: (_, close) => ChatHistoryMenu( + entries: entries, + selectedId: selected, + onSelect: (id) { + close(); + setState(() => selected = id); + }, + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('project-chat-history'))); + await tester.pumpAndSettle(); + expect( + find.text(lookupAppLocalizations(const Locale('zh')).agentConversations), + findsOneWidget, + ); + await tester.enterText(find.byKey(const Key('project-chat-search')), '字幕'); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('chat-history-rough')), findsNothing); + await tester.tap(find.byKey(const ValueKey('chat-history-captions'))); + await tester.pumpAndSettle(); + expect(selected, 'captions'); + expect(find.byKey(const Key('project-chat-history-menu')), findsNothing); + expect(find.text('字幕与配乐'), findsOneWidget); + + await tester.tap(find.byKey(const Key('project-chat-more'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('重命名')); + await tester.pumpAndSettle(); + expect(actionCount, 1); + await tester.tap(find.byKey(const Key('project-chat-new'))); + await tester.pumpAndSettle(); + expect(selected, isNull); + expect(find.text('新聊天'), findsOneWidget); + expect( + tester + .widget(find.byKey(const Key('project-chat-more'))) + .onPressed, + isNull, + ); + + await tester.tap(find.byKey(const Key('project-chat-history'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('chat-history-rough')), findsOneWidget); + await tester.enterText( + find.byKey(const Key('project-chat-search')), + 'missing', + ); + await tester.pumpAndSettle(); + expect( + find.text(lookupAppLocalizations(const Locale('zh')).noMatchingOptions), + findsOneWidget, + ); + await tester.sendKeyEvent(LogicalKeyboardKey.escape); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('project-chat-history-menu')), findsNothing); + expect(tester.takeException(), isNull); + }); + + testWidgets( + 'empty history hides search and retains trash without stale filters', + (tester) async { + var history = []; + var showTrash = false; + late StateSetter updateHistory; + await tester.pumpWidget( + host( + StatefulBuilder( + builder: (_, setState) { + updateHistory = setState; + return ChatHeader( + title: '新聊天', + onNew: () {}, + actions: const [], + historyBuilder: (_, _) => ChatHistoryMenu( + entries: history, + onSelect: (_) {}, + footer: showTrash ? const Text('Trash item') : null, + ), + ); + }, + ), + ), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('project-chat-history'))); + await tester.pumpAndSettle(); + final l10n = lookupAppLocalizations(const Locale('zh')); + expect(find.byKey(const Key('project-chat-search')), findsNothing); + expect(find.text(l10n.agentNoConversations), findsOneWidget); + expect(find.text('Trash item'), findsNothing); + expect( + tester.getSize(find.byType(ChatHistoryMenu)).height, + lessThan(200), + ); + updateHistory(() => showTrash = true); + await tester.pumpAndSettle(); + expect(find.text('Trash item'), findsOneWidget); + expect(find.byKey(const Key('project-chat-search')), findsNothing); + + updateHistory(() => history = entries.toList()); + await tester.pumpAndSettle(); + final search = find.byKey(const Key('project-chat-search')); + expect(search, findsOneWidget); + await tester.enterText(search, 'unmatched'); + await tester.pumpAndSettle(); + expect(find.text(l10n.noMatchingOptions), findsOneWidget); + expect(search, findsOneWidget); + + updateHistory(() => history = []); + await tester.pumpAndSettle(); + expect(search, findsNothing); + expect(find.text(l10n.agentNoConversations), findsOneWidget); + updateHistory(() => history = entries.toList()); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('chat-history-rough')), findsOneWidget); + expect(tester.widget(search).controller?.text ?? '', isEmpty); + expect(tester.takeException(), isNull); + }, + ); + + testWidgets('panel commands stay available while a conversation is busy', ( + tester, + ) async { + var collapsed = false; + await tester.pumpWidget( + host( + ChatHeader( + title: 'Working', + busy: true, + onNew: () {}, + actions: [AppMenuItem(label: '重命名', onPressed: () {})], + panelActions: [ + AppMenuItem(label: '折叠对话', onPressed: () => collapsed = true), + ], + historyBuilder: (_, close) => + ChatHistoryMenu(entries: entries, onSelect: (_) => close()), + ), + ), + ); + await tester.pumpAndSettle(); + expect( + tester + .widget(find.byKey(const Key('project-chat-new'))) + .onPressed, + isNull, + ); + await tester.tap(find.byKey(const Key('project-chat-more'))); + await tester.pumpAndSettle(); + expect(find.text('重命名'), findsNothing); + await tester.tap(find.text('折叠对话')); + await tester.pumpAndSettle(); + expect(collapsed, isTrue); + expect(tester.takeException(), isNull); + }); + + testWidgets('busy header disables navigation', (tester) async { + await tester.pumpWidget( + host( + ChatHeader( + title: 'Chat', + busy: true, + onNew: () {}, + actions: [AppMenuItem(label: 'Rename', onPressed: () {})], + historyBuilder: (_, _) => const Text('History'), + ), + ), + ); + await tester.pumpAndSettle(); + expect( + tester + .widget(find.byKey(const Key('project-chat-history'))) + .onPressed, + isNull, + ); + for (final key in ['project-chat-new', 'project-chat-more']) { + expect(tester.widget(find.byKey(Key(key))).onPressed, isNull); + } + }); +} diff --git a/test/compact_inspector_test.dart b/test/compact_inspector_test.dart new file mode 100644 index 0000000..42b132b --- /dev/null +++ b/test/compact_inspector_test.dart @@ -0,0 +1,232 @@ +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/preview/preview_panel.dart'; +import 'package:cutdex/features/properties/picture_properties.dart'; +import 'package:cutdex/features/properties/audio_properties.dart'; +import 'package:cutdex/features/properties/speed_properties.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'support/preview_fixture.dart'; + +void main() { + testWidgets( + 'audio and speed controls fit desktop group headers at narrow widths', + (tester) async { + final f = (await tester.runAsync( + () => createPreviewFixture(Uri.file('/test/video.mov'), hasAudio: true), + ))!; + addTearDown( + () => tester.runAsync(() async { + await f.workspace.close(); + await f.directory.delete(recursive: true); + }), + ); + final query = f.timeline + .view(SequenceId('one')) + .version + .kernelVersion + .query(); + final clip = query.element(query.elementById(ElementId('clip'))!); + for (final width in [220.0, 280.0, 360.0]) { + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + theme: AppTheme.propertiesPanelTheme( + EditorTheme.desktop(EditorTheme.penDark), + ), + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + child: SingleChildScrollView( + child: Column( + children: [ + AudioProperties( + session: f.timeline, + sequence: SequenceId('one'), + clip: clip, + hasAudio: true, + ), + SpeedProperties( + session: f.timeline, + sequence: SequenceId('one'), + clip: clip.id, + ), + ], + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final field = find.descendant( + of: find.byKey(const Key('audio-db')), + matching: find.byType(TextField), + ); + expect(tester.getSize(field).height, 28); + expect( + tester.getRect(find.byKey(const Key('audio-key'))).bottom, + tester.getRect(field).top - 4, + ); + expect(find.byType(AppPropertyGroup), findsNWidgets(2)); + expect(tester.takeException(), isNull); + } + await tester.pumpWidget(const SizedBox()); + }, + ); + + testWidgets('desktop transform grid fits narrow panels in all six themes', ( + tester, + ) async { + final f = (await tester.runAsync( + () => + createPreviewFixture(Uri.file('/test/photo.png'), mediaType: 'image'), + ))!; + addTearDown( + () => tester.runAsync(() async { + await f.workspace.close(); + await f.directory.delete(recursive: true); + }), + ); + final project = f.workspace.project!.info.id; + final query = f.timeline + .view(SequenceId('one')) + .version + .kernelVersion + .query(); + final clip = query.element(query.elementById(ElementId('clip'))!); + final container = ProviderContainer( + overrides: [ + editorPreviewProvider(project, 'project').overrideWith((ref) => null), + ], + ); + addTearDown(container.dispose); + Finder input(String name) => find.descendant( + of: find.byKey(ValueKey('picture-$name')), + matching: find.byType(TextField), + ); + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + for (final (width, locale) in [ + (220.0, 'de'), + (280.0, 'zh'), + (360.0, 'en'), + ]) { + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: Locale(locale), + theme: AppTheme.propertiesPanelTheme( + EditorTheme.desktop( + EditorTheme.forPalette(palette, brightness), + ), + ), + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + child: SingleChildScrollView( + child: PictureProperties( + projectId: project, + timelineId: 'project', + session: f.timeline, + sequence: SequenceId('one'), + clip: clip, + ), + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + for (final name in ['x', 'y', 'scale-x', 'scale-y', 'rotation']) { + expect(tester.getSize(input(name)).height, 28); + } + expect(tester.getRect(input('x')).left, 12); + expect(tester.getRect(input('x')).width, (width - 28) / 2); + for (final name in ['x', 'y', 'scale-x', 'scale-y', 'rotation']) { + final field = tester.widget(input(name)); + expect(field.decoration!.prefixIcon, isNotNull); + } + expect( + find.descendant( + of: find.byKey(const ValueKey('picture-rotation')), + matching: find.byIcon(AppIcons.angle), + ), + findsOneWidget, + ); + final xLabel = find.descendant( + of: find.byKey(const ValueKey('picture-x')), + matching: find.text('X'), + ); + expect( + tester.getRect(xLabel).center.dy, + tester.getRect(input('x')).center.dy, + ); + final right = tester + .getRect(find.byKey(const ValueKey('picture-key-position'))) + .right; + for (final channel in ['position', 'scale', 'rotation']) { + final action = find.byKey(ValueKey('picture-key-$channel')); + expect(tester.getSize(action), const Size.square(24)); + expect(tester.getRect(action).right, right); + final field = input( + channel == 'position' + ? 'x' + : channel == 'scale' + ? 'scale-x' + : 'rotation', + ); + expect( + tester.getRect(action).bottom, + tester.getRect(field).top - 4, + ); + } + expect(right, width - 12); + expect( + tester.getRect(input('x')).left, + tester.getRect(input('rotation')).left, + ); + if (width >= 220) { + expect( + tester.getCenter(input('x')).dy, + tester.getCenter(input('y')).dy, + ); + expect( + tester.getCenter(input('scale-x')).dy, + tester.getCenter(input('scale-y')).dy, + ); + expect( + tester.getRect(input('rotation')).top - + tester.getRect(input('scale-x')).bottom, + 40, + ); + } + expect( + tester.takeException(), + isNull, + reason: '$palette $brightness $locale $width', + ); + } + } + } + await tester.pumpWidget(const SizedBox()); + }); +} diff --git a/test/desktop_content_controller_test.dart b/test/desktop_content_controller_test.dart new file mode 100644 index 0000000..1bfdb9f --- /dev/null +++ b/test/desktop_content_controller_test.dart @@ -0,0 +1,27 @@ +import 'package:cutdex/app/adaptive/desktop_content_controller.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + for (final surface in DesktopContent.values.where( + (surface) => surface != DesktopContent.settings, + )) { + test('settings returns to ${surface.name} after repeated navigation', () { + final container = ProviderContainer(); + addTearDown(container.dispose); + final navigation = container.read(desktopContentProvider.notifier); + navigation.select(surface); + final before = container.read(desktopContentProvider); + navigation.showSettings(tab: 3, workspace: ('project', 'timeline')); + navigation.showSettings(tab: 1); + navigation.closeSettings(); + final after = container.read(desktopContentProvider); + expect(after.surface, surface); + expect(after.resourcesSelected, before.resourcesSelected); + expect(after.librarySelected, before.librarySelected); + expect(after.settingsTab, 1); + expect(after.settingsVisited, isTrue); + expect(after.workspace, ('project', 'timeline')); + }); + } +} diff --git a/test/desktop_window_header_spacing_test.dart b/test/desktop_window_header_spacing_test.dart new file mode 100644 index 0000000..1770103 --- /dev/null +++ b/test/desktop_window_header_spacing_test.dart @@ -0,0 +1,125 @@ +import 'package:cutdex/app/shells/desktop_window_frame.dart'; +import 'package:cutdex/features/projects/project_tabs_bar.dart'; +import 'package:cutdex/integrations/platform/editor_window_chrome.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex_native/cutdex_native.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets( + 'header separates native buttons from project entry and uses equal margins', + (tester) async { + const width = 720.0; + const captionWidth = 132.0; + for (final platform in [TargetPlatform.macOS, TargetPlatform.windows]) { + for (final integrated in [false, true]) { + debugDefaultTargetPlatformOverride = platform; + final caption = integrated && platform == TargetPlatform.windows; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme(AppTheme.penDark), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + height: 120, + child: WindowHeaderLayout( + captionBounds: caption + ? const Rect.fromLTWH( + width - captionWidth, + 0, + captionWidth, + 44, + ) + : Rect.zero, + child: DesktopWindowFrame( + integratedTitlebar: integrated, + headerControls: const SizedBox.shrink(), + projectTabs: ProjectTabsBar( + projects: const [ + RecentProject(id: 'one', name: 'One', path: '/one'), + ], + recent: const [], + selectedId: 'one', + leadingActions: [ + IconButton( + key: const Key('header-sidebar-action'), + onPressed: () {}, + icon: const Icon(Icons.menu, size: 16), + ), + ], + trailingActions: [ + IconButton( + key: const Key('header-task-action'), + onPressed: () {}, + icon: const Icon(Icons.task_alt, size: 16), + ), + ], + onSelect: (_) {}, + onClose: (_) {}, + onCreate: () {}, + onOpen: () {}, + onRename: (_) {}, + ), + onHomePressed: () {}, + onSettingsPressed: () {}, + child: const SizedBox.shrink(), + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final entry = tester.getRect( + find.byKey(const Key('project-tabs-projects')), + ); + final sidebar = tester.getRect( + find.byKey(const Key('header-sidebar-action')), + ); + final list = tester.getRect( + find.byKey(const Key('project-tabs-list')), + ); + final task = tester.getRect( + find.byKey(const Key('header-task-action')), + ); + final start = integrated ? EditorWindowChrome.leadingWidth : 0.0; + final end = caption ? width - captionWidth : width; + final macButtons = integrated && platform == TargetPlatform.macOS; + expect( + sidebar.left - start, + 12, + reason: '$platform integrated=$integrated left', + ); + expect( + end - task.right, + 12, + reason: '$platform integrated=$integrated right', + ); + if (macButtons) { + expect(sidebar.left, 80); + // The last native button is centered at 59 with a 14px frame. + expect(sidebar.left - (59 + 14 / 2), 14); + } + expect(entry.center.dy, 22); + expect(sidebar.center.dy, 22); + expect(entry.left - sidebar.right, AppProjectTabMetrics.gap); + expect(list.center.dy, 22); + expect(task.center.dy, 22); + expect(task.left - list.right, AppProjectTabMetrics.gap); + expect(task.size, const Size.square(AppProjectTabMetrics.height)); + expect(tester.takeException(), isNull); + } + } + debugDefaultTargetPlatformOverride = null; + }, + ); +} diff --git a/test/desktop_workspace_cards_test.dart b/test/desktop_workspace_cards_test.dart index 31c1404..b07e7e1 100644 --- a/test/desktop_workspace_cards_test.dart +++ b/test/desktop_workspace_cards_test.dart @@ -1,4 +1,5 @@ import 'package:cutdex/app/adaptive/desktop_workspace_controller.dart'; +import 'package:cutdex/shared/layout/workspace_layout_metrics.dart'; import 'package:cutdex/app/shells/desktop_workspace_shell.dart'; import 'package:cutdex/workspace/workspace_mode.dart'; import 'package:cutdex/features/editor/layouts/expanded_editor_layout.dart'; @@ -6,66 +7,65 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { - testWidgets( - 'properties divider spans the preview card including its header', - (tester) async { - tester.view.physicalSize = const Size(1000, 800); - tester.view.devicePixelRatio = 1; - addTearDown(tester.view.resetPhysicalSize); - addTearDown(tester.view.resetDevicePixelRatio); - var showProperties = true; - late StateSetter update; - await tester.pumpWidget( - MaterialApp( - home: StatefulBuilder( - builder: (context, setState) { - update = setState; - return ExpandedEditorLayout( - preview: const SizedBox.expand(key: Key('test-preview')), - header: const SizedBox(height: 40, key: Key('test-header')), - properties: const SizedBox.expand(), - media: const SizedBox(), - showMedia: false, - showProperties: showProperties, - timelineHeight: 200, - onTimelineHeightChanged: (_) {}, - onTimelineHeightChangeEnd: () {}, - timeline: const SizedBox(), - ); - }, - ), + testWidgets('inspector has an independent frame aligned with the preview', ( + tester, + ) async { + tester.view.physicalSize = const Size(1000, 800); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + var showProperties = true; + late StateSetter update; + await tester.pumpWidget( + MaterialApp( + home: StatefulBuilder( + builder: (context, setState) { + update = setState; + return ExpandedEditorLayout( + preview: const SizedBox.expand(key: Key('test-preview')), + header: const SizedBox(height: 40, key: Key('test-header')), + properties: const SizedBox.expand(), + media: const SizedBox(), + showMedia: false, + showProperties: showProperties, + timelineHeight: 200, + onTimelineHeightChanged: (_) {}, + onTimelineHeightChangeEnd: () {}, + timeline: const SizedBox(), + ); + }, ), - ); - final card = tester.getRect(find.byKey(const Key('editor-preview-card'))); - final divider = tester.getRect( - find.byKey(const Key('editor-properties-divider')), - ); - final properties = tester.getRect( - find.byKey(const Key('editor-properties-region')), - ); - final header = tester.getRect(find.byKey(const Key('test-header'))); - expect(divider.top, card.top + 1); - expect(divider.bottom, card.bottom - 1); - expect(properties.top, divider.top); - expect(properties.bottom, divider.bottom); - expect(header.right, divider.left); - expect(properties.left, divider.right); - final preview = tester.element(find.byKey(const Key('test-preview'))); - update(() => showProperties = false); - await tester.pump(); - expect(find.byKey(const Key('editor-properties-divider')), findsNothing); - expect( - tester.getRect(find.byKey(const Key('test-header'))).right, - card.right - 1, - ); - expect( - tester.element(find.byKey(const Key('test-preview'))), - same(preview), - ); - expect(tester.takeException(), isNull); - }, - ); - testWidgets('preview and timeline cards resize through their 1 dp gap', ( + ), + ); + final card = tester.getRect(find.byKey(const Key('editor-preview-card'))); + final divider = tester.getRect( + find.byKey(const Key('editor-properties-divider')), + ); + final properties = tester.getRect( + find.byKey(const Key('editor-properties-region')), + ); + final header = tester.getRect(find.byKey(const Key('test-header'))); + expect(divider.top, card.top); + expect(divider.bottom, card.bottom); + expect(properties.top, divider.top); + expect(properties.bottom, divider.bottom); + expect(header.right, divider.left - 1); + expect(properties.left, divider.right); + final preview = tester.element(find.byKey(const Key('test-preview'))); + update(() => showProperties = false); + await tester.pump(); + expect(find.byKey(const Key('editor-properties-divider')), findsNothing); + expect( + tester.getRect(find.byKey(const Key('test-header'))).right, + tester.getRect(find.byKey(const Key('editor-preview-card'))).right - 1, + ); + expect( + tester.element(find.byKey(const Key('test-preview'))), + same(preview), + ); + expect(tester.takeException(), isNull); + }); + testWidgets('preview and timeline cards resize through their 6 dp gap', ( tester, ) async { tester.view.physicalSize = const Size(700, 800); @@ -101,9 +101,15 @@ void main() { Rect card(String name) => tester.getRect(find.byKey(Key('editor-$name-card'))); final timelineBefore = card('timeline'); - expect(timelineBefore.top - card('preview').bottom, 1); + expect( + timelineBefore.top - card('preview').bottom, + WorkspaceLayoutMetrics.desktopSpacing, + ); final resize = find.byKey(const Key('editor-timeline-resize')); - expect(tester.getSize(resize).height, 5); + expect( + tester.getSize(resize).height, + WorkspaceLayoutMetrics.desktopResizeHitExtent, + ); expect( find.descendant( of: find.byKey(const Key('editor-timeline-card')), @@ -117,7 +123,10 @@ void main() { ); await tester.pumpAndSettle(); expect(card('timeline').height, timelineBefore.height + 80); - expect(card('timeline').top - card('preview').bottom, 1); + expect( + card('timeline').top - card('preview').bottom, + WorkspaceLayoutMetrics.desktopSpacing, + ); expect(saves, 1); await tester.dragFrom( tester.getCenter(resize) + const Offset(0, 2), @@ -127,7 +136,7 @@ void main() { expect(card('timeline').height, timelineBefore.height + 60); expect(saves, 2); await tester.dragFrom( - tester.getCenter(resize) + const Offset(0, 3), + tester.getCenter(resize) + const Offset(0, 6), const Offset(0, -30), ); await tester.pumpAndSettle(); @@ -175,15 +184,24 @@ void main() { final project = card('project'); final editor = card('editor'); final agent = card('agent'); - expect(editor.left - project.right, 1); - expect(agent.left - editor.right, 1); + expect( + editor.left - project.right, + WorkspaceLayoutMetrics.desktopSpacing, + ); + expect(agent.left - editor.right, WorkspaceLayoutMetrics.desktopSpacing); expect(project.top, editor.top); expect(editor.bottom, agent.bottom); final projectResize = find.byKey(const Key('project-sidebar-resize')); final agentResize = find.byKey(const Key('agent-panel-resize')); - expect(tester.getSize(projectResize).width, 5); - expect(tester.getSize(agentResize).width, 5); + expect( + tester.getSize(projectResize).width, + WorkspaceLayoutMetrics.desktopResizeHitExtent, + ); + expect( + tester.getSize(agentResize).width, + WorkspaceLayoutMetrics.desktopResizeHitExtent, + ); await tester.dragFrom( tester.getCenter(projectResize) + const Offset(-2, 0), const Offset(60, 0), @@ -199,7 +217,10 @@ void main() { await tester.pumpAndSettle(); expect(card('agent').width, agent.width + 80); expect(card('project').width, project.width + 60); - expect(card('agent').left - card('editor').right, 1); + expect( + card('agent').left - card('editor').right, + WorkspaceLayoutMetrics.desktopSpacing, + ); await tester.dragFrom( tester.getCenter(projectResize) + const Offset(2, 0), const Offset(-20, 0), @@ -213,13 +234,17 @@ void main() { await tester.pumpAndSettle(); expect(card('agent').width, agent.width + 60); await tester.dragFrom( - tester.getCenter(projectResize) + const Offset(-3, 0), + tester.getCenter(projectResize) + const Offset(-6, 0), const Offset(30, 0), ); await tester.pumpAndSettle(); expect(card('project').width, project.width + 40); - expect(card('editor').left - card('project').right, 1); + expect( + card('editor').left - card('project').right, + WorkspaceLayoutMetrics.desktopSpacing, + ); + controller.setAgentVisible(true); update(() => mode = WorkspaceMode.cut); await tester.pumpAndSettle(); expect(find.byKey(const Key('desktop-agent-card')), findsOneWidget); diff --git a/test/editor_panel_defaults_test.dart b/test/editor_panel_defaults_test.dart index 0112c1f..f283c31 100644 --- a/test/editor_panel_defaults_test.dart +++ b/test/editor_panel_defaults_test.dart @@ -3,6 +3,7 @@ import 'package:cutdex/features/editor/editor_panel_defaults.dart'; import 'package:cutdex/features/preview/preview_panel.dart'; import 'package:cutdex/l10n/app_localizations.dart'; import 'package:cutdex_sdk/editor.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -42,7 +43,7 @@ void main() { expect(ratio.value, ProjectCanvas.widescreen); expect(ratio.onChanged, isNull); final play = tester.widget( - find.widgetWithIcon(IconButton, Icons.play_arrow), + find.widgetWithIcon(IconButton, AppIcons.play), ); expect(play.onPressed, isNull); expect(find.byType(CircularProgressIndicator), findsNothing); @@ -55,12 +56,18 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: EditorTheme.penLight, + theme: EditorTheme.desktop(EditorTheme.penLight), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, home: const Scaffold(body: EditorTimelineDefaults()), ), ); expect(find.byKey(const Key('timeline-default-tracks')), findsOneWidget); expect(find.byKey(const Key('timeline-toolbar')), findsOneWidget); + expect( + tester.getSize(find.byKey(const Key('timeline-add-button'))), + const Size.square(26), + ); for (final button in tester.widgetList( find.byType(IconButton), )) { diff --git a/test/editor_theme_test.dart b/test/editor_theme_test.dart index 836d1e3..6758975 100644 --- a/test/editor_theme_test.dart +++ b/test/editor_theme_test.dart @@ -7,6 +7,28 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { + test('desktop timecode ruler has room for labels and downward marks', () { + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + final mobile = EditorTheme.forPalette(palette, brightness); + final desktop = EditorTheme.desktop(mobile); + final ruler = desktop.extension()!; + expect(ruler.rulerHeight, 28); + expect(ruler.rulerTextStyle.fontSize, 12); + expect( + ruler.rulerTextStyle.fontFeatures, + contains(const FontFeature.tabularFigures()), + ); + expect(ruler.playheadColor, desktop.colorScheme.primary); + expect(mobile.extension()!.rulerHeight, 20); + expect( + mobile.extension()!.playheadColor, + mobile.colorScheme.onSurface, + ); + } + } + }); + test( 'Pen presets give timeline the same Codex surface and ink hierarchy', () { diff --git a/test/editor_window_chrome_test.dart b/test/editor_window_chrome_test.dart index 9664ee6..f722f28 100644 --- a/test/editor_window_chrome_test.dart +++ b/test/editor_window_chrome_test.dart @@ -4,6 +4,7 @@ import 'package:cutdex/l10n/app_localizations.dart'; import 'dart:async'; import 'package:cutdex/integrations/platform/editor_window_chrome.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -99,7 +100,7 @@ void main() { }); await tester.pump(); expect(find.byTooltip('还原'), findsOneWidget); - expect(find.byIcon(Icons.filter_none), findsOneWidget); + expect(find.byIcon(AppIcons.windowRestore), findsOneWidget); await tester.pumpWidget(const SizedBox()); await tester.pump(); expect(calls.last.arguments, {'enabled': false}); diff --git a/test/error_notification_host_test.dart b/test/error_notification_host_test.dart index 3f2efce..51a44fe 100644 --- a/test/error_notification_host_test.dart +++ b/test/error_notification_host_test.dart @@ -1,6 +1,7 @@ import 'package:cutdex/errors/app_failure.dart'; import 'package:cutdex/l10n/app_localizations.dart'; import 'package:cutdex/shared/widgets/error_notification_host.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -57,7 +58,7 @@ void main() { expect(copied, contains('code: resourceDownloadHttpFailed')); expect(copied, contains('HTTP: 503')); expect(copied, contains('service unavailable')); - expect(find.byIcon(Icons.check), findsOneWidget); + expect(find.byIcon(AppIcons.check), findsOneWidget); await tester.tap(find.byKey(const Key('close-error-button'))); await tester.pump(); expect(notice, findsNothing); @@ -101,4 +102,50 @@ void main() { expect(find.text('Dialog error'), findsNothing); expect(find.text('Dialog'), findsOneWidget); }); + + testWidgets('top message keeps undo available above dialogs', (tester) async { + final host = await mount(tester); + showDialog( + context: tester.element(find.text('Workspace')), + builder: (_) => const AlertDialog(content: Text('Dialog')), + ); + await tester.pumpAndSettle(); + var restored = false; + host.showMessage( + content: const Text('Project removed'), + actionLabel: 'Undo', + onAction: () => restored = true, + ); + await tester.pump(); + final notice = find.byKey(const Key('global-message-notification')); + expect(tester.getRect(notice).top, 48); + expect(find.byType(SnackBar), findsNothing); + expect(find.byKey(const Key('copy-error-button')), findsNothing); + await tester.tap(find.text('Undo')); + await tester.pump(); + expect(restored, isTrue); + expect(notice, findsNothing); + expect(find.text('Dialog'), findsOneWidget); + }); + + testWidgets('messages and errors share a queue and dismiss automatically', ( + tester, + ) async { + final host = await mount(tester); + host.showMessage(content: const Text('Task started')); + host.show(const ErrorNotification(content: Text('Task failed'))); + host.showMessage(content: const Text('Token copied')); + await tester.pump(); + expect(find.text('Task started'), findsOneWidget); + expect(find.text('Task failed'), findsNothing); + await tester.pump(const Duration(seconds: 4)); + expect(find.text('Task started'), findsNothing); + expect(find.text('Task failed'), findsOneWidget); + await tester.pump(const Duration(seconds: 8)); + expect(find.text('Task failed'), findsNothing); + expect(find.text('Token copied'), findsOneWidget); + await tester.tap(find.byKey(const Key('close-message-button'))); + await tester.pump(); + expect(find.text('Token copied'), findsNothing); + }); } diff --git a/test/features/projects/chat_header_integration_test.dart b/test/features/projects/chat_header_integration_test.dart new file mode 100644 index 0000000..6c7cf89 --- /dev/null +++ b/test/features/projects/chat_header_integration_test.dart @@ -0,0 +1,256 @@ +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/projects/conversation_sidebar.dart'; +import 'package:cutdex/features/projects/project_sidebar.dart'; +import 'package:cutdex/integrations/agent/conversation_repository.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/workspace_mode.dart'; +import 'package:cutdex_ui/icons.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../../support/empty_conversation_repository.dart'; + +void main() { + testWidgets( + 'desktop header follows selection, rename, trash and project scope', + (tester) async { + const projects = [ + RecentProject(id: 'a', name: 'Project A', path: '/a'), + RecentProject(id: 'b', name: 'Project B', path: '/b'), + ]; + final repository = _Conversations([ + _item('first', 'a', 'First chat'), + _item('second', 'a', 'Second chat'), + _item('other', 'b', 'Other project chat'), + ]); + final workspace = _Projects( + ProjectState(activeProject: projects.first, recent: projects), + ); + final container = ProviderContainer( + overrides: [ + projectsProvider.overrideWith(() => workspace), + conversationRepositoryProvider.overrideWith((_) => repository), + ], + ); + addTearDown(container.dispose); + await container.read(projectsProvider.future); + await container.read(conversationSidebarProvider.future); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: MaterialApp( + theme: EditorTheme.desktop(EditorTheme.penDark), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: SizedBox( + width: 240, + child: Consumer( + builder: (context, ref, _) { + final state = ref.watch(projectsProvider).requireValue; + return ProjectSidebar( + chatOnly: true, + agent: const Text('Conversation content'), + mode: WorkspaceMode.agent, + onModeChanged: (_) {}, + navigationWidth: 240, + navigationCollapsed: false, + agentHeaderLeading: const SizedBox(), + editorHidden: false, + onExpandEditor: null, + state: state, + selectedProjectId: state.activeProject?.id, + integratedTitlebar: false, + onCreateProject: null, + onSelectProject: null, + onRenameProject: (_) async => false, + headerControls: const SizedBox(), + ); + }, + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect(find.text('First chat'), findsOneWidget); + await tester.tap(find.byKey(const Key('project-chat-history'))); + await tester.pumpAndSettle(); + final menu = find.byKey(const Key('project-chat-history-menu')); + Finder menuText(String text) => + find.descendant(of: menu, matching: find.text(text)); + final group = tester.getRect(find.byKey(const Key('project-chat-group'))); + expect(tester.getRect(menuText('First chat')).left, group.left); + expect(tester.getRect(menuText('Second chat')).left, group.left); + final searchIcon = find.descendant( + of: find.byKey(const Key('project-chat-search')), + matching: find.byIcon(AppIcons.search), + ); + expect(tester.getCenter(searchIcon).dx, group.left + 7); + final search = find.byKey(const Key('project-chat-search')); + expect(tester.getSize(search).height, 28); + expect(tester.widget(search).style?.fontSize, 13); + expect(tester.widget(search).cursorHeight, 13); + expect( + find.byKey(const ValueKey('sidebar-conversation-other')), + findsNothing, + ); + await tester.enterText( + find.byKey(const Key('project-chat-search')), + 'Second', + ); + await tester.pumpAndSettle(); + await tester.tap( + find.byKey(const ValueKey('sidebar-conversation-second')), + ); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('project-chat-history-menu')), findsNothing); + expect(find.text('Second chat'), findsOneWidget); + expect(repository.selection['a'], 'second'); + + await tester.tap(find.byKey(const Key('project-chat-more'))); + await tester.pumpAndSettle(); + await tester.tap( + find.text(lookupAppLocalizations(const Locale('zh')).rename), + ); + await tester.pumpAndSettle(); + await tester.enterText(find.byType(TextFormField), 'Renamed second'); + await tester.tap( + find.text(lookupAppLocalizations(const Locale('zh')).save), + ); + await tester.pumpAndSettle(); + expect(find.text('Renamed second'), findsOneWidget); + expect( + repository.items.firstWhere((item) => item.id == 'second').title, + 'Renamed second', + ); + + await tester.tap(find.byKey(const Key('project-chat-more'))); + await tester.pumpAndSettle(); + await tester.tap( + find.text(lookupAppLocalizations(const Locale('zh')).agentMoveToTrash), + ); + await tester.pumpAndSettle(); + expect(find.text('新聊天'), findsOneWidget); + expect( + container.read(conversationSelectionProvider('a')).selectedId, + isNull, + ); + await tester.tap(find.byKey(const Key('project-chat-history'))); + await tester.pumpAndSettle(); + expect(find.text('Renamed second'), findsOneWidget); + final trashTitle = tester.getRect( + find.byKey(const Key('project-chat-trash-title')), + ); + expect( + trashTitle.left, + tester.getRect(find.byKey(const Key('project-chat-group'))).left, + ); + expect(tester.getRect(menuText('Renamed second')).left, trashTitle.left); + expect( + find.byKey(const ValueKey('sidebar-conversation-second')), + findsNothing, + ); + await tester.tap( + find.byTooltip(lookupAppLocalizations(const Locale('zh')).agentRestore), + ); + await tester.pumpAndSettle(); + expect( + find.byKey(const ValueKey('sidebar-conversation-second')), + findsOneWidget, + ); + + workspace.switchTo(projects.last); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('project-chat-history-menu')), findsNothing); + expect(find.text('Other project chat'), findsOneWidget); + await tester.tap(find.byKey(const Key('project-chat-history'))); + await tester.pumpAndSettle(); + expect( + find.byKey(const ValueKey('sidebar-conversation-other')), + findsOneWidget, + ); + expect( + find.byKey(const ValueKey('sidebar-conversation-first')), + findsNothing, + ); + expect( + find.byKey(const ValueKey('sidebar-conversation-second')), + findsNothing, + ); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }, + ); +} + +ConversationMetadata _item(String id, String projectId, String title) => + ConversationMetadata( + id: id, + projectId: projectId, + title: title, + createdAt: DateTime.utc(2026), + updatedAt: DateTime.utc(2026), + providerId: 'provider', + modelId: 'model', + timelineId: 'timeline', + pending: false, + responseDurationsMs: const [], + ); + +class _Projects extends Projects { + _Projects(this.initial); + final ProjectState initial; + @override + Future build() async => initial; + void switchTo(RecentProject project) => + state = AsyncData(state.requireValue.copyWith(activeProject: project)); +} + +class _Conversations extends EmptyConversationRepository { + _Conversations(this.items); + final List items; + final trashed = []; + final selection = {'a': 'first', 'b': 'other'}; + @override + Future> list( + String projectId, { + bool trash = false, + }) async => (trash ? trashed : items) + .where((item) => item.projectId == projectId) + .toList(); + @override + Future selected(String projectId) async => selection[projectId]; + @override + Future select(String projectId, String? conversationId) async => + selection[projectId] = conversationId; + @override + Future update(ConversationMetadata item) async { + items[items.indexWhere((entry) => entry.id == item.id)] = item; + return item; + } + + @override + Future trash(String projectId, String id) async { + final item = items.firstWhere( + (entry) => entry.projectId == projectId && entry.id == id, + ); + items.remove(item); + trashed.add(item); + if (selection[projectId] == id) selection[projectId] = null; + } + + @override + Future restore(String projectId, String id) async { + final item = trashed.firstWhere( + (entry) => entry.projectId == projectId && entry.id == id, + ); + trashed.remove(item); + items.add(item); + } +} diff --git a/test/features/projects/project_sidebar_lifecycle_test.dart b/test/features/projects/project_sidebar_lifecycle_test.dart new file mode 100644 index 0000000..8958321 --- /dev/null +++ b/test/features/projects/project_sidebar_lifecycle_test.dart @@ -0,0 +1,334 @@ +import 'dart:async'; + +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/projects/conversation_sidebar.dart'; +import 'package:cutdex/features/projects/project_sidebar.dart'; +import 'package:cutdex/integrations/agent/conversation_repository.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/workspace_mode.dart'; +import 'package:cutdex_sdk/project.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets( + 'missing conversation timeline still allows the project default', + (tester) async { + final sidebar = _Sidebar(); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + sidebar.conversations.remembered.complete(); + await tester.pump(); + sidebar.projects.opened.complete(false); + await tester.pump(); + expect(sidebar.projects._openCalls, 2); + sidebar.projects._publish(_recent[1], timelineId: 'default'); + expect(sidebar.projects._openGuards.last!(), isTrue); + sidebar.projects._fallbackOpened.complete(true); + await expectLater(operation, completes); + expect(sidebar.conversations.activated, ['chat']); + await tester.pumpWidget(const SizedBox()); + }, + ); + + testWidgets('project change invalidates a still mounted sidebar request', ( + tester, + ) async { + final sidebar = _Sidebar(); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + sidebar.projects._publish(_recent[2]); + await tester.pump(); + sidebar.conversations.remembered.complete(); + await expectLater(operation, completes); + expect(sidebar.projects._openCalls, 0); + expect(sidebar.conversations.activated, isEmpty); + expect(sidebar.modes, isEmpty); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets( + 'returning to the source project does not revive old navigation', + (tester) async { + final sidebar = _Sidebar(); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + sidebar.projects._publish(_recent[2]); + sidebar.projects._publish(_recent[0]); + await tester.pump(); + sidebar.conversations.remembered.complete(); + await expectLater(operation, completes); + expect(sidebar.projects._openCalls, 0); + expect(sidebar.conversations.activated, isEmpty); + await tester.pumpWidget(const SizedBox()); + }, + ); + + testWidgets('timeline change invalidates a pending conversation selection', ( + tester, + ) async { + final sidebar = _Sidebar(activeProject: _recent[1]); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + sidebar.projects._publish(_recent[1], timelineId: 'other'); + await tester.pump(); + sidebar.conversations.remembered.complete(); + await expectLater(operation, completes); + expect(sidebar.conversations.activated, isEmpty); + expect(sidebar.modes, isEmpty); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets( + 'latest conversation wins when selection saves finish in reverse', + (tester) async { + final sidebar = _Sidebar(activeProject: _recent[1]); + await sidebar.mount(tester); + final first = sidebar.select(tester); + final second = sidebar.select(tester, id: 'next'); + sidebar.conversations.nextRemembered.complete(); + await expectLater(second, completes); + sidebar.conversations.remembered.complete(); + await expectLater(first, completes); + expect(sidebar.conversations.activated, ['next']); + expect(sidebar.navigationCompletions, 1); + await tester.pumpWidget(const SizedBox()); + }, + ); + + testWidgets('navigation allows the project transition it requested', ( + tester, + ) async { + final sidebar = _Sidebar(); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + sidebar.conversations.remembered.complete(); + await tester.pump(); + expect(sidebar.projects._openCalls, 1); + expect(sidebar.projects._openGuards.single!(), isTrue); + sidebar.projects._publish(_recent[1], timelineId: 'timeline'); + sidebar.projects.opened.complete(true); + await expectLater(operation, completes); + expect(sidebar.conversations.activated, ['chat']); + expect(sidebar.modes, [WorkspaceMode.agent]); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets('removed sidebar stops navigation after remembering selection', ( + tester, + ) async { + final sidebar = _Sidebar(); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + await tester.pump(); + await tester.pumpWidget(sidebar.host(const SizedBox())); + sidebar.conversations.remembered.complete(); + await expectLater(operation, completes); + expect(sidebar.projects._openCalls, 0); + expect(sidebar.conversations.activated, isEmpty); + expect(sidebar.modes, isEmpty); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets('removed sidebar does not retry a failed project open', ( + tester, + ) async { + final sidebar = _Sidebar(); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + sidebar.conversations.remembered.complete(); + await tester.pump(); + expect(sidebar.projects._openCalls, 1); + await tester.pumpWidget(sidebar.host(const SizedBox())); + expect(sidebar.projects._openGuards.single!(), isFalse); + sidebar.projects.opened.complete(false); + await expectLater(operation, completes); + expect(sidebar.projects._openCalls, 1); + expect(sidebar.conversations.activated, isEmpty); + expect(sidebar.modes, isEmpty); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets('mounted sidebar still activates the selected conversation', ( + tester, + ) async { + final sidebar = _Sidebar(activeProject: _recent[1]); + await sidebar.mount(tester); + final operation = sidebar.select(tester); + sidebar.conversations.remembered.complete(); + await expectLater(operation, completes); + await tester.pump(); + expect(sidebar.projects._openCalls, 0); + expect(sidebar.conversations.activated, ['chat']); + expect(sidebar.modes, [WorkspaceMode.agent]); + expect(sidebar.navigationCompletions, 1); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); +} + +const _recent = [ + RecentProject(id: 'a', name: 'A', path: '/a'), + RecentProject(id: 'b', name: 'B', path: '/b'), + RecentProject(id: 'c', name: 'C', path: '/c'), +]; + +class _Sidebar { + _Sidebar({ + RecentProject activeProject = const RecentProject( + id: 'a', + name: 'A', + path: '/a', + ), + }) { + initial = ProjectState(activeProject: activeProject, recent: _recent); + projects = _Projects(initial); + conversations = _Conversations(item); + container = ProviderContainer( + overrides: [ + projectsProvider.overrideWith(() => projects), + conversationSidebarProvider.overrideWith(() => conversations), + conversationSelectionProvider.overrideWith2((_) => _Selected()), + ], + ); + addTearDown(container.dispose); + } + + late final ProjectState initial; + late final _Projects projects; + late final _Conversations conversations; + late final ProviderContainer container; + final modes = []; + int navigationCompletions = 0; + final item = ConversationMetadata( + id: 'chat', + projectId: 'b', + title: 'Chat', + createdAt: DateTime.utc(2026), + updatedAt: DateTime.utc(2026), + providerId: 'provider', + modelId: 'model', + timelineId: 'timeline', + pending: false, + responseDurationsMs: const [], + ); + + Future select(WidgetTester tester, {String id = 'chat'}) { + final row = tester.widget( + find.byKey(ValueKey('sidebar-conversation-$id')), + ); + // InkWell declares a void callback, but navigation returns a future. + // Await that operation so async lifecycle exceptions fail this test. + return Function.apply(row.onTap!, []) as Future; + } + + Widget host(Widget child) => UncontrolledProviderScope( + container: container, + child: MaterialApp( + theme: EditorTheme.desktop(EditorTheme.penLight), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + home: Scaffold(body: SizedBox(width: 350, child: child)), + ), + ); + + Future mount(WidgetTester tester) async { + await container.read(projectsProvider.future); + await container.read(conversationSidebarProvider.future); + await tester.pumpWidget( + host( + ProjectSidebar( + agent: const SizedBox(), + navigationOnly: true, + mode: WorkspaceMode.agent, + onModeChanged: modes.add, + onNavigationComplete: () => navigationCompletions++, + navigationWidth: 350, + navigationCollapsed: false, + agentHeaderLeading: const SizedBox(), + editorHidden: false, + onExpandEditor: null, + state: initial, + selectedProjectId: initial.activeProject!.id, + integratedTitlebar: false, + onCreateProject: null, + onSelectProject: null, + onRenameProject: (_) async => false, + headerControls: const SizedBox(), + ), + ), + ); + await tester.pumpAndSettle(); + } +} + +class _Projects extends Projects { + _Projects(this.initial); + final ProjectState initial; + final opened = Completer(); + final _fallbackOpened = Completer(); + int _openCalls = 0; + final _openGuards = []; + + void _publish(RecentProject project, {String? timelineId}) { + state = AsyncData( + state.requireValue.copyWith( + activeProject: project, + timeline: timelineId == null + ? null + : TimelineDocument(id: timelineId, name: timelineId, sequences: []), + ), + ); + } + + @override + Future build() async => initial; + + @override + Future open( + String path, { + String? name, + String? expectedId, + String? timelineId, + String? initialTimelineName, + bool Function()? isCurrent, + }) { + _openCalls++; + _openGuards.add(isCurrent); + return _openCalls == 1 ? opened.future : _fallbackOpened.future; + } +} + +class _Selected extends ConversationSelection { + @override + ConversationSelectionState build(String? projectId) => + const ConversationSelectionState(draftKey: 'draft', initialized: true); +} + +class _Conversations extends ConversationSidebar { + _Conversations(this.item); + final ConversationMetadata item; + final remembered = Completer(); + final nextRemembered = Completer(); + final activated = []; + + @override + Future build() async => ConversationSnapshot( + groups: { + 'b': [item, item.copyWith(id: 'next')], + }, + ); + + @override + Future rememberSelection(ConversationMetadata item) => + item.id == 'next' ? nextRemembered.future : remembered.future; + + @override + void activate(ConversationMetadata item) => activated.add(item.id); +} diff --git a/test/features/projects/project_tabs_controller_test.dart b/test/features/projects/project_tabs_controller_test.dart new file mode 100644 index 0000000..b9abffd --- /dev/null +++ b/test/features/projects/project_tabs_controller_test.dart @@ -0,0 +1,117 @@ +import 'package:cutdex/features/projects/project_tabs_controller.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + const first = RecentProject(id: 'a', name: 'First', path: '/first'); + const second = RecentProject(id: 'b', name: 'Second', path: '/second'); + const third = RecentProject(id: 'c', name: 'Recent only', path: '/third'); + late _Projects projects; + late ProviderContainer container; + late ProjectTabsController tabs; + + setUp(() async { + projects = _Projects( + const ProjectState(activeProject: first, recent: [first, second, third]), + ); + container = ProviderContainer( + overrides: [projectsProvider.overrideWith(() => projects)], + ); + await container.read(projectsProvider.future); + tabs = container.read(projectTabsProvider.notifier); + }); + tearDown(() => container.dispose()); + List opened() => container.read(projectTabsProvider); + + test( + 'tabs follow successful opens, keep order and exclude recent-only files', + () { + expect(opened(), [first]); + projects.publish(projects._current.copyWith(activeProject: second)); + expect(opened(), [first, second]); + projects.publish(projects._current.copyWith(activeProject: first)); + expect(opened(), [first, second]); + projects.publish(projects._current.copyWith(projectBusy: true)); + expect(opened(), [first, second]); + }, + ); + + test( + 'history removal and truncation do not discard opened project metadata', + () { + projects.publish(projects._current.copyWith(activeProject: second)); + projects.publish(projects._current.copyWith(recent: const [third])); + expect(opened(), [first, second]); + projects.publish(projects._current.copyWith(activeProject: null)); + expect(opened(), [first, second]); + tabs.remove(second.id); + expect(opened(), [first]); + projects.publish(projects._current.copyWith(activeProject: second)); + expect(opened(), [first, second]); + }, + ); + + test('metadata changes update tabs without changing their order', () { + projects.publish(projects._current.copyWith(activeProject: second)); + final renamed = first.copyWith(name: 'Renamed'); + final relocated = second.copyWith(path: '/new-second'); + projects.publish( + projects._current.copyWith( + recent: [renamed, relocated, third], + activeProject: relocated, + ), + ); + expect(opened(), [renamed, relocated]); + projects.publish(projects._current.copyWith(recent: const [])); + final renamedAgain = renamed.copyWith(name: 'Renamed outside history'); + tabs.updateProject(renamedAgain); + expect(opened(), [renamedAgain, relocated]); + }); + + test('history updates do not reopen a closed inactive tab', () { + projects.publish(projects._current.copyWith(activeProject: second)); + tabs.remove(first.id); + projects.publish( + projects._current.copyWith( + recent: [ + first.copyWith(name: 'Updated'), + second, + ], + ), + ); + expect(opened(), [second]); + expect(() => opened().clear(), throwsUnsupportedError); + }); + + test('all opened projects remain available beyond the twenty-entry history limit', () { + for (var index = 0; index < 25; index++) { + final project = RecentProject( + id: 'extra-$index', + name: 'Project $index', + path: '/extra-$index', + ); + projects.publish( + projects._current.copyWith( + activeProject: project, + recent: [project, ...projects._current.recent].take(20).toList(), + ), + ); + } + expect(projects._current.recent, hasLength(20)); + expect(opened(), hasLength(26)); + expect(opened().first, first); + expect(opened().last.id, 'extra-24'); + }); +} + +class _Projects extends Projects { + _Projects(this.initial); + final ProjectState initial; + @override + Future build() async => initial; + ProjectState get _current => state.requireValue; + void publish(ProjectState value) => state = AsyncData(value); +} diff --git a/test/integrations/platform/file_picker_test.dart b/test/integrations/platform/file_picker_test.dart index d1f3f26..6cf1ddb 100644 --- a/test/integrations/platform/file_picker_test.dart +++ b/test/integrations/platform/file_picker_test.dart @@ -1,5 +1,6 @@ import 'package:cutdex/integrations/platform/file_picker.dart'; import 'package:flutter/services.dart'; +import 'package:flutter/foundation.dart'; import 'package:cutdex/workspace/media_import.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -7,6 +8,7 @@ void main() { TestWidgetsFlutterBinding.ensureInitialized(); const picker = AppFilePicker(); const channel = MethodChannel('filegate'); + const nativeChannel = MethodChannel('cutdex_native/file_picker'); Object? response; MethodCall? lastCall; @@ -22,6 +24,60 @@ void main() { tearDown(() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(channel, null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(nativeChannel, null); + debugDefaultTargetPlatformOverride = null; + }); + + test( + 'macOS uses the window-owned picker and preserves local paths', + () async { + debugDefaultTargetPlatformOverride = TargetPlatform.macOS; + MethodCall? nativeCall; + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(nativeChannel, (call) async { + nativeCall = call; + return ['/tmp/a b.mp4', '/tmp/中文.wav']; + }); + expect( + await picker.pickFiles(allowedExtensions: ['.MP4', 'wav', 'mp4']), + [ + const ExternalMediaFile(path: '/tmp/a b.mp4'), + const ExternalMediaFile(path: '/tmp/中文.wav'), + ], + ); + expect(nativeCall!.method, 'pickFiles'); + expect(nativeCall!.arguments, { + 'allowedExtensions': ['mp4', 'wav'], + }); + expect(lastCall, isNull); + }, + ); + + test('macOS cancellation produces no selection', () async { + debugDefaultTargetPlatformOverride = TargetPlatform.macOS; + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(nativeChannel, (_) async => null); + expect(await picker.pickFiles(allowedExtensions: ['mp4']), isEmpty); + expect(lastCall, isNull); + }); + + test('macOS reports a busy or unavailable host window', () async { + debugDefaultTargetPlatformOverride = TargetPlatform.macOS; + for (final code in ['picker_active', 'window_unavailable']) { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + nativeChannel, + (_) async => throw PlatformException(code: code), + ); + await expectLater( + picker.pickFiles(allowedExtensions: ['mp4']), + throwsA( + isA().having((error) => error.code, 'code', code), + ), + ); + } + expect(lastCall, isNull); }); test( diff --git a/test/listenable_selector_test.dart b/test/listenable_selector_test.dart index 48afae4..0c6acdd 100644 --- a/test/listenable_selector_test.dart +++ b/test/listenable_selector_test.dart @@ -3,6 +3,142 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { + testWidgets('selector activation must use the new owner callback', ( + tester, + ) async { + final source = ValueNotifier(0); + addTearDown(source.dispose); + final key = GlobalKey(); + var moved = false; + late StateSetter update; + Widget region() => Builder( + builder: (owner) => ListenableSelector( + key: key, + listenable: source, + select: () { + Directionality.of(owner); + return source.value; + }, + builder: (_, value) => Text('$value'), + ), + ); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: StatefulBuilder( + builder: (_, setState) { + update = setState; + return Row( + children: [ + Expanded(child: moved ? const SizedBox() : region()), + Expanded(child: moved ? region() : const SizedBox()), + ], + ); + }, + ), + ), + ); + update(() => moved = true); + await tester.pump(); + expect(tester.takeException(), isNull); + source.value = 1; + await tester.pump(); + expect(find.text('1'), findsOneWidget); + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets('deactivated selection ignores replacement notifications', ( + tester, + ) async { + final source = _Source((time: 0, playing: false)); + addTearDown(source.dispose); + var selections = 0; + var listeningAtReplacement = true; + Widget host(Widget child) => + Directionality(textDirection: TextDirection.ltr, child: child); + await tester.pumpWidget( + host( + Builder( + builder: (ownerContext) => ListenableSelector( + listenable: source, + select: () { + selections++; + Directionality.of(ownerContext); + return source.value.time; + }, + builder: (_, value) => Text('$value'), + ), + ), + ), + ); + final initial = selections; + await tester.pumpWidget( + host( + _NotifyOnMount(() { + listeningAtReplacement = source.subscribed; + source.value = (time: 1, playing: false); + }), + ), + ); + expect(tester.takeException(), isNull); + expect(listeningAtReplacement, isFalse); + expect(selections, initial); + expect(source.subscribed, isFalse); + }); + + testWidgets('reparented selection resumes and catches up before rendering', ( + tester, + ) async { + final source = _Source((time: 0, playing: false)); + addTearDown(source.dispose); + final key = GlobalKey(); + var moved = false; + var listeningDuringMove = true; + late StateSetter move; + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: StatefulBuilder( + builder: (context, setState) { + move = setState; + final selection = ListenableSelector( + key: key, + listenable: source, + select: () => source.value.time, + builder: (_, value) => Text('$value'), + ); + return Row( + children: [ + SizedBox( + child: moved + ? _NotifyOnMount(() { + listeningDuringMove = source.subscribed; + source.value = (time: 7, playing: false); + }) + : selection, + ), + SizedBox(child: moved ? selection : const SizedBox()), + ], + ); + }, + ), + ), + ); + final element = tester.element(find.byKey(key)); + move(() => moved = true); + await tester.pump(); + expect(listeningDuringMove, isFalse); + expect(tester.element(find.byKey(key)), same(element)); + expect(find.text('7'), findsOneWidget); + expect(source.subscribed, isTrue); + source.value = (time: 8, playing: false); + await tester.pump(); + expect(find.text('8'), findsOneWidget); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + expect(source.subscribed, isFalse); + }); + testWidgets('selection ignores unrelated events and detaches old sources', ( tester, ) async { @@ -40,6 +176,73 @@ void main() { await tester.pumpWidget(const SizedBox()); expect(second.subscribed, isFalse); }); + testWidgets('hidden selection pauses observation and catches up on reveal', ( + tester, + ) async { + final source = _Source((time: 0, playing: false)); + addTearDown(source.dispose); + var visible = true; + var selections = 0; + late StateSetter changeVisibility; + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: StatefulBuilder( + builder: (context, setState) { + changeVisibility = setState; + return TickerMode( + enabled: visible, + child: ListenableSelector( + listenable: source, + select: () { + selections++; + return source.value.time; + }, + builder: (context, time) => Text('$time'), + ), + ); + }, + ), + ), + ); + final element = tester.element(find.byType(Text)); + changeVisibility(() => visible = false); + await tester.pump(); + expect(source.subscribed, isFalse); + final hiddenSelections = selections; + for (var tick = 1; tick <= 120; tick++) { + source.value = (time: tick, playing: false); + await tester.pump(); + } + expect(selections, hiddenSelections); + expect(find.text('0'), findsOneWidget); + changeVisibility(() => visible = true); + await tester.pump(); + expect(source.subscribed, isTrue); + expect(find.text('120'), findsOneWidget); + expect(tester.element(find.byType(Text)), same(element)); + await tester.pumpWidget(const SizedBox()); + expect(source.subscribed, isFalse); + }); +} + +class _NotifyOnMount extends StatefulWidget { + const _NotifyOnMount(this.notify); + final VoidCallback notify; + + @override + State<_NotifyOnMount> createState() => _NotifyOnMountState(); +} + +class _NotifyOnMountState extends State<_NotifyOnMount> { + @override + void initState() { + super.initState(); + widget.notify(); + } + + @override + Widget build(BuildContext context) => const SizedBox(); } class _Source extends ValueNotifier<({int time, bool playing})> { diff --git a/test/mcp_settings_test.dart b/test/mcp_settings_test.dart index 780939a..f67f8d3 100644 --- a/test/mcp_settings_test.dart +++ b/test/mcp_settings_test.dart @@ -84,17 +84,31 @@ void main() { expect(tester.getRect(sidebar).right, tester.getRect(divider).left); expect(tester.getRect(sidebar).height, frameSize.height); expect( - tester.getRect(find.text('外观')).left, + tester.getRect(find.text('语言')).left, greaterThan(tester.getRect(divider).right), ); expect( - tester.widget(find.text('外观')).style?.fontSize, + tester.widget(find.text('语言')).style?.fontSize, + AppTheme.settingsContentTheme(EditorTheme.penDark) + .textTheme + .labelLarge + ?.fontSize, + ); + expect(find.text('语言'), findsOneWidget); + await tester.tap(find.byKey(const ValueKey('settings-navigation-3'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('settings-color-palette')), findsOneWidget); + expect( + tester.getRect(find.text('主题')).left, + greaterThan(tester.getRect(divider).right), + ); + expect( + tester.widget(find.text('主题')).style?.fontSize, AppTheme.settingsContentTheme(EditorTheme.penDark) .textTheme .labelLarge ?.fontSize, ); - expect(find.text('外观'), findsOneWidget); await tester.tap(find.text('MCP').first); await tester.pumpAndSettle(); expect(find.text('监听端口'), findsOneWidget); diff --git a/test/media_browser_subscription_test.dart b/test/media_browser_subscription_test.dart new file mode 100644 index 0000000..ccc16b1 --- /dev/null +++ b/test/media_browser_subscription_test.dart @@ -0,0 +1,110 @@ +import 'package:cutdex/features/media/media_browser_body.dart'; +import 'package:cutdex/features/media/media_browser_controller.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('local browsing updates keep provider subscriptions bounded', ( + tester, + ) async { + final container = ProviderContainer( + overrides: [projectsProvider.overrideWith(_Projects.new)], + ); + addTearDown(container.dispose); + await container.read(projectsProvider.future); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: const MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: MediaBrowserBody( + projectId: 'project', + grid: true, + desktop: true, + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + + final projects = container.read(projectsProvider.notifier) as _Projects; + Future subscriptionWork() async { + projects._project.idReads = 0; + projects.publishUnselectedChange(); + await tester.pumpAndSettle(); + return projects._project.idReads; + } + + final before = await subscriptionWork(); + expect(before, greaterThan(0)); + final browser = container.read(mediaBrowserProvider('project')); + for (var i = 0; i < 20; i++) { + browser.query = 'query $i'; + browser.filter = MediaFilter.values[i % MediaFilter.values.length]; + browser.sort = MediaSort.values[i % MediaSort.values.length]; + browser.gridSize = MediaGridSize.values[i % MediaGridSize.values.length]; + await tester.pump(); + expect(await subscriptionWork(), before); + } + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); +} + +class _Projects extends Projects { + final _project = _CountingProject(); + var _revision = 0; + + @override + Future build() async => ProjectState(activeProject: _project); + + void publishUnselectedChange() { + state = AsyncData( + state.requireValue.copyWith( + recent: [ + RecentProject( + id: 'recent-${_revision++}', + name: 'Recent', + path: '/Recent.cutdex', + ), + ], + ), + ); + } +} + +// Count selector evaluations through the public state model. Extra provider +// subscriptions increase this work even when the selected values stay equal. +class _CountingProject implements RecentProject { + final _value = const RecentProject( + id: 'project', + name: 'Project', + path: '/Project.cutdex', + ); + int idReads = 0; + + @override + String get id { + idReads++; + return _value.id; + } + + @override + String get name => _value.name; + + @override + String get path => _value.path; + + @override + ProjectAvailability get availability => _value.availability; + + @override + $RecentProjectCopyWith get copyWith => _value.copyWith; +} diff --git a/test/media_color_interpretation_test.dart b/test/media_color_interpretation_test.dart index c9bd4e3..9a64458 100644 --- a/test/media_color_interpretation_test.dart +++ b/test/media_color_interpretation_test.dart @@ -7,6 +7,7 @@ import 'package:cutdex/workspace/media_color_interpretation.dart'; import 'package:cutdex/workspace/timeline_session.dart'; import 'package:cutdex_sdk/runtime.dart'; import 'package:flutter/material.dart'; +import 'package:cutdex_ui/theme.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -55,85 +56,103 @@ void main() { }); for (final width in [240.0, 400.0]) { - testWidgets( - 'color inspector at $width saves source interpretation and restores automatic', - (tester) async { - await tester.runAsync(() async { - final f = await createPreviewFixture(Uri.file('/test/video.mov')); - final preview = _ColorPreview(f.timeline); - addTearDown( - () => tester.runAsync(() async { - await preview.close(); - await f.workspace.close(); - await f.directory.delete(recursive: true); - }), - ); - await tester.pumpWidget( - ProviderScope( - overrides: [ - editorPreviewProvider( - 'project', - 'project', - ).overrideWith((_) async => preview), - ], - child: MaterialApp( - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - locale: const Locale('zh'), + for (final desktop in [false, true]) { + testWidgets( + 'color inspector desktop=$desktop at $width saves source interpretation and restores automatic', + (tester) async { + await tester.runAsync(() async { + final f = await createPreviewFixture(Uri.file('/test/video.mov')); + final preview = _ColorPreview(f.timeline); + addTearDown( + () => tester.runAsync(() async { + await preview.close(); + await f.workspace.close(); + await f.directory.delete(recursive: true); + }), + ); + await tester.pumpWidget( + ProviderScope( + overrides: [ + editorPreviewProvider( + 'project', + 'project', + ).overrideWith((_) async => preview), + ], + child: MaterialApp( + localizationsDelegates: + AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), - theme: EditorTheme.penDark, - home: Scaffold( - body: Center( - child: SizedBox( - width: width, - child: ColorInterpretationProperties( - projectId: 'project', - timelineId: 'project', - session: f.timeline, - assetId: 'media', - trackIndex: 0, + theme: desktop + ? AppTheme.propertiesPanelTheme( + EditorTheme.desktop(EditorTheme.penDark), + ) + : EditorTheme.penDark, + home: Scaffold( + body: Center( + child: SizedBox( + width: width, + child: ColorInterpretationProperties( + projectId: 'project', + timelineId: 'project', + session: f.timeline, + assetId: 'media', + trackIndex: 0, + ), ), ), ), ), ), - ), - ); - await tester.pumpAndSettle(); - expect(find.text('色彩空间未知,暂按 Rec.709 显示'), findsOneWidget); - expect( - f.timeline.settings.containsKey('mediaColorInterpretations'), - isFalse, - ); - await tester.tap(find.byKey(const Key('media-color-menu'))); - await tester.pumpAndSettle(); - await tester.tap(find.text('线性 Rec.2020')); - await tester.pumpAndSettle(); - expect(find.text('手动指定:线性 Rec.2020'), findsOneWidget); - expect(tester.takeException(), isNull); - { - await f.timeline.flush(); - final saved = await f.workspace.project!.loadTimeline('project'); - final reopened = EditorTimelineSession( - document: saved, - persistence: f.timeline.persistence, - assetUris: f.timeline.assetUris, ); + await tester.pumpAndSettle(); + if (desktop) { + expect(find.byKey(const Key('media-color-menu')), findsNothing); + await tester.tap(find.byType(ExpansionTile)); + await tester.pumpAndSettle(); + } + expect(find.text('色彩空间未知,暂按 Rec.709 显示'), findsOneWidget); expect( - reopened.mediaColorInterpretation('media', 0), - RenderColorSpace.linearRec2020, + f.timeline.settings.containsKey('mediaColorInterpretations'), + isFalse, ); - expect(reopened.mediaColorInterpretation('media', 1), isNull); - } - await tester.tap(find.byKey(const Key('media-color-menu'))); - await tester.pumpAndSettle(); - await tester.tap(find.text('自动')); - await tester.pumpAndSettle(); - expect(find.text('色彩空间未知,暂按 Rec.709 显示'), findsOneWidget); - expect(f.timeline.mediaColorInterpretation('media', 0), isNull); - expect(tester.takeException(), isNull); - }); - }, - ); + await tester.tap(find.byKey(const Key('media-color-menu'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('线性 Rec.2020')); + await tester.pumpAndSettle(); + if (desktop) { + await tester.tap(find.byType(ExpansionTile)); + await tester.pumpAndSettle(); + await tester.tap(find.byType(ExpansionTile)); + await tester.pumpAndSettle(); + } + expect(find.text('手动指定:线性 Rec.2020'), findsOneWidget); + expect(tester.takeException(), isNull); + { + await f.timeline.flush(); + final saved = await f.workspace.project!.loadTimeline('project'); + final reopened = EditorTimelineSession( + document: saved, + persistence: f.timeline.persistence, + assetUris: f.timeline.assetUris, + ); + expect( + reopened.mediaColorInterpretation('media', 0), + RenderColorSpace.linearRec2020, + ); + expect(reopened.mediaColorInterpretation('media', 1), isNull); + } + await tester.tap(find.byKey(const Key('media-color-menu'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('自动')); + await tester.pumpAndSettle(); + expect(find.text('色彩空间未知,暂按 Rec.709 显示'), findsOneWidget); + expect(f.timeline.mediaColorInterpretation('media', 0), isNull); + expect(tester.takeException(), isNull); + }); + }, + ); + } } } diff --git a/test/media_panel_test.dart b/test/media_panel_test.dart index 0179b13..08ef0c8 100644 --- a/test/media_panel_test.dart +++ b/test/media_panel_test.dart @@ -8,7 +8,7 @@ import 'dart:async'; import 'dart:ui' as ui; import 'package:cutdex/features/media/media_panel.dart'; -import 'package:cutdex/features/media/media_asset_strip.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex/shared/widgets/drop_to_add_overlay.dart'; import 'package:cutdex/workspace/projects.dart'; @@ -130,7 +130,7 @@ void main() { locale: locale, localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, - theme: EditorTheme.penLight, + theme: EditorTheme.desktop(EditorTheme.penLight), home: Scaffold( body: MediaQuery( data: const MediaQueryData( @@ -269,7 +269,10 @@ void main() { await tester.tap(find.text('重命名')); await tester.pumpAndSettle(); expect( - tester.widget(find.byType(TextField)).controller!.text, + tester + .widget(find.byType(TextField).last) + .controller! + .text, 'second.txt', ); await tester.tap(find.text('取消')); @@ -333,7 +336,9 @@ void main() { supportedLocales: AppLocalizations.supportedLocales, locale: const Locale('zh'), - theme: EditorTheme.penLight, + theme: touch + ? EditorTheme.penLight + : EditorTheme.desktop(EditorTheme.penLight), home: Scaffold( body: touch ? const MediaBrowserPage(projectId: 'project') @@ -346,57 +351,157 @@ void main() { return container; } - testWidgets('list uses a filmstrip with real duration above its name', ( - tester, - ) async { - const channel = MethodChannel('cutdex_runtime'); - final times = []; - tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(channel, ( - call, - ) async { - if (call.method == 'probe') { - return { - 'duration': {'numerator': '290', 'denominator': 1}, - 'videoTrackCount': 1, - 'videoTrackIds': [1], - 'audioTrackCount': 0, - 'audioTrackIds': [], - 'audioTracks': [], - 'isProtected': false, - }; - } - if (call.method == 'thumbnail') { - final args = call.arguments as Map; - final time = args['time'] as Map; - times.add(int.parse(time['numerator'].toString())); - } - throw PlatformException(code: 'no-preview'); - }); - addTearDown( - () => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( - channel, - null, + for (final touch in [false, true]) { + testWidgets( + '${touch ? 'touch' : 'desktop'} waits for file selection without a loading bar', + (tester) async { + final channel = MethodChannel( + touch ? 'filegate' : 'cutdex_native/file_picker', + ); + final cancelled = Completer(); + final selected = Completer(); + var pickerCalls = 0; + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + channel, + (_) => pickerCalls++ == 0 ? cancelled.future : selected.future, + ); + addTearDown( + () => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + channel, + null, + ), + ); + final container = await mount(tester, touch: touch); + final projects = container.read(projectsProvider.notifier) as _Projects; + final imported = Completer(); + projects.importGate = imported.future; + final button = find.byKey(const Key('media-import-button')); + + Future openPicker() async { + await tester.tap(button); + await tester.pump(); + await tester.pump(const Duration(milliseconds: 500)); + expect(find.byType(LinearProgressIndicator), findsNothing); + expect(tester.widget(button).onPressed, isNull); + } + + await openPicker(); + cancelled.complete(null); + await tester.pumpAndSettle(); + expect(find.byType(LinearProgressIndicator), findsNothing); + expect(tester.widget(button).onPressed, isNotNull); + expect(projects.received, isEmpty); + + await openPicker(); + selected.complete( + touch + ? [ + { + 'path': '/originals/clip.mp4', + 'name': 'clip.mp4', + 'kind': 'file', + }, + ] + : ['/originals/clip.mp4'], + ); + await tester.pump(); + await tester.pump(); + await tester.pump(const Duration(milliseconds: 250)); + await tester.pump(); + expect(find.byType(LinearProgressIndicator), findsOneWidget); + expect(tester.widget(button).onPressed, isNull); + + imported.complete(); + await tester.pumpAndSettle(); + expect(find.byType(LinearProgressIndicator), findsNothing); + expect(tester.widget(button).onPressed, isNotNull); + expect(projects.received.single.localPath, '/originals/clip.mp4'); + expect(pickerCalls, 2); + expect(tester.takeException(), isNull); + }, + variant: TargetPlatformVariant.only( + touch ? TargetPlatform.android : TargetPlatform.macOS, ), ); - final container = await mount(tester); - await (container.read(projectsProvider.notifier) as _Projects) - .importExternalMedia('project', [ - const ExternalMediaFile(path: '/movie.mp4'), - ]); - await tester.pumpAndSettle(); - await tester.tap(find.byTooltip('列表布局')); - await tester.pumpAndSettle(); - final strip = tester.getRect(find.byType(MediaAssetStrip)); - final name = tester.getRect(find.text('movie.mp4')); - final duration = tester.getRect(find.text('04:50')); - expect(strip.height, 46); - expect(name.top, greaterThanOrEqualTo(strip.bottom)); - expect(duration.right, lessThanOrEqualTo(strip.right)); - expect(duration.left, greaterThan(strip.center.dx)); - expect(duration.top, strip.top + 5); - expect(times.any((time) => time > 0), isTrue); - expect(tester.takeException(), isNull); - }); + } + + testWidgets( + 'desktop list uses a compact cover with real duration beside its name', + (tester) async { + await tester.binding.setSurfaceSize(const Size(320, 600)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + const channel = MethodChannel('cutdex_runtime'); + final times = []; + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(channel, ( + call, + ) async { + if (call.method == 'probe') { + return { + 'duration': {'numerator': '290', 'denominator': 1}, + 'videoTrackCount': 1, + 'videoTrackIds': [1], + 'audioTrackCount': 0, + 'audioTrackIds': [], + 'audioTracks': [], + 'isProtected': false, + }; + } + if (call.method == 'thumbnail') { + final args = call.arguments as Map; + final time = args['time'] as Map; + times.add(int.parse(time['numerator'].toString())); + } + throw PlatformException(code: 'no-preview'); + }); + addTearDown( + () => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + channel, + null, + ), + ); + final container = await mount(tester); + await (container.read(projectsProvider.notifier) as _Projects) + .importExternalMedia('project', [ + const ExternalMediaFile(path: '/movie.mp4'), + ]); + await tester.pumpAndSettle(); + await tester.tap(find.byTooltip('列表布局')); + await tester.pumpAndSettle(); + final cover = tester.getRect( + find.byKey(const ValueKey('desktop-media-cover-/movie.mp4')), + ); + final name = tester.getRect(find.text('movie.mp4')); + final duration = tester.getRect(find.text('04:50')); + expect(cover.width, 56); + expect(cover.height, closeTo(56 * 9 / 16, .01)); + expect(name.left, cover.right + 8); + expect(duration.left, greaterThanOrEqualTo(name.left)); + expect(duration.center.dy, closeTo(cover.center.dy, .01)); + expect(times.every((time) => time == 0), isTrue); + expect(tester.takeException(), isNull); + await tester.binding.setSurfaceSize(const Size(180, 600)); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: MaterialApp( + theme: EditorTheme.desktop(EditorTheme.penLight), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: const Scaffold( + body: MediaQuery( + data: MediaQueryData(textScaler: TextScaler.linear(1.5)), + child: MediaPanel(projectId: 'project'), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect(find.text('04:50'), findsOneWidget); + expect(tester.takeException(), isNull); + }, + ); testWidgets( 'missing assets stay named and marked in both layouts without dragging', @@ -425,7 +530,133 @@ void main() { ); testWidgets( - 'category dropdown filters both layouts and restores all assets', + 'desktop media fits all six themes and keeps selection at narrow widths', + (tester) async { + final container = await mount(tester); + final projects = container.read(projectsProvider.notifier) as _Projects; + await projects.importExternalMedia('project', [ + const ExternalMediaFile(path: '/long-original-asset-name.txt'), + const ExternalMediaFile(path: '/second.txt'), + ]); + await tester.pumpAndSettle(); + final browser = container.read(mediaBrowserProvider('project')); + browser.selectedAssetId = '/long-original-asset-name.txt'; + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + for (final width in [180.0, 240.0, 320.0, 560.0]) { + for (final grid in [true, false]) { + browser.grid = grid; + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: MaterialApp( + theme: EditorTheme.desktop( + EditorTheme.forPalette(palette, brightness), + ), + localizationsDelegates: + AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('en'), + home: Scaffold( + body: MediaQuery( + data: const MediaQueryData( + textScaler: TextScaler.linear(1.5), + ), + child: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + child: const MediaPanel(projectId: 'project'), + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect(browser.selectedAssetId, '/long-original-asset-name.txt'); + final cover = tester.getRect( + find.byKey( + const ValueKey( + 'desktop-media-cover-/long-original-asset-name.txt', + ), + ), + ); + expect(cover.width / cover.height, closeTo(16 / 9, .01)); + expect( + tester.takeException(), + isNull, + reason: '$palette $brightness width=$width grid=$grid', + ); + } + } + } + } + }, + ); + + testWidgets( + 'Chinese media cards fit fractional text scaling without overflow', + (tester) async { + final container = await mount(tester); + await (container.read(projectsProvider.notifier) as _Projects) + .importExternalMedia('project', [ + const ExternalMediaFile(path: '/截屏2026-10-08 21.32.56.txt'), + const ExternalMediaFile(path: '/gyp-ÁÉ-long-file-name.txt'), + ]); + for (final width in [180.0, 241.0, 321.0]) { + for (final scale in [1.0, 1.05, 1.1, 1.25, 1.5, 2.0]) { + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: MaterialApp( + theme: EditorTheme.desktop(EditorTheme.penLight), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + child: MediaQuery( + data: MediaQueryData( + textScaler: TextScaler.linear(scale), + ), + child: const MediaPanel(projectId: 'project'), + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect( + tester.takeException(), + isNull, + reason: 'width=$width scale=$scale', + ); + final tile = find.byKey(const ValueKey('/截屏2026-10-08 21.32.56.txt')); + final metadata = find.descendant(of: tile, matching: find.text('素材')); + expect( + tester.getRect(tile).bottom - tester.getRect(metadata).bottom, + greaterThanOrEqualTo(5), + ); + final cover = tester.getRect( + find.byKey( + const ValueKey('desktop-media-cover-/截屏2026-10-08 21.32.56.txt'), + ), + ); + expect(cover.width / cover.height, closeTo(16 / 9, .01)); + } + } + }, + ); + + testWidgets( + 'desktop categories filter both layouts and retain shared controls', (tester) async { final container = await mount(tester); final projects = container.read(projectsProvider.notifier) as _Projects; @@ -436,80 +667,42 @@ void main() { const ExternalMediaFile(path: '/notes.txt'), ]); await tester.pumpAndSettle(); - expect(find.byKey(const Key('media-import-button')), findsOneWidget); - expect( - tester.getSize(find.byKey(const Key('media-panel-header'))).height, - AppControlSize.panelToolbar * 2, - ); - expect( - tester.getSize(find.byKey(const Key('media-import-button'))).height, - AppControlSize.headerButton, - ); final header = tester.getRect( find.byKey(const Key('media-panel-header')), ); - expect( - tester.getRect(find.byKey(const Key('media-panel-body'))).top, - header.bottom, - ); final importButton = tester.getRect( find.byKey(const Key('media-import-button')), ); final layoutButton = tester.getRect( find.byKey(const Key('media-layout-toggle')), ); - final filter = find.byWidgetPredicate( - (widget) => widget is Semantics && widget.properties.label == '素材分类', + final sortButton = tester.getRect( + find.byKey(const Key('media-sort-button')), ); - final filterButton = tester.getRect( - find.descendant(of: filter, matching: find.byType(TextButton)), - ); - expect(header.right - importButton.right, AppSidebarMetrics.outerPadding); - expect(importButton.top - header.top, AppSpacing.gap); - expect(layoutButton.top - importButton.top, AppControlSize.panelToolbar); + expect(header.height, 76); + expect(importButton.height, 28); + expect(importButton.top - header.top, 4); + expect(header.right - importButton.right, 12); + expect(header.right - layoutButton.right, 12); + expect(sortButton.top, layoutButton.top); + expect(layoutButton.left - sortButton.right, 36); + expect(find.byKey(const Key('media-category-button')), findsOneWidget); + expect(find.byKey(const ValueKey('media-filter-image')), findsNothing); expect( - tester.getRect(find.byKey(const Key('media-project-button'))).top, - importButton.top, + tester.getRect(find.byKey(const Key('media-panel-body'))).top, + header.bottom, ); - expect(header.right - layoutButton.right, AppSidebarMetrics.outerPadding); - expect( - layoutButton.left - filterButton.right, - greaterThanOrEqualTo(AppSpacing.tiny), - ); - expect(tester.getSize(filter).height, AppControlSize.headerButton); - final importStyle = tester - .widget(find.byKey(const Key('media-import-button'))) - .style! - .textStyle! - .resolve({})!; - final filterStyle = tester - .widget(find.byKey(const Key('media-category-button'))) - .style! - .textStyle! - .resolve({})!; - expect(importStyle.fontSize, 13); - expect(importStyle.height, 18 / 13); - expect(filterStyle.fontSize, importStyle.fontSize); - expect(filterStyle.height, importStyle.height); - expect(find.text('4 个素材'), findsNothing); + expect(find.text('4 个素材'), findsOneWidget); for (final entry in { - '图片': 'photo.png', - '视频': 'movie.mp4', - '音频': 'song.wav', + 'image': 'photo.png', + 'video': 'movie.mp4', + 'audio': 'song.wav', }.entries) { - await tester.tap( - find.descendant( - of: find.byWidgetPredicate( - (widget) => - widget is Semantics && widget.properties.label == '素材分类', - ), - matching: find.byType(TextButton), - ), - ); + await tester.tap(find.byKey(const Key('media-category-button'))); await tester.pumpAndSettle(); - await tester.tap(find.widgetWithText(MenuItemButton, entry.key)); + await tester.tap(find.byKey(ValueKey('media-filter-${entry.key}'))); await tester.pumpAndSettle(); - expect(find.text('1 个素材'), findsNothing); + expect(find.text('1 个素材'), findsOneWidget); expect(find.text(entry.value), findsOneWidget); expect(find.text('notes.txt'), findsNothing); } @@ -517,24 +710,73 @@ void main() { await tester.pumpAndSettle(); expect(find.text('song.wav'), findsOneWidget); expect(find.text('movie.mp4'), findsNothing); - await tester.tap( - find.descendant( - of: find.byWidgetPredicate( - (widget) => - widget is Semantics && widget.properties.label == '素材分类', - ), - matching: find.byType(TextButton), - ), - ); + await tester.tap(find.byKey(const Key('media-category-button'))); await tester.pumpAndSettle(); - await tester.tap(find.widgetWithText(MenuItemButton, '全部')); + await tester.tap(find.byKey(const ValueKey('media-filter-all'))); await tester.pumpAndSettle(); - expect(find.text('4 个素材'), findsNothing); + expect(find.text('4 个素材'), findsOneWidget); expect(find.text('notes.txt'), findsOneWidget); expect(tester.takeException(), isNull); }, ); + testWidgets( + 'search and sort share selection across layouts and preserve project choices', + (tester) async { + final container = await mount(tester); + final projects = container.read(projectsProvider.notifier) as _Projects; + await projects.importExternalMedia('project', [ + const ExternalMediaFile(path: '/Zebra.png'), + const ExternalMediaFile(path: '/Alpha.png'), + const ExternalMediaFile(path: '/song.wav'), + ]); + await tester.pumpAndSettle(); + final browser = container.read(mediaBrowserProvider('project')); + final search = find.byKey(const Key('media-search')); + await tester.enterText(search, 'ALPHA'); + await tester.pumpAndSettle(); + expect(find.text('Zebra.png'), findsNothing); + expect(find.text('1 个素材'), findsOneWidget); + await tester.tap(find.text('Alpha.png')); + await tester.pumpAndSettle(); + final selected = browser.selectedAssetId!; + final before = tester.getSize(find.byKey(ValueKey(selected))); + await tester.tap(find.text('Alpha.png')); + await tester.pump(); + expect(tester.getSize(find.byKey(ValueKey(selected))), before); + await tester.tap(find.byTooltip('列表布局')); + await tester.pumpAndSettle(); + expect(browser.selectedAssetId, selected); + expect(tester.widget(search).controller!.text, 'ALPHA'); + expect(find.text('已选 1 个'), findsOneWidget); + expect( + tester.getRect(find.byKey(const Key('media-browser-footer'))).right - + tester.getRect(find.text('已选 1 个')).right, + 12, + ); + await tester.enterText(search, 'not found'); + await tester.pumpAndSettle(); + expect(find.text('没有匹配的素材'), findsOneWidget); + expect(find.text('已选 1 个'), findsNothing); + await tester.enterText(search, ''); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('media-sort-button'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const ValueKey('media-sort-nameAscending'))); + await tester.pumpAndSettle(); + expect( + tester.getTopLeft(find.text('Alpha.png')).dy, + lessThan(tester.getTopLeft(find.text('Zebra.png')).dy), + ); + expect(browser.sort, MediaSort.nameAscending); + final other = container.read(mediaBrowserProvider('second')); + expect(other.query, isEmpty); + expect(other.sort, MediaSort.importOrder); + expect(browser.selectedAssetId, selected); + expect(tester.takeException(), isNull); + }, + ); + testWidgets( 'media layouts resize columns and retain selection and dragging', (tester) async { @@ -551,7 +793,7 @@ void main() { (tester.widget(find.byType(GridView)).gridDelegate as SliverGridDelegateWithFixedCrossAxisCount) .crossAxisCount; - expect(columns(), 3); + expect(columns(), 1); expect( find.ancestor( of: find.byType(GridView), @@ -598,13 +840,15 @@ void main() { await tester.tap(find.byTooltip('宫格布局')); await tester.pumpAndSettle(); for (final (width, count) in [ - (180.0, 2), - (280.0, 3), - (240.0, 2), - (360.0, 3), - (520.0, 5), - (560.0, 5), - (900.0, 8), + (120.0, 1), + (180.0, 1), + (220.0, 1), + (280.0, 1), + (240.0, 1), + (360.0, 2), + (520.0, 3), + (560.0, 3), + (900.0, 5), ]) { await tester.binding.setSurfaceSize(Size(width, 600)); await tester.pumpAndSettle(); @@ -618,7 +862,7 @@ void main() { padding.horizontal - delegate.crossAxisSpacing * (count - 1)) / count; - expect(tileWidth, lessThanOrEqualTo(120)); + expect(tileWidth, greaterThanOrEqualTo(width < 184 ? width - 24 : 160)); expect(tester.takeException(), isNull); } expect( @@ -633,10 +877,223 @@ void main() { }, ); + testWidgets('thumbnail size is project-specific and retains selection', ( + tester, + ) async { + await tester.binding.setSurfaceSize(const Size(720, 500)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + final container = await mount(tester); + await (container.read(projectsProvider.notifier) as _Projects) + .importExternalMedia('project', [ + for (var i = 0; i < 20; i++) ExternalMediaFile(path: '/asset-$i.txt'), + ]); + await tester.pumpAndSettle(); + final browser = container.read(mediaBrowserProvider('project')); + browser.selectedAssetId = '/asset-0.txt'; + int columns() => + (tester.widget(find.byType(GridView)).gridDelegate + as SliverGridDelegateWithFixedCrossAxisCount) + .crossAxisCount; + expect(columns(), 4); + for (final (size, count) in [ + (MediaGridSize.small, 5), + (MediaGridSize.large, 3), + (MediaGridSize.medium, 4), + ]) { + await tester.tap(find.byKey(const Key('media-size-button'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(ValueKey('media-size-${size.name}'))); + await tester.pumpAndSettle(); + expect(browser.gridSize, size); + expect(columns(), count); + expect(browser.selectedAssetId, '/asset-0.txt'); + } + expect( + container.read(mediaBrowserProvider('second')).gridSize, + MediaGridSize.medium, + ); + expect(tester.takeException(), isNull); + }); + + testWidgets( + 'narrow toolbar preserves search space and exposes density in its menu', + (tester) async { + await tester.binding.setSurfaceSize(const Size(280, 600)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + final container = await mount(tester); + expect( + tester.getSize(find.byKey(const Key('media-panel-header'))).height, + 76, + ); + expect( + tester.getSize(find.byKey(const Key('media-search'))).width, + greaterThan(160), + ); + expect(find.byKey(const Key('media-sort-button')), findsNothing); + expect(find.byKey(const Key('media-size-button')), findsNothing); + await tester.tap(find.byKey(const Key('media-category-button'))); + await tester.pumpAndSettle(); + final size = find.byKey(const ValueKey('media-size-small')); + await tester.ensureVisible(size); + await tester.tap(size); + await tester.pumpAndSettle(); + expect( + container.read(mediaBrowserProvider('project')).gridSize, + MediaGridSize.small, + ); + expect(tester.takeException(), isNull); + }, + ); + + testWidgets( + 'view and density changes preserve the first visible asset before settling', + (tester) async { + await tester.binding.setSurfaceSize(const Size(720, 500)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + final container = await mount(tester); + await (container.read( + projectsProvider.notifier, + ) as _Projects).importExternalMedia('project', [ + for (var i = 0; i < 120; i++) ExternalMediaFile(path: '/asset-$i.txt'), + ]); + await tester.pumpAndSettle(); + await tester.drag(find.byType(GridView), const Offset(0, -650)); + await tester.pumpAndSettle(); + final browser = container.read(mediaBrowserProvider('project')); + final anchor = browser.viewportAnchor!; + expect(anchor.assetId, isNot('/asset-0.txt')); + browser.selectedAssetId = anchor.assetId; + browser.grid = false; + await tester.pump(); + final selected = find.byKey(ValueKey(anchor.assetId)); + final firstRect = tester.getRect(selected); + expect(firstRect.overlaps(tester.getRect(find.byType(ListView))), isTrue); + await tester.pumpAndSettle(); + expect(tester.getRect(selected), firstRect); + browser.grid = true; + browser.gridSize = MediaGridSize.large; + await tester.pump(); + final gridRect = tester.getRect(selected); + expect(gridRect.overlaps(tester.getRect(find.byType(GridView))), isTrue); + await tester.pumpAndSettle(); + expect(tester.getRect(selected), gridRect); + expect(browser.selectedAssetId, anchor.assetId); + await tester.binding.setSurfaceSize(const Size(560, 500)); + await tester.pump(); + final resized = tester.getRect(selected); + expect(resized.overlaps(tester.getRect(find.byType(GridView))), isTrue); + await tester.pumpAndSettle(); + expect(tester.getRect(selected), resized); + expect(tester.takeException(), isNull); + }, + ); + + testWidgets('empty search and panel remount retain the browse anchor', ( + tester, + ) async { + await tester.binding.setSurfaceSize(const Size(720, 500)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + final container = await mount(tester); + await (container.read( + projectsProvider.notifier, + ) as _Projects).importExternalMedia('project', [ + for (var i = 0; i < 120; i++) ExternalMediaFile(path: '/asset-$i.txt'), + ]); + await tester.pumpAndSettle(); + await tester.drag(find.byType(GridView), const Offset(0, -650)); + await tester.pumpAndSettle(); + final browser = container.read(mediaBrowserProvider('project')); + final anchor = browser.viewportAnchor!; + final tile = find.byKey(ValueKey(anchor.assetId)); + final original = tester.getRect(tile); + browser.query = 'no matching assets'; + await tester.pumpAndSettle(); + expect(find.byType(GridView), findsNothing); + browser.query = ''; + await tester.pump(); + expect(tester.getRect(tile), original); + await tester.pumpAndSettle(); + final root = tester.widget(find.byType(UncontrolledProviderScope)); + await tester.pumpWidget(const SizedBox()); + await tester.pumpWidget(root); + await tester.pump(); + expect(tester.getRect(tile), original); + expect(browser.viewportAnchor, anchor); + expect(tester.takeException(), isNull); + }); + + testWidgets('bottom browse position is clamped before the first frame', ( + tester, + ) async { + await tester.binding.setSurfaceSize(const Size(720, 500)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + final container = await mount(tester); + await (container.read( + projectsProvider.notifier, + ) as _Projects).importExternalMedia('project', [ + for (var i = 0; i < 121; i++) ExternalMediaFile(path: '/asset-$i.txt'), + ]); + await tester.pumpAndSettle(); + ScrollPosition position() => + tester.state(find.byType(Scrollable).last).position; + position().jumpTo(position().maxScrollExtent); + await tester.pump(); + final browser = container.read(mediaBrowserProvider('project')); + for (final size in [MediaGridSize.small, MediaGridSize.large]) { + final anchor = browser.viewportAnchor!; + browser.gridSize = size; + await tester.pump(); + final firstOffset = position().pixels; + expect(firstOffset, lessThanOrEqualTo(position().maxScrollExtent)); + await tester.pumpAndSettle(); + expect(position().pixels, firstOffset); + expect( + tester + .getRect(find.byKey(ValueKey(anchor.assetId))) + .overlaps(tester.getRect(find.byType(GridView))), + isTrue, + ); + position().jumpTo(position().maxScrollExtent); + await tester.pump(); + } + expect(tester.takeException(), isNull); + }); + + testWidgets('desktop density does not change touch-page geometry', ( + tester, + ) async { + final container = await mount(tester, touch: true); + await (container.read(projectsProvider.notifier) as _Projects) + .importExternalMedia('project', [ + const ExternalMediaFile(path: '/asset.txt'), + ]); + await tester.pumpAndSettle(); + final grid = tester.widget(find.byType(GridView)); + final delegate = + grid.gridDelegate as SliverGridDelegateWithFixedCrossAxisCount; + final element = tester.element(find.byType(GridView)); + final tileRect = tester.getRect(find.byKey(const ValueKey('/asset.txt'))); + container.read(mediaBrowserProvider('project')).gridSize = + MediaGridSize.large; + await tester.pump(); + final updated = tester.widget(find.byType(GridView)); + final updatedDelegate = + updated.gridDelegate as SliverGridDelegateWithFixedCrossAxisCount; + expect(tester.element(find.byType(GridView)), same(element)); + expect(updated.controller, same(grid.controller)); + expect(updatedDelegate.crossAxisCount, delegate.crossAxisCount); + expect(updatedDelegate.mainAxisExtent, delegate.mainAxisExtent); + expect(updatedDelegate.childAspectRatio, delegate.childAspectRatio); + expect(tester.getRect(find.byKey(const ValueKey('/asset.txt'))), tileRect); + expect(tester.takeException(), isNull); + }, variant: TargetPlatformVariant.only(TargetPlatform.android)); + testWidgets('native file event imports real paths without a success prompt', ( tester, ) async { final container = await mount(tester); + container.read(mediaBrowserProvider('project')).query = 'no match'; + await tester.pumpAndSettle(); final target = tester.getCenter(find.byType(NativeProjectDropRegion)); await platformEvent(tester, 'enter', [target.dx, target.dy]); expect(find.byKey(const Key('media-drop-highlight')), findsOneWidget); @@ -662,6 +1119,7 @@ void main() { '/originals/中文 视频.flv', ]); expect(find.text('video.mp4'), findsOneWidget); + expect(container.read(mediaBrowserProvider('project')).query, isEmpty); expect(find.text('中文 视频.RMVB'), findsOneWidget); expect(find.text('中文 视频.flv'), findsOneWidget); expect(find.byType(SnackBar), findsNothing); @@ -680,6 +1138,9 @@ void main() { ]); await tester.pumpAndSettle(); await tester.tap(find.text('second.wav')); + final browser = container.read(mediaBrowserProvider('project')); + browser.query = ' FIRST '; + await tester.pumpAndSettle(); await platformEvent(tester, 'enter', [0.0, 0.0]); await platformEvent(tester, 'drop', ['/originals/first.mp4']); await tester.pumpAndSettle(); @@ -691,6 +1152,7 @@ void main() { container.read(projectsProvider).requireValue.assets, hasLength(2), ); + expect(browser.query, ' FIRST '); expect( find.ancestor( of: find.text('first.mp4'), @@ -831,7 +1293,7 @@ void main() { const ExternalMediaFile(path: '/originals/bad.wav'), ]); await tester.pumpAndSettle(); - expect(find.byIcon(Icons.audio_file_outlined), findsOneWidget); + expect(find.byIcon(AppIcons.audioFile), findsOneWidget); final before = tester.getSize( find.byKey(const ValueKey('audio-cover-/originals/bad.wav')), ); @@ -966,6 +1428,8 @@ class _Projects extends Projects { ); @visibleForTesting List received = []; + @visibleForTesting + Future? importGate; @override Future build() async => const ProjectState( activeProject: RecentProject( @@ -994,6 +1458,7 @@ class _Projects extends Projects { List files, { bool Function()? isCancelled, }) async { + await importGate; received = files; final previous = state.requireValue.assets; final previousIds = {for (final asset in previous) asset.id}; diff --git a/test/name_dialog_test.dart b/test/name_dialog_test.dart index efe71ab..97b1272 100644 --- a/test/name_dialog_test.dart +++ b/test/name_dialog_test.dart @@ -1,11 +1,199 @@ +import 'dart:async'; + import 'package:cutdex/app/editor_theme.dart'; import 'package:cutdex/l10n/app_localizations.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex/features/projects/widgets/name_dialog.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { + testWidgets('name collision keeps the dialog open and allows correction', ( + tester, + ) async { + final validation = Completer(); + final submitted = []; + String? result; + await tester.pumpWidget( + MaterialApp( + theme: EditorTheme.penDark, + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + home: Scaffold( + body: Builder( + builder: (context) => TextButton( + onPressed: () async { + result = await askName( + context, + title: '新建项目', + label: '项目名称', + validateName: (name) async { + submitted.add(name); + return name == 'Existing' ? validation.future : null; + }, + ); + }, + child: const Text('Open'), + ), + ), + ), + ), + ); + await tester.tap(find.text('Open')); + await tester.pumpAndSettle(); + await tester.enterText(find.byType(TextFormField), 'Existing'); + await tester.tap(find.byType(FilledButton)); + await tester.pump(); + expect( + tester.widget(find.byType(FilledButton)).onPressed, + isNull, + ); + await tester.testTextInput.receiveAction(TextInputAction.done); + expect(submitted, ['Existing']); + + final error = lookupAppLocalizations(const Locale('zh')) + .projectAlreadyExists; + validation.complete(error); + await tester.pumpAndSettle(); + expect(find.text(error), findsOneWidget); + expect(find.byType(TextFormField), findsOneWidget); + expect( + tester.widget(find.byType(EditableText)).controller.text, + 'Existing', + ); + expect(result, isNull); + expect(tester.takeException(), isNull); + + await tester.enterText(find.byType(TextFormField), 'Another'); + await tester.pump(); + expect(find.text(error), findsNothing); + await tester.tap(find.byType(FilledButton)); + await tester.pumpAndSettle(); + expect(result, 'Another'); + expect(submitted, ['Existing', 'Another']); + expect(find.byType(TextFormField), findsNothing); + }); + + testWidgets('cancel during validation does not pop the underlying page', ( + tester, + ) async { + final validation = Completer(); + await tester.pumpWidget( + MaterialApp( + theme: EditorTheme.penDark, + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Builder( + builder: (context) => TextButton( + onPressed: () => askName( + context, + title: 'New project', + label: 'Name', + validateName: (_) => validation.future, + ), + child: const Text('Open'), + ), + ), + ), + ); + await tester.tap(find.text('Open')); + await tester.pumpAndSettle(); + await tester.enterText(find.byType(TextFormField), 'Name'); + await tester.tap(find.byType(FilledButton)); + await tester.pump(); + await tester.tap(find.text('Cancel')); + validation.complete(null); + await tester.pumpAndSettle(); + expect(find.text('Open'), findsOneWidget); + expect(find.byType(TextFormField), findsNothing); + expect(tester.takeException(), isNull); + }); + + testWidgets('rename hint, text line and caret share the vertical center', ( + tester, + ) async { + addTearDown(() => debugDefaultTargetPlatformOverride = null); + for (final platform in [TargetPlatform.macOS, TargetPlatform.windows]) { + debugDefaultTargetPlatformOverride = platform; + for (final brightness in Brightness.values) { + await tester.pumpWidget( + MaterialApp( + theme: EditorTheme.desktop( + EditorTheme.forPalette(AppPalette.graphite, brightness), + ), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + home: Scaffold( + body: Builder( + builder: (context) => TextButton( + onPressed: () => askName( + context, + title: '重命名', + label: '项目名称', + submitLabel: '重命名', + ), + child: const Text('Open'), + ), + ), + ), + ), + ); + await tester.tap(find.text('Open')); + await tester.pumpAndSettle(); + final field = find.byType(TextFormField); + final editable = find.byType(EditableText); + final input = tester.widget(editable); + final decoration = tester + .widget(find.byType(TextField)) + .decoration! + .applyDefaults( + Theme.of(tester.element(field)).inputDecorationTheme, + ); + expect(decoration.hintStyle!.fontSize, input.style.fontSize); + expect(decoration.hintStyle!.height, input.style.height); + final hint = tester.renderObject(find.text('项目名称')); + final hintBox = hint + .getBoxesForSelection( + const TextSelection(baseOffset: 0, extentOffset: 4), + ) + .first + .toRect(); + expect( + hint.localToGlobal(hintBox.center).dy, + closeTo(tester.getCenter(field).dy, 1), + ); + for (final text in ['', '剪辑项目', 'Cutdex project']) { + await tester.enterText(field, text); + await tester.pump(); + final render = tester + .state(editable) + .renderEditable; + final caret = render.getLocalRectForCaret( + TextPosition(offset: text.length), + ); + expect( + render.localToGlobal(caret.center).dy, + closeTo(tester.getCenter(field).dy, 1), + reason: '$platform / $brightness / "$text"', + ); + expect( + render.localToGlobal(render.size.center(Offset.zero)).dy, + closeTo(tester.getCenter(field).dy, 1), + ); + expect(tester.getSize(field).height, 36); + } + await tester.tap(find.text('取消')); + await tester.pumpAndSettle(); + await tester.pumpWidget(const SizedBox()); + } + } + debugDefaultTargetPlatformOverride = null; + }); + testWidgets('rename chat uses the same dialog and compact input', ( tester, ) async { diff --git a/test/palette_settings_test.dart b/test/palette_settings_test.dart new file mode 100644 index 0000000..2c83ed3 --- /dev/null +++ b/test/palette_settings_test.dart @@ -0,0 +1,113 @@ +import 'dart:io'; + +import 'package:cutdex/features/settings/appearance_settings.dart'; +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:drift/native.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sqlite3/sqlite3.dart'; + +import 'support/memory_app_settings.dart'; + +void main() { + test('palette survives provider recreation and failed saves', () async { + final repository = MemoryPaletteSettingsRepository(); + ProviderContainer container() => ProviderContainer( + overrides: [ + paletteSettingsRepositoryProvider.overrideWithValue(repository), + ], + ); + final first = container(); + addTearDown(first.dispose); + expect( + await first.read(paletteSettingsProvider.future), + AppPalette.graphite, + ); + await first + .read(paletteSettingsProvider.notifier) + .setPalette(AppPalette.teal); + final restored = container(); + addTearDown(restored.dispose); + expect( + await restored.read(paletteSettingsProvider.future), + AppPalette.teal, + ); + repository.failWrites = true; + await expectLater( + restored + .read(paletteSettingsProvider.notifier) + .setPalette(AppPalette.violet), + throwsStateError, + ); + expect( + restored.read(paletteSettingsProvider).requireValue, + AppPalette.teal, + ); + }); + + test('appearance and palette writes preserve each other', () async { + final database = AppDatabase(NativeDatabase.memory()); + addTearDown(database.close); + final appearance = DriftAppearanceSettingsRepository(database); + final palette = DriftPaletteSettingsRepository(database); + expect(await palette.load(), AppPalette.graphite); + await palette.save(AppPalette.teal); + expect(await appearance.load(), AppAppearance.system); + await appearance.save(AppAppearance.penDark); + expect(await palette.load(), AppPalette.teal); + await palette.save(AppPalette.violet); + expect(await appearance.load(), AppAppearance.penDark); + await Future.wait([ + appearance.save(AppAppearance.penLight), + palette.save(AppPalette.graphite), + ]); + expect(await appearance.load(), AppAppearance.penLight); + expect(await palette.load(), AppPalette.graphite); + await database.customStatement( + "UPDATE appearance_configurations SET palette = 'unknown'", + ); + expect(await palette.load(), AppPalette.graphite); + }); + + test('schema 2 upgrades without losing saved appearance', () async { + final directory = await Directory.systemTemp.createTemp('cutdex-palette-'); + addTearDown(() => directory.delete(recursive: true)); + final file = File('${directory.path}/app.sqlite'); + final initial = AppDatabase(NativeDatabase(file)); + await DriftAppearanceSettingsRepository(initial) + .save(AppAppearance.penDark); + await initial.close(); + final old = sqlite3.open(file.path); + try { + old.execute( + 'ALTER TABLE appearance_configurations DROP COLUMN timeline_ruler_layout', + ); + old.execute('ALTER TABLE appearance_configurations DROP COLUMN palette'); + old.userVersion = 2; + } finally { + old.close(); + } + final upgraded = AppDatabase(NativeDatabase(file)); + expect( + await DriftAppearanceSettingsRepository(upgraded).load(), + AppAppearance.penDark, + ); + expect( + await DriftPaletteSettingsRepository(upgraded).load(), + AppPalette.graphite, + ); + await DriftPaletteSettingsRepository(upgraded).save(AppPalette.violet); + await upgraded.close(); + final reopened = AppDatabase(NativeDatabase(file)); + addTearDown(reopened.close); + expect( + await DriftPaletteSettingsRepository(reopened).load(), + AppPalette.violet, + ); + expect( + await DriftAppearanceSettingsRepository(reopened).load(), + AppAppearance.penDark, + ); + }); +} diff --git a/test/palette_switch_test.dart b/test/palette_switch_test.dart new file mode 100644 index 0000000..f66c836 --- /dev/null +++ b/test/palette_switch_test.dart @@ -0,0 +1,104 @@ +import 'package:cutdex/app/app.dart'; +import 'package:cutdex/app/router/app_router.dart'; +import 'package:cutdex/features/settings/appearance_settings.dart'; +import 'package:cutdex/features/settings/settings_content.dart'; +import 'package:cutdex/integrations/agent/conversation_repository.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:go_router/go_router.dart'; + +import 'support/empty_conversation_repository.dart'; +import 'support/memory_app_settings.dart'; + +void main() { + testWidgets('settings switch all six themes and follow system appearance', ( + tester, + ) async { + tester.view.physicalSize = const Size(1200, 900); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + addTearDown(tester.platformDispatcher.clearPlatformBrightnessTestValue); + final appearance = MemoryAppearanceSettingsRepository(); + final palette = MemoryPaletteSettingsRepository(); + final router = GoRouter( + routes: [ + GoRoute( + path: '/', + builder: (_, _) => const Scaffold(body: SettingsContent()), + ), + ], + ); + addTearDown(router.dispose); + final scope = ProviderContainer( + overrides: [ + appRouterProvider.overrideWithValue(router), + appearanceSettingsRepositoryProvider.overrideWithValue(appearance), + paletteSettingsRepositoryProvider.overrideWithValue(palette), + conversationRepositoryProvider.overrideWith( + (ref) async => EmptyConversationRepository(), + ), + ], + ); + addTearDown(scope.dispose); + await tester.pumpWidget( + UncontrolledProviderScope(container: scope, child: const CutdexApp()), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const ValueKey('settings-navigation-3'))); + await tester.pumpAndSettle(); + final settings = tester.element(find.byType(SettingsContent)); + final select = find.byKey(const Key('settings-color-palette')); + expect(select, findsOneWidget); + for (final option in AppPalette.values) { + for (final mode in [AppAppearance.penLight, AppAppearance.penDark]) { + await scope.read(appearanceSettingsProvider.notifier).setMode(mode); + await tester.pumpAndSettle(); + await tester.tap(select); + await tester.pumpAndSettle(); + final field = tester.widget>(select); + final label = field.options + .singleWhere((item) => item.value == option) + .label; + final menuItem = find.widgetWithText(MenuItemButton, label); + await tester.tap(menuItem); + await tester.pumpAndSettle(); + expect(palette.value, option); + expect(appearance.value, mode); + expect(tester.element(find.byType(SettingsContent)), same(settings)); + final theme = Theme.of(settings); + expect(AppColors.of(theme).family, option); + expect( + theme.brightness, + mode == AppAppearance.penLight ? Brightness.light : Brightness.dark, + ); + expect( + theme.colorScheme.primary, + AppColors.forPalette(option, theme.brightness).primary, + ); + expect(tester.takeException(), isNull); + } + } + await scope + .read(appearanceSettingsProvider.notifier) + .setMode(AppAppearance.system); + for (final brightness in Brightness.values) { + tester.platformDispatcher.platformBrightnessTestValue = brightness; + await tester.pumpAndSettle(); + expect(Theme.of(settings).brightness, brightness); + expect(AppColors.of(Theme.of(settings)).family, AppPalette.teal); + expect(palette.value, AppPalette.teal); + } + for (final width in [800.0, 360.0]) { + tester.view.physicalSize = Size(width, 900); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('settings-color-palette')), findsOneWidget); + expect(tester.takeException(), isNull); + } + await tester.pumpWidget(const SizedBox()); + }); +} diff --git a/test/palette_theme_test.dart b/test/palette_theme_test.dart new file mode 100644 index 0000000..2db8491 --- /dev/null +++ b/test/palette_theme_test.dart @@ -0,0 +1,112 @@ +import 'dart:math' as math; + +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_sdk/timeline_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + test( + '${palette.name} ${brightness.name} shares semantic colors and readable text', + () { + final theme = EditorTheme.forPalette(palette, brightness); + final colors = theme.colorScheme; + final tokens = AppColors.of(theme); + expect(theme.brightness, brightness); + expect(tokens.family, palette); + final settings = AppTheme.settingsContentTheme(theme); + final dialog = AppTheme.dialogContentTheme(theme); + final inspector = AppTheme.propertiesPanelTheme(theme); + final actions = AppTheme.dialogActionTheme(theme); + final timeline = theme.extension()!; + expect( + settings.switchTheme.trackColor!.resolve({WidgetState.selected}), + colors.primary, + ); + expect( + (dialog.inputDecorationTheme.focusedBorder as OutlineInputBorder) + .borderSide + .color, + colors.primary, + ); + expect(timeline.selectionOutlineColor, colors.primary); + expect( + (inspector.inputDecorationTheme.focusedBorder as OutlineInputBorder) + .borderSide + .color, + colors.primary, + ); + for (final style in [ + theme.filledButtonTheme.style!, + settings.filledButtonTheme.style!, + actions.filledButtonTheme.style!, + ]) { + final background = style.backgroundColor!.resolve({})!; + final foreground = style.foregroundColor!.resolve({})!; + expect(background, colors.primary); + expect( + _contrast(foreground, background), + greaterThanOrEqualTo(4.5), + ); + } + expect(timeline.backgroundColor, colors.surface); + expect(settings.colorScheme.surfaceContainer, tokens.card); + expect(settings.inputDecorationTheme.fillColor, tokens.card); + expect(inspector.inputDecorationTheme.fillColor, tokens.card); + expect(AppColors.of(settings), tokens); + expect( + theme.extension()!.previewBackground, + Colors.black, + ); + for (final surface in [ + colors.surface, + colors.surfaceContainerLow, + colors.surfaceContainer, + timeline.visualClipColor, + timeline.audioClipColor, + ]) { + expect( + _contrast(colors.onSurface, surface), + greaterThanOrEqualTo(4.5), + ); + } + for (final surface in [ + colors.surface, + colors.surfaceContainerLow, + colors.surfaceContainer, + ]) { + expect( + _contrast(colors.onSurfaceVariant, surface), + greaterThanOrEqualTo(4.5), + ); + } + expect( + _contrast(colors.onPrimary, colors.primary), + greaterThanOrEqualTo(4.5), + ); + }, + ); + } + } + + test('six theme combinations have distinct workspace colors', () { + final signatures = { + for (final palette in AppPalette.values) + for (final brightness in Brightness.values) + ( + EditorTheme.forPalette(palette, brightness).colorScheme.surface, + EditorTheme.forPalette(palette, brightness).colorScheme.primary, + ), + }; + expect(signatures.length, 6); + }); +} + +double _contrast(Color a, Color b) { + final first = a.computeLuminance(); + final second = b.computeLuminance(); + return (math.max(first, second) + .05) / (math.min(first, second) + .05); +} diff --git a/test/picture_keyframes_test.dart b/test/picture_keyframes_test.dart index 3142f84..70404ea 100644 --- a/test/picture_keyframes_test.dart +++ b/test/picture_keyframes_test.dart @@ -5,6 +5,7 @@ import 'package:cutdex/features/preview/preview_panel.dart'; import 'package:cutdex/features/properties/picture_properties.dart'; import 'package:cutdex_sdk/timeline/model.dart'; import 'package:flutter/material.dart'; +import 'package:cutdex_ui/theme.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -44,12 +45,14 @@ void main() { supportedLocales: AppLocalizations.supportedLocales, locale: const Locale('zh'), - theme: EditorTheme.penLight, + theme: AppTheme.propertiesPanelTheme( + EditorTheme.desktop(EditorTheme.penLight), + ), home: Scaffold( body: Align( alignment: Alignment.topLeft, child: SizedBox( - width: 225, + width: 280, child: SingleChildScrollView( child: PictureProperties( projectId: project, diff --git a/test/preview_panel_test.dart b/test/preview_panel_test.dart index 4430e2b..960fe8d 100644 --- a/test/preview_panel_test.dart +++ b/test/preview_panel_test.dart @@ -1,4 +1,5 @@ import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/widgets.dart'; import 'package:cutdex/workspace/timeline_provider.dart'; import 'package:cutdex/l10n/app_localizations.dart'; @@ -85,7 +86,7 @@ void main() { ); await tester.pumpAndSettle(); expect(find.text('素材缺失'), findsOneWidget); - expect(find.byIcon(Icons.broken_image_outlined), findsOneWidget); + expect(find.byIcon(AppIcons.imageUnavailable), findsOneWidget); expect(find.textContaining('RuntimeException'), findsNothing); expect(tester.widget(playButton).onPressed, isNull); expect(find.byTooltip('画布比例'), findsNothing); @@ -451,7 +452,7 @@ void main() { await preview.togglePlayback(); await tester.pump(); - expect(find.byIcon(Icons.pause), findsOneWidget); + expect(find.byIcon(AppIcons.pause), findsOneWidget); expect(tester.widget(toolbar), same(toolbarBefore)); expect( tester.widget(find.byType(PreviewCanvas)), diff --git a/test/project_entry_test.dart b/test/project_entry_test.dart index 2200971..2f158d8 100644 --- a/test/project_entry_test.dart +++ b/test/project_entry_test.dart @@ -23,8 +23,8 @@ import 'package:cutdex/workspace/projects.dart'; import 'package:cutdex/workspace/timeline_provider.dart'; import 'package:cutdex/workspace/project_state.dart'; import 'package:cutdex/workspace/persistence/recent_projects.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/gestures.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -534,19 +534,16 @@ void main() { ), ); await tester.pumpAndSettle(); - final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); - await mouse.addPointer(location: Offset.zero); - await mouse.moveTo( - tester.getCenter(find.byKey(const Key('projects-heading'))), - ); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); await tester.pumpAndSettle(); - await tester.tap(find.byKey(const Key('create-project'))); - await mouse.removePointer(); + await tester.tap(find.text('新建项目')); await tester.pumpAndSettle(); - expect(find.text('新建项目'), findsOneWidget); + expect(find.byType(TextFormField), findsOneWidget); await tester.tap(find.text('取消')); await tester.pumpAndSettle(); - await tester.tap(find.byKey(const ValueKey('sidebar-project-empty'))); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const ValueKey('project-menu-empty'))); await tester.pumpAndSettle(); expect(router.routeInformationProvider.value.uri.path, '/'); expect(find.text('项目中还没有时间线'), findsOneWidget); @@ -564,60 +561,50 @@ void main() { }, ); - testWidgets('missing recent project stays visible and is dimmed', ( - tester, - ) async { - tester.platformDispatcher.localesTestValue = const [Locale('zh')]; - addTearDown(tester.platformDispatcher.clearLocalesTestValue); - final container = ProviderContainer( - overrides: [ - deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), - conversationRepositoryProvider.overrideWith( - (ref) async => EmptyConversationRepository(), - ), + testWidgets( + 'missing recent project is marked unavailable in the project menu', + (tester) async { + tester.platformDispatcher.localesTestValue = const [Locale('zh')]; + addTearDown(tester.platformDispatcher.clearLocalesTestValue); + final container = ProviderContainer( + overrides: [ + deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), + conversationRepositoryProvider.overrideWith( + (ref) async => EmptyConversationRepository(), + ), - projectsProvider.overrideWith(_MissingProjects.new), - workspaceViewSettingsRepositoryProvider.overrideWithValue( - _ExpandedMissingProjectSettings(), + projectsProvider.overrideWith(_MissingProjects.new), + workspaceViewSettingsRepositoryProvider.overrideWithValue( + _ExpandedMissingProjectSettings(), + ), + ], + ); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: MaterialApp.router( + builder: (context, child) => ErrorNotificationHost(child: child!), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + theme: EditorTheme.penDark, + routerConfig: container.read(appRouterProvider), + ), ), - ], - ); - await tester.pumpWidget( - UncontrolledProviderScope( - container: container, - child: MaterialApp.router( - builder: (context, child) => ErrorNotificationHost(child: child!), - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - locale: const Locale('zh'), - theme: EditorTheme.penDark, - routerConfig: container.read(appRouterProvider), - ), - ), - ); - await tester.pumpAndSettle(); - final tile = tester.widget( - find.byKey(const ValueKey('sidebar-project-missing')), - ); - expect(tile.enabled, isTrue); - expect(tile.textColor, EditorTheme.penDark.disabledColor); - expect( - find.descendant( - of: find.byKey(const ValueKey('sidebar-project-missing')), - matching: find.byIcon(Icons.folder_off_outlined), - ), - findsOneWidget, - ); - expect( - find.descendant( - of: find.byKey(const ValueKey('sidebar-project-missing')), - matching: find.text('项目不可用'), - ), - findsOneWidget, - ); - await tester.pumpWidget(const SizedBox()); - container.dispose(); - }); + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + expect( + find.byKey(const ValueKey('project-menu-missing')), + findsOneWidget, + ); + expect(find.byIcon(AppIcons.folderUnavailable), findsOneWidget); + expect(find.textContaining('项目不可用'), findsOneWidget); + await tester.pumpWidget(const SizedBox()); + container.dispose(); + }, + ); testWidgets('project errors use a dismissible floating toast', ( tester, @@ -651,10 +638,10 @@ void main() { ), ); await tester.pumpAndSettle(); - expect(find.byIcon(Icons.error_outline), findsOneWidget); + expect(find.byIcon(AppIcons.error), findsOneWidget); expect(find.text('操作失败,请重试'), findsOneWidget); - expect(tester.getTopRight(find.byIcon(Icons.close)).dx, lessThan(1200)); - await tester.tap(find.byIcon(Icons.close)); + expect(tester.getTopRight(find.byIcon(AppIcons.close)).dx, lessThan(1200)); + await tester.tap(find.byIcon(AppIcons.close)); await tester.pump(const Duration(milliseconds: 200)); expect(find.byKey(const Key('global-error-notification')), findsNothing); await tester.pumpWidget(const SizedBox()); diff --git a/test/project_properties_test.dart b/test/project_properties_test.dart index 0282fb0..bcc243d 100644 --- a/test/project_properties_test.dart +++ b/test/project_properties_test.dart @@ -1,4 +1,7 @@ import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/properties/project_properties.dart'; +import 'package:cutdex/features/properties/project_property_row.dart'; +import 'package:cutdex_ui/theme.dart'; import 'dart:async'; @@ -16,6 +19,152 @@ import 'package:flutter_test/flutter_test.dart'; import 'support/preview_fixture.dart'; void main() { + testWidgets('desktop project values share a right edge across labels', ( + tester, + ) async { + final f = (await tester.runAsync( + () => + createPreviewFixture(Uri.file('/test/photo.png'), mediaType: 'image'), + ))!; + addTearDown( + () => tester.runAsync(() async { + await f.workspace.close(); + await f.directory.delete(recursive: true); + }), + ); + for (final locale in ['en', 'zh', 'de']) { + for (final width in [220.0, 260.0, 320.0]) { + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: Locale(locale), + theme: EditorTheme.desktop(EditorTheme.penLight), + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + height: 600, + child: ProjectProperties(session: f.timeline), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final panelRight = tester.getRect(find.byType(ProjectProperties)).right; + expect( + tester + .getSize(find.byKey(const ValueKey('project-settings-edit'))) + .height, + 28, + ); + final rows = find.byWidgetPredicate( + (widget) => widget.runtimeType.toString() == '_Info', + ); + expect(rows, findsNWidgets(7)); + for (var i = 0; i < 7; i++) { + final label = find + .descendant(of: rows.at(i), matching: find.byType(Text)) + .first; + final value = find + .descendant(of: rows.at(i), matching: find.byType(Text)) + .last; + expect(tester.widget(value).textAlign, TextAlign.right); + expect( + tester.getTopLeft(label).dy, + closeTo(tester.getTopLeft(value).dy, .01), + ); + expect(tester.getRect(label).left, AppInspectorMetrics.padding); + expect( + find.descendant( + of: rows.at(i), + matching: find.byType(ProjectPropertyRow), + ), + findsOneWidget, + ); + expect( + tester.getRect(value).right, + panelRight - AppInspectorMetrics.padding, + reason: '$locale at $width: ${tester.widget(value).data}', + ); + } + expect(tester.takeException(), isNull); + } + } + await tester.pumpWidget(const SizedBox()); + }); + + testWidgets( + 'long desktop project metadata fits narrow panels in every theme', + (tester) async { + const name = '海边日落与城市漫游 · 旅行短片的最终版本 / Very long sequence name'; + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + for (final width in [220.0, 280.0, 320.0]) { + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(palette, brightness), + ), + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + child: const MediaQuery( + data: MediaQueryData( + textScaler: TextScaler.linear(1.3), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ProjectPropertyRow(label: '时间线名称', value: name), + ProjectPropertyRow( + label: '项目色彩空间', + value: 'HDR · Rec.2020 HLG', + ), + ProjectPropertyRow( + label: '画布大小', + value: '3840 × 2160 px', + ), + ], + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect(tester.takeException(), isNull); + for (final row in find.byType(ProjectPropertyRow).evaluate()) { + final texts = find.descendant( + of: find.byWidget(row.widget), + matching: find.byType(Text), + ); + expect(tester.getRect(texts.first).left, 12); + expect(tester.getRect(texts.last).right, width - 12); + expect( + tester.getTopLeft(texts.first).dy, + closeTo(tester.getTopLeft(texts.last).dy, .01), + ); + } + } + } + } + final tooltip = find.ancestor( + of: find.text(name), + matching: find.byType(Tooltip), + ); + tester.state(tooltip).ensureTooltipVisible(); + await tester.pumpAndSettle(); + expect(find.text(name), findsNWidgets(2)); + await tester.pumpWidget(const SizedBox()); + }, + ); + testWidgets('timeline switch does not expose the previous session', ( tester, ) async { diff --git a/test/project_property_binding_test.dart b/test/project_property_binding_test.dart new file mode 100644 index 0000000..4a505c7 --- /dev/null +++ b/test/project_property_binding_test.dart @@ -0,0 +1,61 @@ +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/properties/project_properties.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex_sdk/editor.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'support/preview_fixture.dart'; + +void main() { + testWidgets( + 'canvas edits refresh values while preserving property shell and labels', + (tester) async { + final fixture = (await tester.runAsync( + () => + createPreviewFixture(Uri.file('/fixture.png'), mediaType: 'image'), + ))!; + addTearDown( + () => tester.runAsync(() async { + await fixture.workspace.close(); + await fixture.directory.delete(recursive: true); + }), + ); + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + theme: EditorTheme.penDark, + home: Scaffold( + body: SizedBox( + width: 280, + child: ProjectProperties(session: fixture.timeline), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final label = tester.element(find.text('画布尺寸')); + final value = tester.element(find.text('1080 × 1920 px')); + final previous = debugOnRebuildDirtyWidget; + var shellBuilds = 0; + var labelBuilds = 0; + debugOnRebuildDirtyWidget = (element, built) { + previous?.call(element, built); + if (element.widget is ProjectProperties) shellBuilds++; + if (identical(element, label)) labelBuilds++; + }; + addTearDown(() => debugOnRebuildDirtyWidget = previous); + fixture.timeline.commands.setCanvas(ProjectCanvas.widescreen); + await tester.pumpAndSettle(); + expect(find.text('1920 × 1080 px'), findsOneWidget); + expect(tester.element(find.text('1920 × 1080 px')), same(value)); + expect(shellBuilds, 0); + expect(labelBuilds, 0); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + await tester.runAsync(fixture.timeline.flush); + }, + ); +} diff --git a/test/project_switch_presentation_test.dart b/test/project_switch_presentation_test.dart new file mode 100644 index 0000000..744ad35 --- /dev/null +++ b/test/project_switch_presentation_test.dart @@ -0,0 +1,249 @@ +import 'dart:async'; + +import 'package:cutdex/app/app.dart'; +import 'package:cutdex/features/editor/editor_panel_defaults.dart'; +import 'package:cutdex/features/preview/preview_panel.dart'; +import 'package:cutdex/features/properties/project_properties.dart'; +import 'package:cutdex/integrations/agent/conversation_repository.dart'; +import 'package:cutdex/integrations/platform/device_experience.dart'; +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex/workspace/media_availability.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/timeline_provider.dart'; +import 'package:cutdex/workspace/view_settings.dart'; +import 'package:cutdex/workspace/workspace_navigation.dart'; +import 'package:cutdex_sdk/project.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:drift/native.dart'; + +import 'support/empty_conversation_repository.dart'; +import 'support/memory_app_settings.dart'; +import 'support/preview_fixture.dart'; + +void main() { + testWidgets( + 'project navigation retains panels and rebinds only prepared values', + (tester) async { + tester.view.physicalSize = const Size(1800, 900); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + final first = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/first.png'), + mediaType: 'image', + ), + ))!; + final second = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/second.png'), + mediaType: 'image', + renderSize: {'width': 1920, 'height': 1080}, + ), + ))!; + final projects = _DelayedProjects(); + final database = AppDatabase(NativeDatabase.memory()); + final container = ProviderContainer( + overrides: [ + deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), + appDatabaseProvider.overrideWithValue(database), + appearanceSettingsRepositoryProvider.overrideWithValue( + MemoryAppearanceSettingsRepository(), + ), + paletteSettingsRepositoryProvider.overrideWithValue( + MemoryPaletteSettingsRepository(), + ), + projectsProvider.overrideWith(() => projects), + conversationRepositoryProvider.overrideWith( + (ref) async => EmptyConversationRepository(), + ), + editorTimelineProvider( + 'project', + 'first', + ).overrideWith((ref) => first.timeline), + editorTimelineProvider( + 'other', + 'second', + ).overrideWith((ref) => second.timeline), + editorPreviewProvider.overrideWith((ref, ids) => null), + mediaAvailabilityProvider.overrideWith( + (ref, ids) async => MediaAvailability.missing, + ), + ], + ); + addTearDown(() async { + await tester.pumpWidget(const SizedBox()); + container.dispose(); + await tester.runAsync(() async { + await first.workspace.close(); + await second.workspace.close(); + await first.directory.delete(recursive: true); + await second.directory.delete(recursive: true); + await database.close(); + }); + }); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: const CutdexApp(), + ), + ); + await tester.pumpAndSettle(); + await tester.runAsync(() async { + for (final id in ['project', 'other']) { + await container.read(projectViewSettingsProvider(id).future); + container + .read(projectViewSettingsProvider(id).notifier) + .setPropertiesOpen(true); + } + }); + await tester.pumpAndSettle(); + final properties = tester.element(find.byType(ProjectProperties)); + final preview = tester.element(find.byType(EditorPreviewPanel)); + final timeline = tester.element( + find.byKey(const Key('editor-timeline-surface')), + ); + final propertyRect = tester.getRect(find.byType(ProjectProperties)); + final canvasValue = tester.element(find.text('1080 × 1920 px')); + for (final success in [false, true]) { + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const ValueKey('project-menu-other'))); + await tester.pump(); + await tester.pump(); + expect( + container.read(workspaceNavigationProvider).selectedProjectId, + 'other', + ); + final tab = find.byKey(const ValueKey('project-tab-other')); + expect(tab, findsOneWidget); + expect(tester.widget(tab).onPressed, isNotNull); + expect( + tester + .widgetList( + find.ancestor(of: tab, matching: find.byType(Semantics)), + ) + .any((widget) => widget.properties.selected == true), + isTrue, + ); + expect( + find.descendant( + of: find.byKey(const Key('window-project-tabs')), + matching: find.byType(CircularProgressIndicator), + ), + findsNothing, + ); + await tester.pump(const Duration(seconds: 2)); + expect( + tester.element(find.byType(ProjectProperties)), + same(properties), + ); + expect(tester.element(find.byType(EditorPreviewPanel)), same(preview)); + expect( + tester.element(find.byKey(const Key('editor-timeline-surface'))), + same(timeline), + ); + expect(tester.getRect(find.byType(ProjectProperties)), propertyRect); + expect(find.byType(EditorEmptyPanel), findsNothing); + expect(find.byKey(const Key('properties-pending')), findsNothing); + expect(find.byKey(const Key('timeline-default-tracks')), findsNothing); + expect(find.text('1080 × 1920 px'), findsOneWidget); + await tester.tap( + find.byKey(const ValueKey('project-settings-edit')), + warnIfMissed: false, + ); + await tester.pump(); + expect(find.byKey(const ValueKey('project-width')), findsNothing); + projects.finish(success); + await tester.pumpAndSettle(); + expect( + container.read(workspaceNavigationProvider).selectedProjectId, + isNull, + ); + expect( + projects.state.requireValue.activeProject?.id, + success ? 'other' : 'project', + ); + expect( + find.byKey(const ValueKey('project-tab-other')), + success ? findsOneWidget : findsNothing, + ); + expect( + tester.element(find.byType(ProjectProperties)), + same(properties), + ); + expect(tester.getRect(find.byType(ProjectProperties)), propertyRect); + expect(tester.element(find.byType(EditorPreviewPanel)), same(preview)); + expect( + find.text(success ? '1920 × 1080 px' : '1080 × 1920 px'), + findsOneWidget, + ); + expect( + tester.element( + find.text(success ? '1920 × 1080 px' : '1080 × 1920 px'), + ), + same(canvasValue), + ); + expect(tester.takeException(), isNull); + } + await tester.tap(find.byKey(const ValueKey('project-settings-edit'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-width')), findsOneWidget); + }, + ); +} + +class _DelayedProjects extends Projects { + Completer? _pending; + static const recent = [ + RecentProject( + id: 'project', + name: 'First project', + path: '/test/First.cutdex', + ), + RecentProject( + id: 'other', + name: 'Second project', + path: '/test/Second.cutdex', + ), + ]; + TimelineDocument _document(String id) => + TimelineDocument(id: id, name: id, sequences: []); + @override + Future build() async => ProjectState( + activeProject: recent.first, + recent: recent, + timelines: const [TimelineSummary(id: 'first', name: 'First', revision: 1)], + timeline: _document('first'), + ); + @override + Future open( + String directory, { + String? name, + String? expectedId, + String? timelineId, + String? initialTimelineName, + bool Function()? isCurrent, + }) async { + _pending = Completer(); + state = AsyncData(state.requireValue.copyWith(projectBusy: true)); + final success = await _pending!.future && (isCurrent?.call() ?? true); + state = AsyncData( + state.requireValue.copyWith( + projectBusy: false, + activeProject: success ? recent.last : state.requireValue.activeProject, + timelines: success + ? const [TimelineSummary(id: 'second', name: 'Second', revision: 1)] + : state.requireValue.timelines, + timeline: success ? _document('second') : state.requireValue.timeline, + ), + ); + return success; + } + + void finish(bool success) => _pending!.complete(success); +} diff --git a/test/project_switch_region_test.dart b/test/project_switch_region_test.dart index 12959d6..6261730 100644 --- a/test/project_switch_region_test.dart +++ b/test/project_switch_region_test.dart @@ -7,55 +7,37 @@ void main() { textDirection: TextDirection.ltr, child: ProjectSwitchRegion( pendingProjectId: pending, - builder: (context, showDefaults) => - Text(showDefaults ? 'defaults' : 'content'), + child: const Text('content'), ), ); - testWidgets( - 'fast completion never displays defaults or waits for the timer', - (tester) async { - await tester.pumpWidget(region('A')); - expect(find.text('content'), findsOneWidget); + testWidgets('slow and superseded switches retain mounted content', ( + tester, + ) async { + await tester.pumpWidget(region(null)); + final content = tester.element(find.text('content')); + for (final target in ['A', 'B', null]) { + await tester.pumpWidget(region(target)); + await tester.pump(const Duration(seconds: 5)); + expect(tester.element(find.text('content')), same(content)); expect( tester.widget(find.byType(IgnorePointer)).ignoring, - isTrue, + target != null, ); - await tester.pump(const Duration(milliseconds: 100)); - await tester.pumpWidget(region(null)); - expect(find.text('defaults'), findsNothing); expect( - tester.widget(find.byType(IgnorePointer)).ignoring, - isFalse, + tester.widget(find.byType(ExcludeFocus)).excluding, + target != null, ); - await tester.pump(const Duration(milliseconds: 200)); - expect(find.text('defaults'), findsNothing); - }, - ); + expect(tester.takeException(), isNull); + } + }); - testWidgets( - 'slow switches show defaults after 150ms and reset on a new target', - (tester) async { - await tester.pumpWidget(region('A')); - await tester.pump(const Duration(milliseconds: 149)); - expect(find.text('defaults'), findsNothing); - await tester.pump(const Duration(milliseconds: 1)); - expect(find.text('defaults'), findsOneWidget); - await tester.pumpWidget(region('B')); - expect(find.text('defaults'), findsNothing); - await tester.pump(const Duration(milliseconds: 150)); - expect(find.text('defaults'), findsOneWidget); - await tester.pumpWidget(region(null)); - expect(find.text('content'), findsOneWidget); - }, - ); - - testWidgets('disposing during a switch cancels the pending timer', ( + testWidgets('disposing during preparation leaves no pending work', ( tester, ) async { await tester.pumpWidget(region('A')); await tester.pumpWidget(const SizedBox()); - await tester.pump(const Duration(milliseconds: 200)); + await tester.pump(const Duration(seconds: 5)); expect(tester.takeException(), isNull); }); } diff --git a/test/project_tabs_bar_test.dart b/test/project_tabs_bar_test.dart new file mode 100644 index 0000000..a1cfd66 --- /dev/null +++ b/test/project_tabs_bar_test.dart @@ -0,0 +1,521 @@ +import 'package:cutdex/features/projects/project_tabs_bar.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_native/cutdex_native.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + const recent = [ + RecentProject(id: 'a', name: '旅行短片', path: '/Projects/A.cutdex'), + RecentProject( + id: 'b', + name: '这是一个很长的中文项目名称用于验证窗口标签不会溢出', + path: '/Projects/B.cutdex', + ), + RecentProject(id: 'c', name: '尚未打开的项目', path: '/Projects/C.cutdex'), + ]; + Future pumpTabs( + WidgetTester tester, { + required Widget tabs, + double width = 720, + }) => tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(AppPalette.graphite, Brightness.dark), + ), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: SizedBox(width: width, height: 44, child: tabs), + ), + ), + ); + + testWidgets( + 'plus follows the last tab while the menu leaves empty drag space', + (tester) async { + var created = 0; + for (final opened in [recent.take(2).toList(), []]) { + await pumpTabs( + tester, + tabs: ProjectTabsBar( + projects: opened, + recent: recent, + selectedId: opened.firstOrNull?.id, + onSelect: (_) {}, + onClose: (_) {}, + onCreate: () => created++, + onOpen: () {}, + onRename: (_) {}, + ), + ); + await tester.pumpAndSettle(); + final entry = tester.getRect( + find.byKey(const Key('project-tabs-projects')), + ); + final plus = tester.getRect(find.byKey(const Key('project-tabs-add'))); + final list = tester.getRect(find.byKey(const Key('project-tabs-list'))); + expect(entry.left, 4); + expect(list.right, 716); + if (opened.isNotEmpty) { + final last = tester.getRect( + find.byKey(ValueKey('project-tab-surface-${opened.last.id}')), + ); + expect(plus.left - last.right, 4); + } else { + expect(plus.left - entry.right, 4); + } + final dragPoint = Offset((plus.right + list.left) / 2, 22); + expect(list.left - plus.right, greaterThan(100)); + expect( + find + .byType(HeaderControlRegion) + .evaluate() + .any( + (element) => tester + .getRect(find.byWidget(element.widget)) + .contains(dragPoint), + ), + isFalse, + ); + await tester.tap(find.byKey(const Key('project-tabs-add'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-menu-a')), findsNothing); + expect(tester.takeException(), isNull); + } + expect(created, 2); + }, + ); + + testWidgets('header menus do not swallow tab, create or other menu clicks', ( + tester, + ) async { + final selected = []; + var created = 0; + await pumpTabs( + tester, + tabs: ProjectTabsBar( + projects: recent.take(2).toList(), + recent: recent, + selectedId: 'a', + onSelect: (project) => selected.add(project.id), + onClose: (_) {}, + onCreate: () => created++, + onOpen: () {}, + onRename: (_) {}, + ), + ); + await tester.pumpAndSettle(); + final projects = find.byKey(const Key('project-tabs-projects')); + final list = find.byKey(const Key('project-tabs-list')); + Future click(Finder target) async { + await tester.tap(target, kind: PointerDeviceKind.mouse); + await tester.pumpAndSettle(); + } + + await click(projects); + expect(find.byKey(const ValueKey('project-menu-a')), findsOneWidget); + await click(find.byKey(const ValueKey('project-tab-b'))); + expect(selected, ['b']); + expect(find.byKey(const ValueKey('project-menu-a')), findsNothing); + + await click(projects); + await click(find.byKey(const Key('project-tabs-add'))); + expect(created, 1); + expect(find.byKey(const ValueKey('project-menu-a')), findsNothing); + + await click(projects); + await click(list); + expect(find.byKey(const ValueKey('project-menu-a')), findsNothing); + expect(find.byKey(const ValueKey('project-tabs-menu-a')), findsOneWidget); + await click(projects); + expect(find.byKey(const ValueKey('project-tabs-menu-a')), findsNothing); + expect(find.byKey(const ValueKey('project-menu-a')), findsOneWidget); + await click(projects); + expect(find.byKey(const ValueKey('project-menu-a')), findsNothing); + expect(tester.takeException(), isNull); + }); + + testWidgets('recent menu manages records without closing opened tabs', ( + tester, + ) async { + var history = recent.toList(); + final renamed = []; + final closed = []; + await pumpTabs( + tester, + tabs: StatefulBuilder( + builder: (context, setState) => ProjectTabsBar( + projects: recent.take(2).toList(), + recent: history, + selectedId: 'a', + onSelect: (_) {}, + onClose: (project) => closed.add(project.id), + onCreate: () {}, + onOpen: () {}, + onRename: (project) => renamed.add(project.id), + onRemoveRecent: (project) => setState(() { + history = history.where((item) => item.id != project.id).toList(); + }), + ), + ), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap( + find.byKey(const ValueKey('project-menu-b')), + buttons: kSecondaryMouseButton, + ); + await tester.pumpAndSettle(); + await tester.tap(find.text('重命名')); + await tester.pumpAndSettle(); + expect(renamed, ['b']); + // Reopen the recent menu if the context action dismissed it. + if (find.byKey(const ValueKey('project-menu-b')).evaluate().isEmpty) { + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + } + await tester.tap( + find.byKey(const ValueKey('project-menu-b')), + buttons: kSecondaryMouseButton, + ); + await tester.pumpAndSettle(); + await tester.tap(find.text('从最近项目移除')); + await tester.pumpAndSettle(); + expect(history.map((item) => item.id), ['a', 'c']); + expect(find.byKey(const ValueKey('project-tab-b')), findsOneWidget); + expect(closed, isEmpty); + expect(tester.takeException(), isNull); + }); + + testWidgets( + 'hover and keyboard focus reveal close without moving the label', + (tester) async { + var closed = 0; + await pumpTabs( + tester, + tabs: ProjectTabsBar( + projects: recent.take(2).toList(), + recent: recent, + selectedId: 'a', + onSelect: (_) {}, + onClose: (_) => closed++, + onCreate: () {}, + onOpen: () {}, + onRename: (_) {}, + ), + ); + await tester.pumpAndSettle(); + final close = find.byKey(const ValueKey('project-tab-close-b')); + final label = find.text(recent[1].name); + final surface = find.byKey(const ValueKey('project-tab-surface-b')); + final labelBefore = tester.getRect(label); + final surfaceBefore = tester.getRect(surface); + double opacity() => tester + .widget( + find.ancestor(of: close, matching: find.byType(Opacity)).first, + ) + .opacity; + expect(opacity(), 0); + await tester.tap(close, warnIfMissed: false); + expect(closed, 0); + final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); + await mouse.addPointer(location: const Offset(700, 80)); + await mouse.moveTo(tester.getCenter(label)); + await tester.pumpAndSettle(); + expect(opacity(), 1); + expect(tester.getRect(label), labelBefore); + expect(tester.getRect(surface), surfaceBefore); + await mouse.moveTo(const Offset(700, 80)); + await tester.pumpAndSettle(); + expect(opacity(), 0); + Focus.of(tester.element(label)).requestFocus(); + await tester.pumpAndSettle(); + expect(opacity(), 1); + expect(tester.getRect(label), labelBefore); + await tester.tap(close); + expect(closed, 1); + await mouse.removePointer(); + expect(tester.takeException(), isNull); + }, + ); + + testWidgets( + 'opened project menu reveals a clipped tab and excludes recent files', + (tester) async { + var selected = 'a'; + await pumpTabs( + tester, + width: 240, + tabs: StatefulBuilder( + builder: (context, setState) => ProjectTabsBar( + projects: recent.take(2).toList(), + recent: recent, + selectedId: selected, + onSelect: (project) => setState(() => selected = project.id), + onClose: (_) {}, + onCreate: () {}, + onOpen: () {}, + onRename: (_) {}, + ), + ), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('project-tabs-list'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-tabs-menu-a')), findsOneWidget); + expect(find.byKey(const ValueKey('project-tabs-menu-b')), findsOneWidget); + expect(find.byKey(const ValueKey('project-tabs-menu-c')), findsNothing); + await tester.tap(find.byKey(const ValueKey('project-tabs-menu-b'))); + await tester.pumpAndSettle(); + expect(selected, 'b'); + final tab = tester.getRect( + find.byKey(const ValueKey('project-tab-surface-b')), + ); + expect(tab.left, greaterThanOrEqualTo(36)); + expect( + tab.right, + lessThanOrEqualTo( + tester.getRect(find.byKey(const Key('project-tabs-list'))).left - + AppProjectTabMetrics.gap, + ), + ); + final plus = tester.getRect(find.byKey(const Key('project-tabs-add'))); + expect(plus.left - tab.right, AppProjectTabMetrics.gap); + expect( + plus.right, + lessThanOrEqualTo( + tester.getRect(find.byKey(const Key('project-tabs-list'))).left - + AppProjectTabMetrics.gap, + ), + ); + await tester.tap(find.byKey(const ValueKey('project-tab-b'))); + expect(tester.takeException(), isNull); + }, + ); + + testWidgets('selection keeps geometry and navigation controls available', ( + tester, + ) async { + var selected = 'a'; + late StateSetter update; + await pumpTabs( + tester, + tabs: StatefulBuilder( + builder: (context, setState) { + update = setState; + return ProjectTabsBar( + projects: recent.take(2).toList(), + recent: recent, + selectedId: selected, + onSelect: (project) => setState(() => selected = project.id), + onClose: (_) {}, + onCreate: () {}, + onOpen: () {}, + onRename: (_) {}, + ); + }, + ), + ); + await tester.pumpAndSettle(); + final surface = find.byKey(const ValueKey('project-tab-surface-a')); + final before = tester.getRect(surface); + update(() => selected = 'b'); + await tester.pumpAndSettle(); + expect(tester.getRect(surface), before); + expect(find.byType(CircularProgressIndicator), findsNothing); + expect( + tester + .widget(find.byKey(const ValueKey('project-tab-a'))) + .onPressed, + isNotNull, + ); + for (final key in [ + 'project-tab-close-b', + 'project-tabs-add', + 'project-tabs-list', + 'project-tabs-projects', + ]) { + expect( + tester.widget(find.byKey(ValueKey(key))).onPressed, + isNotNull, + ); + } + await tester.tap(find.byKey(const ValueKey('project-tab-a'))); + await tester.pumpAndSettle(); + expect(selected, 'a'); + expect(tester.takeException(), isNull); + }); + + testWidgets('empty project bar keeps creation available', (tester) async { + await pumpTabs( + tester, + width: 240, + tabs: ProjectTabsBar( + projects: const [], + recent: recent, + selectedId: null, + onSelect: (_) {}, + onClose: (_) {}, + onCreate: () {}, + onOpen: () {}, + onRename: (_) {}, + ), + ); + await tester.pumpAndSettle(); + expect( + tester + .widget(find.byKey(const Key('project-tabs-add'))) + .onPressed, + isNotNull, + ); + expect( + tester + .widget(find.byKey(const Key('project-tabs-list'))) + .onPressed, + isNull, + ); + expect(tester.takeException(), isNull); + }); + testWidgets('open tabs, recent menu and close actions stay separate', ( + tester, + ) async { + var selected = 'a'; + var opened = recent.take(2).toList(); + var created = 0; + var picked = 0; + late StateSetter update; + Widget content() => StatefulBuilder( + builder: (context, setState) { + update = setState; + return ProjectTabsBar( + projects: opened, + recent: recent, + selectedId: selected, + onSelect: (project) => setState(() { + selected = project.id; + if (!opened.contains(project)) opened = [...opened, project]; + }), + onClose: (project) => setState( + () => opened = opened.where((item) => item != project).toList(), + ), + onCreate: () => created++, + onOpen: () => picked++, + onRename: (_) {}, + ); + }, + ); + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(AppPalette.graphite, Brightness.dark), + ), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: SizedBox(width: 320, height: 44, child: content()), + ), + ), + ); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-tab-c')), findsNothing); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const ValueKey('project-menu-c'))); + await tester.pumpAndSettle(); + expect(selected, 'c'); + expect(find.byKey(const ValueKey('project-tab-c')), findsOneWidget); + expect( + tester.getRect(find.byKey(const ValueKey('project-tab-c'))).right, + lessThanOrEqualTo(320), + ); + await tester.tap(find.byKey(const ValueKey('project-tab-close-c'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-tab-c')), findsNothing); + expect(recent.length, 3); + update(() => selected = 'a'); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('新建项目')); + await tester.pumpAndSettle(); + expect(created, 1); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); + await tester.tap(find.text('打开项目…')); + await tester.pumpAndSettle(); + expect(picked, 1); + expect(tester.takeException(), isNull); + }); + testWidgets('project tabs fit six themes, long names and scaled text', ( + tester, + ) async { + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + for (final width in [240.0, 320.0, 720.0]) { + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(palette, brightness), + ), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: MediaQuery( + data: const MediaQueryData(textScaler: TextScaler.linear(1.5)), + child: Scaffold( + body: SizedBox( + width: width, + height: 44, + child: ProjectTabsBar( + projects: recent, + recent: recent, + selectedId: 'b', + onSelect: (_) {}, + onClose: (_) {}, + onCreate: () {}, + onOpen: () {}, + onRename: (_) {}, + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final tab = tester.getRect( + find.byKey(const ValueKey('project-tab-b')), + ); + final close = tester.getRect( + find.byKey(const ValueKey('project-tab-close-b')), + ); + final add = tester.getRect(find.byKey(const Key('project-tabs-add'))); + expect(tab.height, AppProjectTabMetrics.height); + expect(close.height, AppProjectTabMetrics.close); + expect(add.height, tab.height); + expect(close.center.dy, tab.center.dy); + expect(add.center.dy, tab.center.dy); + expect(tab.center.dy, 22); + final list = tester.getRect( + find.byKey(const Key('project-tabs-list')), + ); + expect(list.height, tab.height); + expect(list.center.dy, tab.center.dy); + expect(width - list.right, AppProjectTabMetrics.gap); + expect( + close.right, + lessThanOrEqualTo(list.left - AppProjectTabMetrics.gap), + ); + expect(tab.right, lessThanOrEqualTo(width)); + expect(tester.takeException(), isNull); + } + } + } + }); +} diff --git a/test/project_workspace_test.dart b/test/project_workspace_test.dart index 34cb14b..9d53106 100644 --- a/test/project_workspace_test.dart +++ b/test/project_workspace_test.dart @@ -2,6 +2,8 @@ import 'support/creation_names.dart'; import 'dart:io'; +import 'package:cutdex/errors/app_failure.dart'; + import 'package:cutdex_sdk/editor/commands.dart'; import 'package:cutdex/workspace/persistence/project_workspace.dart'; @@ -267,12 +269,24 @@ void main() { expect(workspace.project!.info.id, id); await expectLater( workspace.open(path, expectedId: 'wrong'), - throwsStateError, + throwsA( + isA().having( + (error) => error.failure.code, + 'code', + AppErrorCode.projectMismatch, + ), + ), ); expect(workspace.project!.info.id, id); await expectLater( workspace.open(path, name: 'Overwrite'), - throwsA(isA()), + throwsA( + isA().having( + (error) => error.failure.code, + 'code', + AppErrorCode.projectAlreadyExists, + ), + ), ); expect(workspace.project!.info.id, id); await workspace.open('${root.path}/Two.cutdex', name: 'Two'); diff --git a/test/properties_preview_updates_test.dart b/test/properties_preview_updates_test.dart index c111274..5f72796 100644 --- a/test/properties_preview_updates_test.dart +++ b/test/properties_preview_updates_test.dart @@ -12,6 +12,62 @@ import 'package:flutter_test/flutter_test.dart'; import 'support/preview_fixture.dart'; void main() { + testWidgets('inactive picture properties ignore replacement notifications', ( + tester, + ) async { + final fixture = (await tester.runAsync( + () => + createPreviewFixture(Uri.file('/test/image.png'), mediaType: 'image'), + ))!; + addTearDown( + () => tester.runAsync(() async { + await fixture.workspace.close(); + await fixture.directory.delete(recursive: true); + }), + ); + final view = fixture.timeline.view(SequenceId('one')); + final clip = view.version.kernelVersion.query().element( + view.version.kernelVersion.query().elementById(ElementId('clip'))!, + ); + final project = fixture.workspace.project!.info.id; + final container = ProviderContainer( + overrides: [ + editorPreviewProvider(project, 'project').overrideWith((ref) => null), + ], + ); + addTearDown(container.dispose); + Widget host(Widget child) => UncontrolledProviderScope( + container: container, + child: MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + theme: EditorTheme.penLight, + home: Scaffold(body: SingleChildScrollView(child: child)), + ), + ); + await tester.pumpWidget( + host( + PictureProperties( + projectId: project, + timelineId: 'project', + session: fixture.timeline, + sequence: SequenceId('one'), + clip: clip, + ), + ), + ); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('picture-x')), findsOneWidget); + await tester.pumpWidget( + host(_NotifyOnMount(() => view.seekTo(TimelineClock.ticksPerSecond))), + ); + expect(view.playheadTick, TimelineClock.ticksPerSecond); + expect(find.byType(PictureProperties), findsNothing); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); + testWidgets('cursor changes preserve inspector selection subscriptions', ( tester, ) async { @@ -35,6 +91,17 @@ void main() { view.setSelection([clip]); expect(inspector.selectedClips.single.id, ElementId('clip')); final selectedCount = notifications; + f.timeline.commands.setTransform( + sequence: SequenceId('one'), + clip: ElementId('clip'), + tick: 0, + change: (value) => value.copyWith(x: .25), + ); + expect( + notifications, + selectedCount, + reason: 'Property values belong to editors, not selection shell', + ); view.beginScrubbing(); for (var i = 1; i <= 120; i++) { view.seekTo(i * TimelineClock.ticksPerSecond ~/ 120); @@ -53,6 +120,7 @@ void main() { switchedCount, reason: 'Old sequence listener is detached', ); + await tester.runAsync(f.timeline.flush); }); testWidgets('static controls stay stable and discard edits after a seek', ( @@ -144,3 +212,22 @@ void main() { await tester.pumpWidget(const SizedBox.shrink()); }); } + +class _NotifyOnMount extends StatefulWidget { + const _NotifyOnMount(this.notify); + final VoidCallback notify; + + @override + State<_NotifyOnMount> createState() => _NotifyOnMountState(); +} + +class _NotifyOnMountState extends State<_NotifyOnMount> { + @override + void initState() { + super.initState(); + widget.notify(); + } + + @override + Widget build(BuildContext context) => const SizedBox(); +} diff --git a/test/properties_scroll_state_test.dart b/test/properties_scroll_state_test.dart new file mode 100644 index 0000000..5faa4d3 --- /dev/null +++ b/test/properties_scroll_state_test.dart @@ -0,0 +1,126 @@ +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/preview/preview_panel.dart'; +import 'package:cutdex/features/properties/properties_panel.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/timeline_provider.dart'; +import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'support/preview_fixture.dart'; + +void main() { + testWidgets( + 'property categories restore scroll and expansion independently', + (tester) async { + final f = (await tester.runAsync( + () => createPreviewFixture(Uri.file('/test/video.mov'), hasAudio: true), + ))!; + addTearDown( + () => tester.runAsync(() async { + await f.workspace.close(); + await f.directory.delete(recursive: true); + }), + ); + final project = f.workspace.project!.info.id; + final view = f.timeline.view(SequenceId('one')); + view.setSelection([ + view.version.kernelVersion.query().elementById(ElementId('clip'))!, + ]); + final container = ProviderContainer( + overrides: [ + editorTimelineProvider( + project, + 'project', + ).overrideWith((_) => f.timeline), + editorPreviewProvider(project, 'project').overrideWith((_) => null), + ], + ); + addTearDown(container.dispose); + final bucket = PageStorageBucket(); + Widget host(Widget child) => UncontrolledProviderScope( + container: container, + child: MaterialApp( + theme: EditorTheme.desktop(EditorTheme.penDark), + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: 280, + height: 240, + child: PageStorage(bucket: bucket, child: child), + ), + ), + ), + ), + ); + // A running app can still have the old bool saved when hot reloaded. + await tester.pumpWidget( + host( + Builder( + key: PageStorageKey((ElementId('clip'), PropertyCategory.picture)), + builder: (context) { + bucket.writeState(context, true); + return const SizedBox(); + }, + ), + ), + ); + await tester.pumpWidget( + host(EditorPropertiesPanel(projectId: project, timelineId: 'project')), + ); + await tester.pumpAndSettle(); + expect(tester.takeException(), isNull); + expect(find.byKey(const Key('media-color-menu')), findsNothing); + await tester.tap(find.text('素材色彩解释')); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('media-color-menu')), findsOneWidget); + + Future switchBack() async { + await tester.tap(find.byKey(const ValueKey('property-tab-audio'))); + await tester.pumpAndSettle(); + expect(tester.takeException(), isNull); + await tester.tap(find.byKey(const ValueKey('property-tab-picture'))); + await tester.pumpAndSettle(); + expect(tester.takeException(), isNull); + } + + ScrollPosition position() { + final scrollView = find.byWidgetPredicate( + (widget) => + widget is SingleChildScrollView && + widget.scrollDirection == Axis.vertical, + ); + return tester + .state( + find + .descendant(of: scrollView, matching: find.byType(Scrollable)) + .first, + ) + .position; + } + + await switchBack(); + expect(find.byKey(const Key('media-color-menu')), findsOneWidget); + position().jumpTo(55); + await tester.pumpAndSettle(); + expect(position().pixels, 55); + await switchBack(); + expect(position().pixels, 55); + expect(find.byKey(const Key('media-color-menu')), findsOneWidget); + + position().jumpTo(0); + await tester.pumpAndSettle(); + await tester.tap(find.text('素材色彩解释')); + await tester.pumpAndSettle(); + await switchBack(); + expect(find.byKey(const Key('media-color-menu')), findsNothing); + expect(position().pixels, 0); + await tester.pumpWidget(const SizedBox()); + }, + ); +} diff --git a/test/property_number_input_test.dart b/test/property_number_input_test.dart new file mode 100644 index 0000000..6ff9415 --- /dev/null +++ b/test/property_number_input_test.dart @@ -0,0 +1,250 @@ +import 'dart:async'; + +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/properties/property_number_input.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:flutter/material.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('top parameter label retains drag, submit and escape', ( + tester, + ) async { + var starts = 0; + var ends = 0; + var distance = 0.0; + final submitted = []; + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + theme: AppTheme.propertiesPanelTheme( + EditorTheme.desktop(EditorTheme.penDark), + ), + home: Scaffold( + body: Center( + child: SizedBox( + width: 256, + child: PropertyNumberInput( + label: 'Rotation', + unit: '°', + value: 0, + enabled: true, + readOnly: false, + scrubbing: false, + editContext: 0, + submit: (value) async { + submitted.add(value); + return true; + }, + onScrubStart: () { + starts++; + return true; + }, + onScrubUpdate: (value) => distance = value, + onScrubEnd: () => ends++, + onScrubCancel: () {}, + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect(tester.getSize(find.byType(TextField)).height, 28); + expect( + tester + .getRect( + find + .ancestor( + of: find.byType(AppScrubLabel), + matching: find.byType(Row), + ) + .first, + ) + .bottom, + tester.getTopLeft(find.byType(TextField)).dy - 4, + ); + await tester.drag(find.byType(AppScrubLabel), const Offset(30, 0)); + await tester.pump(); + expect(starts, 1); + expect(ends, 1); + expect(distance, greaterThan(0)); + await tester.enterText(find.byType(TextField), '45'); + await tester.testTextInput.receiveAction(TextInputAction.done); + await tester.pumpAndSettle(); + expect(submitted, [45]); + await tester.enterText(find.byType(TextField), '90'); + await tester.sendKeyEvent(LogicalKeyboardKey.escape); + await tester.pumpAndSettle(); + expect( + tester.widget(find.byType(TextField)).controller!.text, + '0', + ); + expect(submitted, [45]); + expect(tester.takeException(), isNull); + }); + + testWidgets('old submission cannot overwrite input in a new edit context', ( + tester, + ) async { + final input = _Input(); + await input.mount(tester); + await input.submit(tester, '11'); + input.update(() { + input.editContext = 1; + input.value = 2; + }); + await tester.pump(); + await tester.enterText(find.byType(TextField), '33'); + input.pending.single.complete(false); + await tester.pump(); + expect(input.field(tester).controller!.text, '33'); + expect(input.field(tester).decoration!.errorText, isNull); + }); + + testWidgets('old submission cannot overwrite new input in the same context', ( + tester, + ) async { + final input = _Input(); + await input.mount(tester); + await input.submit(tester, '11'); + await tester.enterText(find.byType(TextField), '33'); + input.pending.single.complete(false); + await tester.pump(); + expect(input.field(tester).controller!.text, '33'); + expect(input.field(tester).decoration!.errorText, isNull); + }); + + testWidgets('returning to the old context does not revive its submission', ( + tester, + ) async { + final input = _Input(); + await input.mount(tester); + await input.submit(tester, '11'); + input.update(() => input.editContext = 1); + await tester.pump(); + input.update(() => input.editContext = 0); + await tester.pump(); + input.pending.single.complete(false); + await tester.pump(); + expect(input.field(tester).controller!.text, '1'); + expect(input.field(tester).decoration!.errorText, isNull); + }); + + testWidgets( + 'out of order completion preserves the latest submission result', + (tester) async { + final input = _Input(); + await input.mount(tester); + await input.submit(tester, '11'); + await input.submit(tester, '33'); + expect(input.values, [11, 33]); + input.pending[1].complete(false); + await tester.pump(); + final error = input.field(tester).decoration!.errorText; + expect(error, isNotEmpty); + input.pending[0].complete(true); + await tester.pump(); + expect(input.field(tester).decoration!.errorText, error); + }, + ); + + testWidgets( + 'normal save still completes when the parent disables the input', + (tester) async { + final input = _Input(); + await input.mount(tester); + await input.submit(tester, '11'); + input.update(() => input.enabled = false); + await tester.pump(); + input.update(() { + input.enabled = true; + input.value = 11; + }); + await tester.pump(); + input.pending.single.complete(true); + await tester.pump(); + expect(input.field(tester).controller!.text, '11'); + expect(input.field(tester).decoration!.errorText, isNull); + }, + ); + + testWidgets('escape discards an outstanding submission result', ( + tester, + ) async { + final input = _Input(); + await input.mount(tester); + await input.submit(tester, '11'); + await tester.sendKeyEvent(LogicalKeyboardKey.escape); + await tester.pump(); + input.pending.single.complete(false); + await tester.pump(); + expect(input.field(tester).controller!.text, '1'); + expect(input.field(tester).decoration!.errorText, isNull); + }); + + testWidgets('submission completion ignores a disposed input', (tester) async { + final input = _Input(); + await input.mount(tester); + await input.submit(tester, '11'); + await tester.pumpWidget(const SizedBox()); + input.pending.single.complete(false); + await tester.pump(); + expect(tester.takeException(), isNull); + }); +} + +class _Input { + int editContext = 0; + double value = 1; + bool enabled = true; + final pending = >[]; + final values = []; + late StateSetter update; + + TextField field(WidgetTester tester) => + tester.widget(find.byType(TextField)); + + Future submit(WidgetTester tester, String text) async { + await tester.enterText(find.byType(TextField), text); + await tester.testTextInput.receiveAction(TextInputAction.done); + await tester.pump(); + } + + Future mount(WidgetTester tester) => tester.pumpWidget( + MaterialApp( + theme: EditorTheme.penLight, + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + home: Scaffold( + body: StatefulBuilder( + builder: (_, setState) { + update = setState; + return PropertyNumberInput( + label: 'X', + value: value, + enabled: enabled, + readOnly: false, + submit: (value) { + values.add(value); + final result = Completer(); + pending.add(result); + return result.future; + }, + onScrubUpdate: (_) {}, + onScrubEnd: () {}, + onScrubCancel: () {}, + scrubbing: false, + editContext: editContext, + ); + }, + ), + ), + ), + ); +} diff --git a/test/property_operation_context_test.dart b/test/property_operation_context_test.dart new file mode 100644 index 0000000..bb37798 --- /dev/null +++ b/test/property_operation_context_test.dart @@ -0,0 +1,322 @@ +import 'dart:async'; + +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/preview/preview_panel.dart'; +import 'package:cutdex/features/properties/picture_properties.dart'; +import 'package:cutdex/features/properties/mask_properties.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/workspace/timeline_session.dart'; +import 'package:cutdex_sdk/editor.dart'; +import 'package:cutdex_sdk/preview.dart'; +import 'package:cutdex_sdk/runtime.dart'; +import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'support/preview_fixture.dart'; + +void main() { + testWidgets('old mask cleanup cannot release the new editing binding', ( + tester, + ) async { + final fixture = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/video.mov'), + timelineOverride: _sequence(), + ), + ))!; + final preview = _BlockedPreview(fixture.timeline); + addTearDown( + () => tester.runAsync(() async { + await preview.close(); + await fixture.workspace.close(); + await fixture.directory.delete(recursive: true); + }), + ); + final container = ProviderContainer( + overrides: [ + editorPreviewProvider( + 'project', + 'timeline', + ).overrideWith((_) => preview), + ], + ); + addTearDown(container.dispose); + var selected = ElementId('clip'); + late StateSetter update; + await tester.pumpWidget( + _host( + container, + StatefulBuilder( + builder: (_, setState) { + update = setState; + return MaskProperties( + projectId: 'project', + timelineId: 'timeline', + element: selected, + ); + }, + ), + ), + ); + await tester.pumpAndSettle(); + expect(preview.maskEditingElement, ElementId('clip')); + update(() => selected = ElementId('other')); + await tester.pumpAndSettle(); + expect(preview.maskEditingElement, ElementId('other')); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + await tester.pump(); + expect(preview.maskEditingElement, isNull); + }); + + testWidgets( + 'unsubmitted values are discarded when another clip is selected', + (tester) async { + final fixture = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/video.mov'), + timelineOverride: _sequence(), + ), + ))!; + addTearDown( + () => tester.runAsync(() async { + await fixture.workspace.close(); + await fixture.directory.delete(recursive: true); + }), + ); + final container = ProviderContainer( + overrides: [ + editorPreviewProvider( + 'project', + 'timeline', + ).overrideWith((_) => null), + ], + ); + addTearDown(container.dispose); + final view = fixture.timeline.view(SequenceId('one')); + var selected = ElementId('clip'); + late StateSetter update; + await tester.pumpWidget( + _host( + container, + StatefulBuilder( + builder: (_, setState) { + update = setState; + final query = view.version.kernelVersion.query(); + return PictureProperties( + projectId: 'project', + timelineId: 'timeline', + session: fixture.timeline, + sequence: SequenceId('one'), + clip: query.element(query.elementById(selected)!), + ); + }, + ), + ), + ); + await tester.pumpAndSettle(); + final field = find.descendant( + of: find.byKey(const ValueKey('picture-x')), + matching: find.byType(TextField), + ); + final element = tester.element(field); + await tester.enterText(field, '999'); + update(() => selected = ElementId('other')); + await tester.pump(); + expect(tester.element(field), same(element)); + expect(tester.widget(field).controller!.text, '0'); + await tester.testTextInput.receiveAction(TextInputAction.done); + await tester.pumpAndSettle(); + final query = view.version.kernelVersion.query(); + expect( + ClipTransform.fromRecord(query.element(query.elementById(selected)!)).x, + 0, + ); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }, + ); + + for (final change in [ + 'clip', + 'clip-return', + 'timeline', + 'preview', + 'position', + 'new-seek', + 'none', + ]) { + testWidgets('pending keyframe seek follows its captured context: $change', ( + tester, + ) async { + final fixture = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/video.mov'), + timelineOverride: _sequence(), + ), + ))!; + final session = fixture.timeline; + final sequence = SequenceId('one'); + final view = session.view(sequence); + session.commands.editKeyframeChannel( + sequence: sequence, + clip: ElementId('clip'), + tick: 0, + parameterIds: TransformChannel.position.ids, + ); + session.commands.setTransform( + sequence: sequence, + clip: ElementId('clip'), + tick: 2 * TimelineClock.ticksPerSecond, + change: (value) => value.copyWith(x: .2), + ); + await tester.runAsync(session.flush); + view.seekTo(TimelineClock.ticksPerSecond); + final preview = _BlockedPreview(session); + final replacement = _BlockedPreview(session); + var boundPreview = preview; + addTearDown( + () => tester.runAsync(() async { + if (!preview.pause.isCompleted) preview.pause.complete(); + await preview.close(); + await replacement.close(); + await fixture.workspace.close(); + await fixture.directory.delete(recursive: true); + }), + ); + final container = ProviderContainer( + overrides: [ + for (final id in ['timeline', 'other-timeline']) + editorPreviewProvider( + 'project', + id, + ).overrideWith((_) => boundPreview), + ], + ); + addTearDown(container.dispose); + var selected = ElementId('clip'); + var timelineId = 'timeline'; + late StateSetter update; + await tester.pumpWidget( + _host( + container, + StatefulBuilder( + builder: (_, setState) { + update = setState; + final query = view.version.kernelVersion.query(); + return PictureProperties( + projectId: 'project', + timelineId: timelineId, + session: session, + sequence: sequence, + clip: query.element(query.elementById(selected)!), + animationView: true, + ); + }, + ), + ), + ); + await tester.pumpAndSettle(); + final button = tester.widget( + find.byKey(const ValueKey('picture-key-next-position')), + ); + final operation = Function.apply(button.onPressed!, []) as Future; + Future? newerSeek; + await tester.pump(); + if (change == 'clip' || change == 'clip-return') { + update(() => selected = ElementId('other')); + await tester.pump(); + if (change == 'clip-return') { + update(() => selected = ElementId('clip')); + await tester.pump(); + } + } else if (change == 'timeline') { + update(() => timelineId = 'other-timeline'); + await tester.pump(); + } else if (change == 'position') { + view.seekTo(3 * TimelineClock.ticksPerSecond); + await tester.pump(); + } else if (change == 'preview') { + boundPreview = replacement; + container.invalidate(editorPreviewProvider('project', 'timeline')); + await tester.pumpAndSettle(); + } else if (change == 'new-seek') { + final previous = tester.widget( + find.byKey(const ValueKey('picture-key-previous-position')), + ); + newerSeek = Function.apply(previous.onPressed!, []) as Future; + } + preview.pause.complete(); + await expectLater(operation, completes); + if (newerSeek != null) await expectLater(newerSeek, completes); + final seconds = switch (change) { + 'none' => 2, + 'position' => 3, + 'new-seek' => 0, + _ => 1, + }; + expect(view.playheadTick, TimelineClock.ticksPerSecond * seconds); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + }); + } +} + +Widget _host(ProviderContainer container, Widget child) => + UncontrolledProviderScope( + container: container, + child: MaterialApp( + theme: EditorTheme.desktop(EditorTheme.penLight), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + home: Scaffold(body: SingleChildScrollView(child: child)), + ), + ); + +TimelineDto _sequence() => TimelineDto( + id: SequenceId('one'), + name: 'One', + format: TimelineFormat.fps30, + primaryStorylineId: StorylineId('primary'), + storylines: [ + StorylineDto( + id: StorylineId('primary'), + elementIds: [ElementId('clip'), ElementId('other')], + ), + ], + elements: [ + for (final id in ['clip', 'other']) + ElementDto( + id: ElementId(id), + name: id, + structure: ElementStructure.content, + payloadRef: PayloadRef('source'), + duration: RationalTime.seconds(5), + sourceRange: TimeRange( + start: RationalTime.zero, + duration: RationalTime.seconds(5), + ), + mediaRange: TimeRange( + start: RationalTime.zero, + duration: RationalTime.seconds(5), + ), + ), + ], +); + +class _BlockedPreview extends PreviewController { + _BlockedPreview(EditorTimelineSession session) + : super( + timeline: session, + runtime: CutdexRuntime(), + activeSequence: () => session.activeSequenceId, + viewForSequence: session.view, + ); + final pause = Completer(); + + @override + Future pauseForCanvasInteraction() => pause.future; +} diff --git a/test/resource_navigation_test.dart b/test/resource_navigation_test.dart new file mode 100644 index 0000000..72fc6a1 --- /dev/null +++ b/test/resource_navigation_test.dart @@ -0,0 +1,173 @@ +import 'package:cutdex/features/media/resource_navigation.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + Future mount( + WidgetTester tester, { + double width = 240, + double scale = 1, + Locale locale = const Locale('zh'), + AppPalette palette = AppPalette.graphite, + Brightness brightness = Brightness.dark, + }) async { + var selected = ResourceSection.imported; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(palette, brightness), + ), + locale: locale, + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + child: MediaQuery( + data: MediaQueryData(textScaler: TextScaler.linear(scale)), + child: StatefulBuilder( + builder: (context, setState) => ResourceSectionTabs( + selected: selected, + onSelected: (value) => setState(() => selected = value), + ), + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + } + + testWidgets('translated tabs fit scaled text in all desktop palettes', ( + tester, + ) async { + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + for (final locale in [ + const Locale('zh'), + const Locale('en'), + const Locale('de'), + const Locale('ru'), + ]) { + for (final width in [120.0, 240.0, 400.0, 640.0]) { + await mount( + tester, + width: width, + scale: 1.3, + locale: locale, + palette: palette, + brightness: brightness, + ); + expect( + tester.takeException(), + isNull, + reason: '$palette $brightness $locale $width', + ); + expect( + tester + .getSize(find.byKey(const Key('resource-section-tabs'))) + .height, + 36, + ); + final header = tester.getRect( + find.byKey(const Key('resource-section-tabs')), + ); + for (final button in find.byType(TextButton).evaluate()) { + final bounds = tester.getRect(find.byWidget(button.widget)); + expect(bounds.top, greaterThanOrEqualTo(header.top)); + expect(bounds.bottom, lessThanOrEqualTo(header.bottom)); + expect(bounds.height, AppDesktopMetrics.timelineTabControl); + } + } + } + } + } + }); + + testWidgets( + 'narrow tabs scroll with wheel and drag through the shared edge fade', + (tester) async { + await mount(tester, width: 160); + final list = find.byKey(const Key('resource-tabs-list')); + final scroll = tester.widget(list); + final fade = tester.widget(find.byType(ScrollEdgeFade)); + expect(fade.axis, Axis.horizontal); + expect(fade.controller, same(scroll.controller)); + final position = scroll.controller!.position; + expect(position.pixels, 0); + expect(position.extentAfter, greaterThan(0)); + expect(find.byKey(const Key('resource-tabs-more')), findsNothing); + for (final section in ResourceSection.values) { + expect( + find.byKey(ValueKey('resource-tab-${section.name}')), + findsOneWidget, + ); + } + await tester.sendEventToBinding( + PointerScrollEvent( + position: tester.getCenter(list), + scrollDelta: const Offset(0, 70), + ), + ); + await tester.pumpAndSettle(); + expect(position.pixels, 70); + expect(position.extentBefore, greaterThan(0)); + expect(position.extentAfter, greaterThan(0)); + await tester.drag(list, const Offset(-600, 0)); + await tester.pumpAndSettle(); + expect(position.pixels, position.maxScrollExtent); + await tester.tap(find.byKey(const ValueKey('resource-tab-transitions'))); + await tester.pumpAndSettle(); + expect( + tester + .widget(find.byType(ResourceSectionTabs)) + .selected, + ResourceSection.transitions, + ); + tester + .widget(find.byType(ResourceSectionTabs)) + .onSelected!(ResourceSection.imported); + await tester.pumpAndSettle(); + expect(position.pixels, 0); + expect(tester.takeException(), isNull); + }, + ); + + testWidgets('a programmatically selected tab scrolls into view', ( + tester, + ) async { + await mount(tester, width: 160); + tester + .widget(find.byType(ResourceSectionTabs)) + .onSelected!(ResourceSection.transitions); + await tester.pumpAndSettle(); + final viewport = tester.getRect( + find.byKey(const Key('resource-tabs-list')), + ); + final selected = tester.getRect( + find.byKey(const ValueKey('resource-tab-transitions')), + ); + expect(selected.left, greaterThanOrEqualTo(viewport.left)); + expect(selected.right, lessThanOrEqualTo(viewport.right)); + expect(tester.takeException(), isNull); + }); + + testWidgets('wide panel exposes every category directly', (tester) async { + await mount(tester, width: 640); + for (final section in ResourceSection.values) { + expect( + find.byKey(ValueKey('resource-tab-${section.name}')), + findsOneWidget, + ); + } + expect(find.byKey(const Key('resource-tabs-more')), findsNothing); + }); +} diff --git a/test/settings_save_order_test.dart b/test/settings_save_order_test.dart index 988f451..7883055 100644 --- a/test/settings_save_order_test.dart +++ b/test/settings_save_order_test.dart @@ -2,11 +2,47 @@ import 'dart:async'; import 'package:cutdex/features/settings/appearance_settings.dart'; import 'package:cutdex/features/settings/language_settings.dart'; +import 'package:cutdex/features/settings/timeline_ruler_settings.dart'; import 'package:cutdex/persistence/app_settings_repositories.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { + _testSettings( + name: 'timeline ruler', + initial: TimelineRulerTimecodeLayout.inline, + first: TimelineRulerTimecodeLayout.centered, + second: TimelineRulerTimecodeLayout.overlay, + container: (store) => ProviderContainer( + overrides: [ + timelineRulerSettingsRepositoryProvider.overrideWithValue( + _TimelineRulerRepository(store), + ), + ], + ), + load: (container) => container.read(timelineRulerSettingsProvider.future), + value: (container) => + container.read(timelineRulerSettingsProvider).requireValue, + save: (container, value) => + container.read(timelineRulerSettingsProvider.notifier).setLayout(value), + ); + _testSettings( + name: 'palette', + initial: AppPalette.graphite, + first: AppPalette.violet, + second: AppPalette.teal, + container: (store) => ProviderContainer( + overrides: [ + paletteSettingsRepositoryProvider.overrideWithValue( + _PaletteRepository(store), + ), + ], + ), + load: (container) => container.read(paletteSettingsProvider.future), + value: (container) => container.read(paletteSettingsProvider).requireValue, + save: (container, value) => + container.read(paletteSettingsProvider.notifier).setPalette(value), + ); _testSettings( name: 'appearance', initial: AppAppearance.system, @@ -141,6 +177,28 @@ class _Store { } } +class _TimelineRulerRepository implements TimelineRulerSettingsRepository { + _TimelineRulerRepository(this.store); + final _Store store; + + @override + Future load() => store.load(); + + @override + Future save(TimelineRulerTimecodeLayout layout) => store.save(layout); +} + +class _PaletteRepository implements PaletteSettingsRepository { + _PaletteRepository(this.store); + final _Store store; + + @override + Future load() => store.load(); + + @override + Future save(AppPalette palette) => store.save(palette); +} + class _AppearanceRepository implements AppearanceSettingsRepository { _AppearanceRepository(this.store); final _Store store; diff --git a/test/sidebar_category_tabs_test.dart b/test/sidebar_category_tabs_test.dart new file mode 100644 index 0000000..3b17bf2 --- /dev/null +++ b/test/sidebar_category_tabs_test.dart @@ -0,0 +1,78 @@ +import 'package:cutdex/features/projects/sidebar_category_tabs.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex_ui/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('sidebar categories fit themes, narrow widths and large text', ( + tester, + ) async { + for (final palette in AppPalette.values) { + for (final brightness in Brightness.values) { + for (final locale in const [Locale('zh'), Locale('en'), Locale('de')]) { + for (final width in [120.0, 180.0, 280.0]) { + var media = false; + await tester.pumpWidget( + MaterialApp( + theme: AppTheme.desktopWorkspaceTheme( + AppTheme.forPalette(palette, brightness), + ), + locale: locale, + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: width, + child: MediaQuery( + data: const MediaQueryData( + textScaler: TextScaler.linear(2), + ), + child: StatefulBuilder( + builder: (context, setState) => SidebarCategoryTabs( + mediaSelected: media, + onSelected: (value) => + setState(() => media = value), + ), + ), + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + final header = tester.getRect( + find.byKey(const Key('sidebar-category-header')), + ); + final chat = tester.getRect( + find.byKey(const Key('sidebar-tab-chat')), + ); + final resources = tester.getRect( + find.byKey(const Key('sidebar-tab-resources')), + ); + expect(header.height, 36); + expect(chat.height, 28); + expect(resources.height, 28); + expect(chat.left - header.left, 12); + expect(header.right - resources.right, 12); + expect(resources.left - chat.right, 4); + await tester.tap(find.byKey(const Key('sidebar-tab-resources'))); + await tester.pump(); + expect(media, isTrue); + await tester.tap(find.byKey(const Key('sidebar-tab-chat'))); + await tester.pump(); + expect(media, isFalse); + expect( + tester.takeException(), + isNull, + reason: '$palette $brightness $locale width=$width', + ); + } + } + } + } + }); +} diff --git a/test/support/memory_app_settings.dart b/test/support/memory_app_settings.dart index df43557..e8f005b 100644 --- a/test/support/memory_app_settings.dart +++ b/test/support/memory_app_settings.dart @@ -1,4 +1,5 @@ import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex_sdk/timeline_ui.dart' show TimelineRulerTimecodeLayout; import 'package:cutdex/workspace/project_state.dart'; import 'package:cutdex/workspace/persistence/recent_projects.dart'; @@ -57,6 +58,35 @@ class MemoryAppearanceSettingsRepository } } +class MemoryPaletteSettingsRepository implements PaletteSettingsRepository { + AppPalette value = AppPalette.graphite; + bool failWrites = false; + + @override + Future load() async => value; + + @override + Future save(AppPalette palette) async { + if (failWrites) throw StateError('write failed'); + value = palette; + } +} + +class MemoryTimelineRulerSettingsRepository + implements TimelineRulerSettingsRepository { + TimelineRulerTimecodeLayout value = TimelineRulerTimecodeLayout.inline; + bool failWrites = false; + + @override + Future load() async => value; + + @override + Future save(TimelineRulerTimecodeLayout layout) async { + if (failWrites) throw StateError('write failed'); + value = layout; + } +} + class MemoryRecentProjectsRepository implements RecentProjectsRepository { List recent = []; final projects = {}; diff --git a/test/timeline_creation_presentation_test.dart b/test/timeline_creation_presentation_test.dart new file mode 100644 index 0000000..9b587a0 --- /dev/null +++ b/test/timeline_creation_presentation_test.dart @@ -0,0 +1,295 @@ +import 'dart:async'; + +import 'package:cutdex/app/app.dart'; +import 'package:cutdex/features/editor/editor_panel_defaults.dart'; +import 'package:cutdex/features/editor/editor_page.dart'; +import 'package:cutdex/features/projects/projects_page.dart'; +import 'package:cutdex/features/preview/preview_panel.dart'; +import 'package:cutdex/features/properties/project_properties.dart'; +import 'package:cutdex/integrations/agent/conversation_repository.dart'; +import 'package:cutdex/integrations/platform/device_experience.dart'; +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex/workspace/persistence/recent_projects.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/view_settings.dart'; +import 'package:cutdex/workspace/workspace_mode.dart'; +import 'package:cutdex/workspace/workspace_navigation.dart'; +import 'package:drift/native.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'support/empty_conversation_repository.dart'; +import 'support/memory_app_settings.dart'; +import 'support/preview_fixture.dart'; + +void main() { + testWidgets( + 'real timeline creation retains panels on every published frame', + (tester) async { + tester.view.physicalSize = const Size(1800, 900); + tester.view.devicePixelRatio = 1; + tester.platformDispatcher.localesTestValue = const [Locale('zh')]; + addTearDown(tester.platformDispatcher.clearLocalesTestValue); + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + final fixture = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/image.png'), + mediaType: 'image', + ), + ))!; + await tester.runAsync(fixture.workspace.close); + final views = _CreationViews(); + final database = AppDatabase(NativeDatabase.memory()); + final container = ProviderContainer( + overrides: [ + deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), + appDatabaseProvider.overrideWithValue(database), + recentProjectsProvider.overrideWithValue( + MemoryRecentProjectsRepository(), + ), + resourceLocationSettingsRepositoryProvider.overrideWithValue( + MemoryResourceLocationSettingsRepository(fixture.directory.path), + ), + timelineViewSettingsRepositoryProvider.overrideWithValue(views), + appearanceSettingsRepositoryProvider.overrideWithValue( + MemoryAppearanceSettingsRepository(), + ), + paletteSettingsRepositoryProvider.overrideWithValue( + MemoryPaletteSettingsRepository(), + ), + conversationRepositoryProvider.overrideWith( + (ref) async => EmptyConversationRepository(), + ), + editorPreviewProvider.overrideWith((ref, ids) => null), + ], + ); + final projects = (await tester.runAsync(() async { + final projects = container.read(projectsProvider.notifier); + await container.read(projectsProvider.future); + return projects; + }))!; + addTearDown(() async { + if (!views.gate.isCompleted) { + views.gate.complete(const TimelineViewState()); + } + await tester.pumpWidget(const SizedBox()); + for (var frame = 0; frame < 5; frame++) { + await tester.pump(const Duration(milliseconds: 200)); + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 10)), + ); + } + var closed = false; + late Future closing; + await tester.runAsync(() async { + closing = projects.prepareToQuit(); + unawaited(closing.whenComplete(() => closed = true)); + }); + for (var frame = 0; frame < 500 && !closed; frame++) { + await tester.pump(const Duration(milliseconds: 10)); + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 10)), + ); + } + expect(closed, isTrue); + await tester.runAsync(() async { + await closing; + container.dispose(); + await database.close(); + await fixture.directory.delete(recursive: true); + }); + }); + await tester.runAsync(() async { + expect( + await projects.open( + '${fixture.directory.path}/Preview.cutdex', + timelineId: 'project', + ), + isTrue, + ); + await container.read(workspaceViewSettingsProvider.future); + container + .read(workspaceViewSettingsProvider.notifier) + .setMode(WorkspaceMode.cut); + await container.read( + projectViewSettingsProvider( + container.read(projectsProvider).requireValue.activeProject!.id, + ).future, + ); + container.read(workspaceNavigationProvider); + while (!container.read(workspaceNavigationProvider).ready) { + await Future.delayed(const Duration(milliseconds: 5)); + } + }); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: const CutdexApp(), + ), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('editor-properties-button'))); + await tester.pumpAndSettle(); + final properties = tester.element(find.byType(ProjectProperties)); + final label = tester.element(find.text('画布尺寸')); + final value = tester.element(find.text('1080 × 1920 px')); + final preview = tester.element(find.byType(EditorPreviewPanel)); + final timeline = tester.element( + find.byKey(const Key('editor-timeline-surface')), + ); + final bounds = tester.getRect(find.byType(ProjectProperties)); + final previewBounds = tester.getRect(find.byType(EditorPreviewPanel)); + final timelineBounds = tester.getRect( + find.byKey(const Key('editor-timeline-surface')), + ); + final initialCount = container + .read(projectsProvider) + .requireValue + .timelines + .length; + final initial = container + .read(projectsProvider) + .requireValue + .timeline! + .id; + + void stable() { + expect(find.byKey(const Key('properties-pending')), findsNothing); + expect(find.byKey(const Key('timeline-default-tracks')), findsNothing); + expect(find.byType(EditorEmptyPanel), findsNothing); + expect( + tester.element(find.byType(ProjectProperties)), + same(properties), + ); + expect(tester.element(find.text('画布尺寸')), same(label)); + expect(tester.element(find.byType(EditorPreviewPanel)), same(preview)); + expect( + tester.element(find.byKey(const Key('editor-timeline-surface'))), + same(timeline), + ); + expect(tester.getRect(find.byType(ProjectProperties)), bounds); + expect(tester.getRect(find.byType(EditorPreviewPanel)), previewBounds); + expect( + tester.getRect(find.byKey(const Key('editor-timeline-surface'))), + timelineBounds, + ); + expect(tester.takeException(), isNull); + } + + var windowBuilds = 0; + var workspaceBuilds = 0; + var previewBuilds = 0; + var labelBuilds = 0; + final previousBuild = debugOnRebuildDirtyWidget; + debugOnRebuildDirtyWidget = (element, built) { + previousBuild?.call(element, built); + if (element.widget is EditingPage) windowBuilds++; + if (element.widget is EditorWorkspace) workspaceBuilds++; + if (element.widget is EditorPreviewPanel) previewBuilds++; + if (identical(element, label)) labelBuilds++; + }; + addTearDown(() => debugOnRebuildDirtyWidget = previousBuild); + + Future advanceUntil( + bool Function() complete, { + VoidCallback? onFrame, + }) async { + for (var attempt = 0; attempt < 500 && !complete(); attempt++) { + await tester.pump(const Duration(milliseconds: 10)); + onFrame?.call(); + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 10)), + ); + } + expect(complete(), isTrue, reason: 'Real filesystem work completes'); + await tester.pump(); + onFrame?.call(); + } + + views.blockCreation = true; + await tester.tap(find.byKey(const Key('timeline-add-button'))); + await advanceUntil(() => views.started.isCompleted); + for (var frame = 0; frame < 5; frame++) { + await tester.pump(const Duration(milliseconds: 100)); + stable(); + final state = container.read(projectsProvider).requireValue; + expect(state.creatingTimeline, isTrue); + expect(state.timeline!.id, initial); + expect(find.text('1080 × 1920 px'), findsOneWidget); + } + await tester.tap( + find.byKey(const ValueKey('project-settings-edit')), + warnIfMissed: false, + ); + await tester.pump(); + expect(find.byKey(const ValueKey('project-width')), findsNothing); + stable(); + expect(windowBuilds, 0, reason: 'Creation progress is local to controls'); + expect(workspaceBuilds, 0); + expect(previewBuilds, 0); + expect(labelBuilds, 0); + views.gate.complete(const TimelineViewState()); + await advanceUntil( + () => !container.read(projectsProvider).requireValue.creatingTimeline, + onFrame: () { + stable(); + if (container.read(projectsProvider).requireValue.timeline!.id != + initial) { + expect(find.text('1920 × 1080 px'), findsOneWidget); + expect(tester.element(find.text('1920 × 1080 px')), same(value)); + } + }, + ); + // Verify the first committed frame as well as subsequent settling frames. + for (var frame = 0; frame < 5; frame++) { + await tester.pump(const Duration(milliseconds: 16)); + stable(); + expect(find.text('1920 × 1080 px'), findsOneWidget); + expect(tester.element(find.text('1920 × 1080 px')), same(value)); + } + expect( + container.read(projectsProvider).requireValue.timeline!.id, + isNot(initial), + ); + expect( + container.read(projectsProvider).requireValue.creatingTimeline, + isFalse, + ); + expect( + container.read(projectsProvider).requireValue.timelines, + hasLength(initialCount + 1), + ); + await tester.tap(find.byKey(const ValueKey('project-settings-edit'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-width')), findsOneWidget); + await tester.pumpWidget(const SizedBox()); + // Dispose view bindings and drain their debounce in the fake clock. + await tester.pump(const Duration(seconds: 1)); + }, + ); +} + +class _CreationViews implements TimelineViewSettingsRepository { + bool blockCreation = false; + final started = Completer(); + final gate = Completer(); + @override + Future load(String projectId, String timelineId) { + if (blockCreation) { + if (!started.isCompleted) started.complete(); + return gate.future; + } + return Future.value(const TimelineViewState()); + } + + @override + Future save( + String projectId, + String timelineId, + Object sequenceId, + TimelineSequenceViewState value, + ) async {} +} diff --git a/test/timeline_ruler_previews_test.dart b/test/timeline_ruler_previews_test.dart new file mode 100644 index 0000000..e265b2e --- /dev/null +++ b/test/timeline_ruler_previews_test.dart @@ -0,0 +1,65 @@ +import 'package:cutdex/features/timeline/timeline_ruler_previews.dart'; +import 'package:cutdex_sdk/timeline_ui.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + for (final (layout, light, dark, frames) in [ + ( + TimelineRulerTimecodeLayout.inline, + timecodeRulerLightPreview, + timecodeRulerDarkPreview, + timecodeRulerFramePreview, + ), + ( + TimelineRulerTimecodeLayout.centered, + centeredTimecodeRulerLightPreview, + centeredTimecodeRulerDarkPreview, + centeredTimecodeRulerFramePreview, + ), + ( + TimelineRulerTimecodeLayout.overlay, + overlayTimecodeRulerLightPreview, + overlayTimecodeRulerDarkPreview, + overlayTimecodeRulerFramePreview, + ), + ]) { + testWidgets('${layout.name} previews render and zoom at both widths', ( + tester, + ) async { + debugDefaultTargetPlatformOverride = TargetPlatform.macOS; + try { + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetDevicePixelRatio); + addTearDown(tester.view.resetPhysicalSize); + for (final (width, factory) in [ + (640.0, light), + (640.0, dark), + (640.0, frames), + (320.0, dark), + ]) { + // Remount to give each configuration its own camera state. + await tester.pumpWidget(const SizedBox.shrink()); + tester.view.physicalSize = Size(width, 152); + await tester.pumpWidget(factory()); + await tester.pump(); + final ruler = tester.widget( + find.byType(TimelineRuler), + ); + expect(ruler.style, TimelineRulerStyle.timecode); + expect(ruler.timecodeLayout, layout); + expect(tester.takeException(), isNull); + final before = ruler.controller.camera.pixelsPerTick; + await tester.tap(find.byTooltip('Zoom in')); + await tester.pump(); + expect(ruler.controller.camera.pixelsPerTick, greaterThan(before)); + expect(tester.takeException(), isNull); + } + await tester.pumpWidget(const SizedBox.shrink()); + } finally { + debugDefaultTargetPlatformOverride = null; + } + }); + } +} diff --git a/test/timeline_ruler_settings_test.dart b/test/timeline_ruler_settings_test.dart new file mode 100644 index 0000000..59056d0 --- /dev/null +++ b/test/timeline_ruler_settings_test.dart @@ -0,0 +1,140 @@ +import 'dart:io'; + +import 'package:cutdex/features/settings/timeline_ruler_settings.dart'; +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:drift/native.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sqlite3/sqlite3.dart'; + +import 'support/memory_app_settings.dart'; + +void main() { + test( + 'layout survives provider recreation and failed saves retain selection', + () async { + final repository = MemoryTimelineRulerSettingsRepository(); + ProviderContainer container() => ProviderContainer( + overrides: [ + timelineRulerSettingsRepositoryProvider.overrideWithValue(repository), + ], + ); + final first = container(); + addTearDown(first.dispose); + expect( + await first.read(timelineRulerSettingsProvider.future), + TimelineRulerTimecodeLayout.inline, + ); + await first + .read(timelineRulerSettingsProvider.notifier) + .setLayout(TimelineRulerTimecodeLayout.centered); + final restored = container(); + addTearDown(restored.dispose); + expect( + await restored.read(timelineRulerSettingsProvider.future), + TimelineRulerTimecodeLayout.centered, + ); + repository.failWrites = true; + await expectLater( + restored + .read(timelineRulerSettingsProvider.notifier) + .setLayout(TimelineRulerTimecodeLayout.overlay), + throwsStateError, + ); + expect( + restored.read(timelineRulerSettingsProvider).requireValue, + TimelineRulerTimecodeLayout.centered, + ); + repository.failWrites = false; + await restored + .read(timelineRulerSettingsProvider.notifier) + .setLayout(TimelineRulerTimecodeLayout.overlay); + expect(repository.value, TimelineRulerTimecodeLayout.overlay); + }, + ); + + test('ruler, palette and appearance writes preserve each other', () async { + final db = AppDatabase(NativeDatabase.memory()); + addTearDown(db.close); + final ruler = DriftTimelineRulerSettingsRepository(db); + final palette = DriftPaletteSettingsRepository(db); + final appearance = DriftAppearanceSettingsRepository(db); + expect(await ruler.load(), TimelineRulerTimecodeLayout.inline); + await palette.save(AppPalette.teal); + await appearance.save(AppAppearance.penDark); + for (final layout in TimelineRulerTimecodeLayout.values) { + await ruler.save(layout); + expect(await ruler.load(), layout); + expect(await palette.load(), AppPalette.teal); + expect(await appearance.load(), AppAppearance.penDark); + } + await Future.wait([ + palette.save(AppPalette.violet), + appearance.save(AppAppearance.penLight), + ruler.save(TimelineRulerTimecodeLayout.centered), + ]); + expect(await ruler.load(), TimelineRulerTimecodeLayout.centered); + expect(await palette.load(), AppPalette.violet); + expect(await appearance.load(), AppAppearance.penLight); + await db.customStatement( + "UPDATE appearance_configurations SET timeline_ruler_layout = 'unknown'", + ); + expect(await ruler.load(), TimelineRulerTimecodeLayout.inline); + }); + + for (final schema in [2, 3]) { + test( + 'schema $schema upgrades and ruler style survives reopening', + () async { + final directory = await Directory.systemTemp.createTemp( + 'cutdex-ruler-settings-', + ); + addTearDown(() => directory.delete(recursive: true)); + final file = File('${directory.path}/app.sqlite'); + final initial = AppDatabase(NativeDatabase(file)); + await DriftAppearanceSettingsRepository(initial) + .save(AppAppearance.penDark); + await DriftPaletteSettingsRepository(initial).save(AppPalette.teal); + await initial.close(); + final old = sqlite3.open(file.path); + try { + old.execute( + 'ALTER TABLE appearance_configurations DROP COLUMN timeline_ruler_layout', + ); + if (schema == 2) { + old.execute( + 'ALTER TABLE appearance_configurations DROP COLUMN palette', + ); + } + old.userVersion = schema; + } finally { + old.close(); + } + final upgraded = AppDatabase(NativeDatabase(file)); + expect( + await DriftAppearanceSettingsRepository(upgraded).load(), + AppAppearance.penDark, + ); + expect( + await DriftPaletteSettingsRepository(upgraded).load(), + schema == 2 ? AppPalette.graphite : AppPalette.teal, + ); + final ruler = DriftTimelineRulerSettingsRepository(upgraded); + expect(await ruler.load(), TimelineRulerTimecodeLayout.inline); + await ruler.save(TimelineRulerTimecodeLayout.overlay); + await upgraded.close(); + final reopened = AppDatabase(NativeDatabase(file)); + addTearDown(reopened.close); + expect( + await DriftTimelineRulerSettingsRepository(reopened).load(), + TimelineRulerTimecodeLayout.overlay, + ); + expect( + await DriftAppearanceSettingsRepository(reopened).load(), + AppAppearance.penDark, + ); + }, + ); + } +} diff --git a/test/timeline_ruler_settings_widget_test.dart b/test/timeline_ruler_settings_widget_test.dart new file mode 100644 index 0000000..cc6f40c --- /dev/null +++ b/test/timeline_ruler_settings_widget_test.dart @@ -0,0 +1,253 @@ +import 'package:cutdex/app/editor_theme.dart'; +import 'package:cutdex/features/settings/settings_content.dart'; +import 'package:cutdex/features/settings/timeline_ruler_settings.dart'; +import 'package:cutdex/features/settings/timeline_ruler_settings_field.dart'; +import 'package:cutdex/features/timeline/editor_timeline_viewport.dart'; +import 'package:cutdex/integrations/agent/conversation_repository.dart'; +import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex_sdk/timeline/engine.dart'; +import 'package:cutdex_sdk/timeline/layout.dart'; +import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:cutdex_sdk/timeline_ui.dart'; +import 'package:cutdex_ui/widgets.dart'; +import 'package:drift/native.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'support/empty_conversation_repository.dart'; +import 'support/memory_app_settings.dart'; + +void main() { + testWidgets( + 'appearance settings switch the live ruler and retain its camera', + (tester) async { + tester.view.physicalSize = const Size(1200, 900); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + final database = AppDatabase(NativeDatabase.memory()); + addTearDown(database.close); + final repository = MemoryTimelineRulerSettingsRepository(); + final scope = ProviderContainer( + overrides: [ + appDatabaseProvider.overrideWithValue(database), + timelineRulerSettingsRepositoryProvider.overrideWithValue(repository), + conversationRepositoryProvider.overrideWith( + (ref) async => EmptyConversationRepository(), + ), + ], + ); + addTearDown(scope.dispose); + final controller = _controller(); + addTearDown(controller.dispose); + await tester.pumpWidget( + UncontrolledProviderScope( + container: scope, + child: MaterialApp( + locale: const Locale('zh'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + theme: EditorTheme.desktop( + EditorTheme.forPalette(AppPalette.graphite, Brightness.dark), + ), + home: Scaffold( + body: Column( + children: [ + const Expanded(child: SettingsContent()), + SizedBox( + height: 180, + child: EditorTimelineViewport( + controller: controller, + child: TimelineView( + key: const Key('retained-timeline'), + controller: controller, + ), + ), + ), + ], + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + expect( + find.byKey(const Key('settings-timeline-ruler-style')), + findsNothing, + ); + await tester.tap(find.byKey(const ValueKey('settings-navigation-3'))); + await tester.pumpAndSettle(); + final select = find.byKey(const Key('settings-timeline-ruler-style')); + expect(select, findsOneWidget); + expect(find.text('时间线刻度风格'), findsWidgets); + final retained = tester.element( + find.byKey(const Key('retained-timeline')), + ); + controller.seekTo(2 * TimelineClock.ticksPerSecond); + final camera = ( + controller.camera.baseTick, + controller.camera.fractionalTick, + controller.camera.pixelsPerTick, + controller.camera.verticalOffset, + ); + final tick = controller.playheadTick; + var editing = 0; + controller.editingChanges.addListener(() => editing++); + Future choose(TimelineRulerTimecodeLayout layout) async { + await tester.ensureVisible(select); + await tester.tap(select); + await tester.pumpAndSettle(); + final field = tester.widget>( + select, + ); + final label = field.options.singleWhere((o) => o.value == layout).label; + await tester.tap(find.widgetWithText(MenuItemButton, label)); + await tester.pumpAndSettle(); + } + + for (final layout in [ + TimelineRulerTimecodeLayout.centered, + TimelineRulerTimecodeLayout.overlay, + TimelineRulerTimecodeLayout.inline, + ]) { + await choose(layout); + expect(repository.value, layout); + expect( + tester + .widget(find.byType(TimelineRuler)) + .timecodeLayout, + layout, + ); + expect( + tester.element(find.byKey(const Key('retained-timeline'))), + same(retained), + ); + expect(( + controller.camera.baseTick, + controller.camera.fractionalTick, + controller.camera.pixelsPerTick, + controller.camera.verticalOffset, + ), camera); + expect(controller.playheadTick, tick); + expect(editing, 0); + expect(tester.takeException(), isNull); + } + repository.failWrites = true; + await choose(TimelineRulerTimecodeLayout.centered); + expect(find.text('无法保存外观设置,请重试'), findsOneWidget); + expect( + tester.widget(find.byType(TimelineRuler)).timecodeLayout, + TimelineRulerTimecodeLayout.inline, + ); + expect( + tester.widget>(select).value, + TimelineRulerTimecodeLayout.inline, + ); + repository.failWrites = false; + await choose(TimelineRulerTimecodeLayout.overlay); + expect(find.text('无法保存外观设置,请重试'), findsNothing); + expect(repository.value, TimelineRulerTimecodeLayout.overlay); + await tester.tap(find.byKey(const ValueKey('settings-navigation-0'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('settings-color-palette')), findsNothing); + expect( + find.byKey(const Key('settings-timeline-ruler-style')), + findsNothing, + ); + await tester.tap(find.byKey(const ValueKey('settings-navigation-3'))); + await tester.pumpAndSettle(); + expect( + tester.widget>(select).value, + TimelineRulerTimecodeLayout.overlay, + ); + await tester.pumpWidget(const SizedBox.shrink()); + }, + ); + + testWidgets( + 'mobile keeps its elapsed ruler and does not load desktop settings', + (tester) async { + final scope = ProviderContainer( + overrides: [ + timelineRulerSettingsRepositoryProvider.overrideWith( + (ref) => throw StateError('Desktop settings should not be loaded'), + ), + ], + ); + addTearDown(scope.dispose); + final controller = _controller(); + addTearDown(controller.dispose); + await tester.pumpWidget( + UncontrolledProviderScope( + container: scope, + child: MaterialApp( + theme: EditorTheme.forPalette( + AppPalette.graphite, + Brightness.light, + ), + home: Column( + children: [ + const TimelineRulerSettingsField(), + Expanded( + child: EditorTimelineViewport( + controller: controller, + child: TimelineView(controller: controller), + ), + ), + ], + ), + ), + ), + ); + await tester.pump(); + expect( + find.byKey(const Key('settings-timeline-ruler-style')), + findsNothing, + ); + expect( + tester.widget(find.byType(TimelineRuler)).style, + TimelineRulerStyle.elapsed, + ); + expect(scope.exists(timelineRulerSettingsProvider), isFalse); + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox.shrink()); + }, + ); +} + +TimelineViewController _controller() { + final kernel = TimelineKernel.importDto( + TimelineDto( + id: SequenceId('settings-test'), + format: TimelineFormat.fps30, + primaryStorylineId: StorylineId('primary'), + storylines: [ + StorylineDto(id: StorylineId('primary'), elementIds: const []), + ], + elements: const [], + ), + ); + final projection = const TimelineLayoutSceneBuilder().project( + version: kernel.current, + stacks: const [], + appearance: (_, _, _) => throw StateError('no connections'), + ); + final layout = TimelineLayoutEngine(kernel: kernel).initializeProjection( + kernel: kernel, + projection: projection, + policy: LayoutPolicy(version: 1, stacks: const []), + ); + return TimelineViewController( + version: layout.version, + storyline: kernel.current.query().primaryStoryline, + geometry: TimelineViewportGeometry(primaryTop: 0, primaryHeight: 48), + format: TimelineFormat.fps30, + camera: TimelineCamera( + baseTick: 0, + pixelsPerTick: 60 / TimelineClock.ticksPerSecond, + ), + ); +} diff --git a/test/timeline_switch_presentation_test.dart b/test/timeline_switch_presentation_test.dart new file mode 100644 index 0000000..f0ba973 --- /dev/null +++ b/test/timeline_switch_presentation_test.dart @@ -0,0 +1,226 @@ +import 'package:cutdex/features/projects/projects_page.dart'; + +import 'dart:async'; + +import 'package:cutdex/app/app.dart'; +import 'package:cutdex/features/editor/editor_panel_defaults.dart'; +import 'package:cutdex/features/preview/preview_panel.dart'; +import 'package:cutdex/features/properties/project_properties.dart'; +import 'package:cutdex/integrations/agent/conversation_repository.dart'; +import 'package:cutdex/integrations/platform/device_experience.dart'; +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex/workspace/media_availability.dart'; +import 'package:cutdex/workspace/project_state.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/timeline_provider.dart'; +import 'package:cutdex_sdk/project.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:drift/native.dart'; + +import 'support/empty_conversation_repository.dart'; +import 'support/memory_app_settings.dart'; +import 'support/preview_fixture.dart'; + +void main() { + testWidgets( + 'timeline navigation retains panels through preparation and failure', + (tester) async { + tester.view.physicalSize = const Size(1800, 900); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + final first = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/first.png'), + mediaType: 'image', + ), + ))!; + final second = (await tester.runAsync( + () => createPreviewFixture( + Uri.file('/test/second.png'), + mediaType: 'image', + renderSize: {'width': 1920, 'height': 1080}, + ), + ))!; + final projects = _DelayedTimelineProjects(); + final database = AppDatabase(NativeDatabase.memory()); + final container = ProviderContainer( + overrides: [ + deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), + appDatabaseProvider.overrideWithValue(database), + appearanceSettingsRepositoryProvider.overrideWithValue( + MemoryAppearanceSettingsRepository(), + ), + paletteSettingsRepositoryProvider.overrideWithValue( + MemoryPaletteSettingsRepository(), + ), + projectsProvider.overrideWith(() => projects), + conversationRepositoryProvider.overrideWith( + (ref) async => EmptyConversationRepository(), + ), + editorTimelineProvider( + 'project', + 'first', + ).overrideWith((ref) => first.timeline), + editorTimelineProvider( + 'project', + 'second', + ).overrideWith((ref) => second.timeline), + editorPreviewProvider.overrideWith((ref, ids) => null), + mediaAvailabilityProvider.overrideWith( + (ref, ids) async => MediaAvailability.missing, + ), + ], + ); + addTearDown(() async { + await tester.pumpWidget(const SizedBox()); + container.dispose(); + await tester.runAsync(() async { + await first.workspace.close(); + await second.workspace.close(); + await first.directory.delete(recursive: true); + await second.directory.delete(recursive: true); + await database.close(); + }); + }); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: const CutdexApp(), + ), + ); + await tester.pumpAndSettle(); + var windowBuilds = 0; + final previousBuild = debugOnRebuildDirtyWidget; + debugOnRebuildDirtyWidget = (element, built) { + previousBuild?.call(element, built); + if (element.widget is EditingPage || element.widget is MaterialApp) { + windowBuilds++; + } + }; + projects.updateAssets([ + AssetDocument( + id: 'new-media', + name: 'New media', + storage: AssetStorage.external, + location: 'file:///test/new.png', + metadata: const {'kind': 'image'}, + ), + ]); + await tester.pumpAndSettle(); + debugOnRebuildDirtyWidget = previousBuild; + expect( + windowBuilds, + 0, + reason: 'Asset changes belong to content, not window/navigation', + ); + await tester.tap(find.byKey(const Key('editor-properties-button'))); + await tester.pumpAndSettle(); + final properties = tester.element(find.byType(ProjectProperties)); + final preview = tester.element(find.byType(EditorPreviewPanel)); + final timeline = tester.element( + find.byKey(const Key('editor-timeline-surface')), + ); + final propertyRect = tester.getRect(find.byType(ProjectProperties)); + final canvasValue = tester.element(find.text('1080 × 1920 px')); + for (final success in [false, true]) { + await tester.tap(find.byKey(const ValueKey('timeline-tab-second'))); + await tester.pump(); + expect( + container.read(projectsProvider).requireValue.openingTimelineId, + 'second', + ); + expect( + tester.element(find.byType(ProjectProperties)), + same(properties), + ); + expect(tester.element(find.byType(EditorPreviewPanel)), same(preview)); + expect( + tester.element(find.byKey(const Key('editor-timeline-surface'))), + same(timeline), + ); + expect(tester.getRect(find.byType(ProjectProperties)), propertyRect); + expect(find.byType(EditorEmptyPanel), findsNothing); + expect(find.byKey(const Key('properties-pending')), findsNothing); + expect(find.byKey(const Key('timeline-default-tracks')), findsNothing); + expect(find.text('1080 × 1920 px'), findsOneWidget); + await tester.tap( + find.byKey(const ValueKey('project-settings-edit')), + warnIfMissed: false, + ); + await tester.pump(); + expect(find.byKey(const ValueKey('project-width')), findsNothing); + projects.finish(success); + await tester.pumpAndSettle(); + expect( + tester.element(find.byType(ProjectProperties)), + same(properties), + ); + expect(tester.getRect(find.byType(ProjectProperties)), propertyRect); + expect(tester.element(find.byType(EditorPreviewPanel)), same(preview)); + expect( + find.text(success ? '1920 × 1080 px' : '1080 × 1920 px'), + findsOneWidget, + ); + expect( + tester.element( + find.text(success ? '1920 × 1080 px' : '1080 × 1920 px'), + ), + same(canvasValue), + ); + expect(tester.takeException(), isNull); + } + await tester.tap(find.byKey(const ValueKey('project-settings-edit'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('project-width')), findsOneWidget); + }, + ); +} + +class _DelayedTimelineProjects extends Projects { + Completer? _pending; + void updateAssets(List assets) => + state = AsyncData(state.requireValue.copyWith(assets: assets)); + TimelineDocument _document(String id) => + TimelineDocument(id: id, name: id, sequences: []); + @override + Future build() async => ProjectState( + activeProject: const RecentProject( + id: 'project', + name: 'Project', + path: '/test/Project.cutdex', + ), + recent: const [ + RecentProject( + id: 'project', + name: 'Project', + path: '/test/Project.cutdex', + ), + ], + timelines: const [ + TimelineSummary(id: 'first', name: 'First', revision: 1), + TimelineSummary(id: 'second', name: 'Second', revision: 1), + ], + timeline: _document('first'), + ); + @override + Future openTimeline(String projectId, String timelineId) async { + _pending = Completer(); + state = AsyncData( + state.requireValue.copyWith(openingTimelineId: timelineId), + ); + final success = await _pending!.future; + state = AsyncData( + state.requireValue.copyWith( + timeline: success ? _document(timelineId) : state.requireValue.timeline, + openingTimelineId: null, + ), + ); + return success; + } + + void finish(bool success) => _pending!.complete(success); +} diff --git a/test/transcription_tools_test.dart b/test/transcription_tools_test.dart index 8c50074..c6af298 100644 --- a/test/transcription_tools_test.dart +++ b/test/transcription_tools_test.dart @@ -5,6 +5,7 @@ import 'package:crypto/crypto.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:cutdex/integrations/runtime/processing_resource_repository.dart'; import 'package:cutdex/l10n/app_localizations.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:cutdex_ui/widgets.dart'; @@ -1763,156 +1764,230 @@ void main() { }, ); - testWidgets( - 'MCP caption edit updates visible fields and undo restores them', - (tester) async { - late String id; - await tester.runAsync(() async { - final task = await applyFixture(); - final result = await session.applyTranscription( - sequence, - ApplyTranscription(taskId: task, clipId: 'clip'), - ); - id = (result['captionIds'] as List).single as String; - }); - await tester.pumpWidget( - MaterialApp( - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - locale: const Locale('zh'), + for (final desktop in [false, true]) { + testWidgets( + 'MCP caption edit desktop=$desktop updates visible fields and undo restores them', + (tester) async { + late String id; + await tester.runAsync(() async { + final task = await applyFixture(); + final result = await session.applyTranscription( + sequence, + ApplyTranscription(taskId: task, clipId: 'clip'), + ); + id = (result['captionIds'] as List).single as String; + }); + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), + theme: desktop + ? AppTheme.propertiesPanelTheme( + EditorTheme.desktop(EditorTheme.penDark), + ) + : EditorTheme.penDark, - home: Scaffold( - body: Align( - alignment: Alignment.topRight, - child: SizedBox( - width: 280, - child: CaptionProperties( - session: session, - sequence: sequence, - clipId: id, + home: Scaffold( + body: Align( + alignment: Alignment.topRight, + child: SizedBox( + width: 280, + child: CaptionProperties( + session: session, + sequence: sequence, + clipId: id, + ), ), ), ), ), - ), - ); - expect(find.text('测试字幕'), findsOneWidget); - expect( - find.ancestor(of: find.text('测试字幕'), matching: find.byType(ShaderMask)), - findsOneWidget, - ); - expect( - find.byKey(const ValueKey('caption-property-tab-captions')), - findsOneWidget, - ); - expect( - find.byKey(const ValueKey('caption-property-tab-text')), - findsOneWidget, - ); - for (final key in const [ - 'caption-fontSize', - 'caption-strokeWidth', - 'caption-positionY', - 'caption-start', - 'caption-duration', - ]) { - expect(find.byKey(Key(key)), findsOneWidget); - } - expect(find.text('描边颜色'), findsOneWidget); - await tester.runAsync(() async { - session.setCaption( - sequence, - SetCaption( - captionId: id, - start: CommandTime(1, 1000), - duration: CommandTime(1, 1000), - positionY: -.298, + ); + expect(find.text('测试字幕'), findsOneWidget); + expect( + find.ancestor( + of: find.text('测试字幕'), + matching: find.byType(ShaderMask), + ), + findsOneWidget, + ); + expect( + find.byKey(const ValueKey('caption-property-tab-captions')), + findsOneWidget, + ); + expect( + find.byKey(const ValueKey('caption-property-tab-text')), + findsOneWidget, + ); + for (final key in const [ + 'caption-fontSize', + 'caption-strokeWidth', + 'caption-positionY', + 'caption-start', + 'caption-duration', + ]) { + expect(find.byKey(Key(key)), findsOneWidget); + } + expect(find.text('描边颜色'), findsOneWidget); + await tester.runAsync(() async { + session.setCaption( + sequence, + SetCaption( + captionId: id, + start: CommandTime(1, 1000), + duration: CommandTime(1, 1000), + positionY: -.298, + ), + ); + await session.flush(); + }); + await tester.pump(); + String fieldText(String key) => tester + .widget( + find.descendant( + of: find.byKey(ValueKey(key)), + matching: find.byType(TextField), + ), + ) + .controller! + .text; + expect(fieldText('caption-start'), '0.001'); + expect(fieldText('caption-duration'), '0.001'); + expect(fieldText('caption-positionY'), '-0.298'); + await tester.runAsync(() async => session.undo(sequence)); + await tester.pump(); + + await tester.tap( + find.byKey(const ValueKey('caption-property-tab-captions')), + ); + await tester.pump(); + expect(find.byKey(ValueKey('caption-list-$id')), findsOneWidget); + expect(find.byKey(const Key('caption-fontSize')), findsNothing); + await tester.tap(find.byKey(ValueKey('caption-list-$id'))); + await tester.pump(); + expect(find.byKey(ValueKey('caption-list-$id')), findsOneWidget); + expect(find.byKey(const Key('caption-fontSize')), findsNothing); + await tester.tap( + find.byKey(const ValueKey('caption-property-tab-text')), + ); + await tester.pump(); + expect(find.byKey(const Key('caption-fontSize')), findsOneWidget); + final versionBeforeScrub = session.version; + await tester.drag(find.text('字号'), const Offset(50, 0)); + await tester.pump(); + expect(session.caption(sequence, id).fontSize, closeTo(58, 1e-9)); + expect(session.version, isNot(versionBeforeScrub)); + await tester.runAsync(() async => session.undo(sequence)); + await tester.pump(); + expect(session.caption(sequence, id).fontSize, 48); + final access = EditorToolAccess(session); + addTearDown(access.dispose); + final connection = access.server.connect(); + addTearDown(connection.close); + final response = await tester.runAsync( + () => connection.handleJson( + jsonEncode({ + 'jsonrpc': '2.0', + 'id': 1, + 'method': 'tools/call', + 'params': { + '_meta': { + 'io.modelcontextprotocol/protocolVersion': '2026-07-28', + 'io.modelcontextprotocol/clientCapabilities': + {}, + }, + 'name': 'caption.set', + 'arguments': { + 'workspaceId': access.workspaces.keys.single, + 'operationId': 'mcp-text', + 'captionId': id, + 'text': '来自 MCP 的字幕', + 'strokeColor': '#FF0000', + 'strokeWidth': 2, + }, + }, + }), ), ); - await session.flush(); - }); - await tester.pump(); - String fieldText(String key) => tester - .widget( - find.descendant( - of: find.byKey(ValueKey(key)), - matching: find.byType(TextField), - ), - ) - .controller! - .text; - expect(fieldText('caption-start'), '0.001'); - expect(fieldText('caption-duration'), '0.001'); - expect(fieldText('caption-positionY'), '-0.298'); - await tester.runAsync(() async => session.undo(sequence)); - await tester.pump(); + expect(response.toString(), contains('来自 MCP 的字幕')); + await tester.pump(); + expect(find.text('来自 MCP 的字幕'), findsOneWidget); + expect(session.caption(sequence, id).strokeColor, '#FF0000'); + expect(session.caption(sequence, id).strokeWidth, 2); + await tester.runAsync(() async { + session.undo(sequence); + }); + await tester.pump(); + expect(find.text('测试字幕'), findsOneWidget); + final role = session.captionRole(sequence)!; + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + locale: const Locale('zh'), - await tester.tap( - find.byKey(const ValueKey('caption-property-tab-captions')), - ); - await tester.pump(); - expect(find.byKey(ValueKey('caption-list-$id')), findsOneWidget); - expect(find.byKey(const Key('caption-fontSize')), findsNothing); - await tester.tap(find.byKey(ValueKey('caption-list-$id'))); - await tester.pump(); - expect(find.byKey(ValueKey('caption-list-$id')), findsOneWidget); - expect(find.byKey(const Key('caption-fontSize')), findsNothing); - await tester.tap(find.byKey(const ValueKey('caption-property-tab-text'))); - await tester.pump(); - expect(find.byKey(const Key('caption-fontSize')), findsOneWidget); - final versionBeforeScrub = session.version; - await tester.drag(find.text('字号'), const Offset(50, 0)); - await tester.pump(); - expect(session.caption(sequence, id).fontSize, closeTo(58, 1e-9)); - expect(session.version, isNot(versionBeforeScrub)); - await tester.runAsync(() async => session.undo(sequence)); - await tester.pump(); - expect(session.caption(sequence, id).fontSize, 48); - final access = EditorToolAccess(session); - addTearDown(access.dispose); - final connection = access.server.connect(); - addTearDown(connection.close); - final response = await tester.runAsync( - () => connection.handleJson( - jsonEncode({ - 'jsonrpc': '2.0', - 'id': 1, - 'method': 'tools/call', - 'params': { - '_meta': { - 'io.modelcontextprotocol/protocolVersion': '2026-07-28', - 'io.modelcontextprotocol/clientCapabilities': - {}, - }, - 'name': 'caption.set', - 'arguments': { - 'workspaceId': access.workspaces.keys.single, - 'operationId': 'mcp-text', - 'captionId': id, - 'text': '来自 MCP 的字幕', - 'strokeColor': '#FF0000', - 'strokeWidth': 2, - }, - }, - }), - ), - ); - expect(response.toString(), contains('来自 MCP 的字幕')); - await tester.pump(); - expect(find.text('来自 MCP 的字幕'), findsOneWidget); - expect(session.caption(sequence, id).strokeColor, '#FF0000'); - expect(session.caption(sequence, id).strokeWidth, 2); - await tester.runAsync(() async { - session.undo(sequence); - }); - await tester.pump(); - expect(find.text('测试字幕'), findsOneWidget); - final role = session.captionRole(sequence)!; - await tester.pumpWidget( - MaterialApp( + home: Scaffold( + body: SizedBox( + width: 280, + child: CaptionProperties( + session: session, + sequence: sequence, + clipId: session.persistence + .timeline(sequence) + .current + .query() + .element(role) + .id + .value, + ), + ), + ), + ), + ); + expect( + find.byKey(const ValueKey('caption-property-tab-captions')), + findsOneWidget, + ); + expect( + find.byKey(const ValueKey('caption-property-tab-text')), + findsNothing, + ); + expect(find.byKey(ValueKey('caption-list-$id')), findsOneWidget); + await tester.pumpWidget(const SizedBox.shrink()); + }, + ); + } + + for (final desktop in [false, true]) { + testWidgets( + 'caption overview desktop=$desktop selects the chosen text cue', + (tester) async { + await tester.binding.setSurfaceSize(const Size(280, 240)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + late String firstId; + late String secondId; + await tester.runAsync(() async { + final task = await applyFixture(); + final first = await session.applyTranscription( + sequence, + ApplyTranscription(taskId: task, clipId: 'clip'), + ); + final second = await session.applyTranscription( + sequence, + ApplyTranscription(taskId: task, clipId: 'clip'), + ); + firstId = (first['captionIds'] as List).single as String; + secondId = (second['captionIds'] as List).single as String; + }); + Widget panel(String clipId) => MaterialApp( localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, locale: const Locale('zh'), + theme: desktop + ? AppTheme.propertiesPanelTheme( + EditorTheme.desktop(EditorTheme.penDark), + ) + : EditorTheme.penDark, home: Scaffold( body: SizedBox( @@ -1920,220 +1995,174 @@ void main() { child: CaptionProperties( session: session, sequence: sequence, - clipId: session.persistence - .timeline(sequence) - .current - .query() - .element(role) - .id - .value, + clipId: clipId, ), ), ), - ), - ); - expect( - find.byKey(const ValueKey('caption-property-tab-captions')), - findsOneWidget, - ); - expect( - find.byKey(const ValueKey('caption-property-tab-text')), - findsNothing, - ); - expect(find.byKey(ValueKey('caption-list-$id')), findsOneWidget); - await tester.pumpWidget(const SizedBox.shrink()); - }, - ); + ); + await tester.pumpWidget(panel(firstId)); + await tester.tap( + find.byKey(const ValueKey('caption-property-tab-captions')), + ); + await tester.pump(); + for (final id in [firstId, secondId]) { + final row = tester.getRect(find.byKey(ValueKey('caption-list-$id'))); + final number = tester.getRect( + find.byKey(ValueKey('caption-number-$id')), + ); + final content = tester.getRect( + find.byKey(ValueKey('caption-content-$id')), + ); + final action = tester.getRect( + find.byKey(ValueKey('caption-action-$id')), + ); + expect(row.height, 28); + final list = tester.getRect( + find.ancestor( + of: find.byKey(ValueKey('caption-list-$id')), + matching: find.byType(ListView), + ), + ); + expect(row.left - list.left, desktop ? 12 : 14); + expect(number.left - row.left, 0); + expect(content.left - number.right, 6); + expect(number.right, lessThan(content.left)); + expect(content.right, lessThan(action.left)); + expect(number.center.dy, closeTo(content.center.dy, 0.1)); + expect(content.center.dy, closeTo(action.center.dy, 0.1)); + expect(action.right, lessThanOrEqualTo(row.right)); + } + await tester.runAsync(() async { + session.setCaption( + sequence, + SetCaption(captionId: secondId, text: 'Searchable CAPTION ' * 20), + ); + await session.flush(); + }); + await tester.pump(); + final search = find.byKey(const ValueKey('caption-search')); + final searchBounds = tester.getRect(search); + final wrapBounds = tester.getRect( + find.byKey(const ValueKey('caption-wrap-toggle')), + ); + expect(searchBounds.height, 28); + expect(wrapBounds.height, desktop ? 24 : 28); + expect(searchBounds.center.dy, wrapBounds.center.dy); + await tester.enterText(search, ' searchable '); + await tester.pump(); + expect(find.byKey(ValueKey('caption-list-$firstId')), findsNothing); + expect(find.byKey(ValueKey('caption-list-$secondId')), findsOneWidget); + expect( + tester + .widget(find.byKey(ValueKey('caption-number-$secondId'))) + .data, + '2', + ); + expect( + tester.getSize(find.byKey(ValueKey('caption-list-$secondId'))).height, + 28, + ); + await tester.enterText(search, 'no such caption'); + await tester.pump(); + expect(find.text('没有匹配的字幕'), findsOneWidget); + await tester.enterText(search, ''); + await tester.pump(); + expect(find.byKey(ValueKey('caption-list-$firstId')), findsOneWidget); + final toolbarPosition = tester.getTopLeft(search); + await tester.tap(find.byKey(const ValueKey('caption-wrap-toggle'))); + await tester.pump(); + expect( + tester.getSize(find.byKey(ValueKey('caption-list-$secondId'))).height, + greaterThan(28), + ); + expect(tester.getTopLeft(search), toolbarPosition); + final list = find.byKey(const ValueKey('caption-scroll-list')); + expect(list, findsOneWidget); + expect( + find.ancestor(of: search, matching: find.byType(ShaderMask)), + findsNothing, + ); + expect( + find.ancestor(of: list, matching: find.byType(ShaderMask)), + findsOneWidget, + ); + expect( + tester.widget(list).physics, + isA(), + ); + final scroll = tester + .state( + find.descendant(of: list, matching: find.byType(Scrollable)), + ) + .position; + expect(scroll.extentBefore, 0); + expect(scroll.extentAfter, greaterThan(24)); + await tester.drag(list, const Offset(0, -60)); + await tester.pumpAndSettle(); + expect(scroll.pixels, greaterThan(0)); + scroll.jumpTo(scroll.maxScrollExtent / 2); + await tester.pumpAndSettle(); + expect(scroll.extentBefore, greaterThan(0)); + expect(scroll.extentAfter, greaterThan(0)); + scroll.jumpTo(scroll.maxScrollExtent); + await tester.pumpAndSettle(); + expect(scroll.extentAfter, 0); + expect(tester.getTopLeft(search), toolbarPosition); + expect(tester.takeException(), isNull); + await tester.tap(find.byKey(const ValueKey('caption-wrap-toggle'))); + await tester.pump(); + expect( + tester.getSize(find.byKey(ValueKey('caption-list-$secondId'))).height, + 28, + ); + await tester.pumpAndSettle(); + expect(scroll.extentAfter, 0); + expect(scroll.extentBefore, 0); + await tester.tap(find.byKey(ValueKey('caption-action-$secondId'))); + await tester.pump(); - testWidgets('caption overview selects the chosen text cue', (tester) async { - await tester.binding.setSurfaceSize(const Size(280, 240)); - addTearDown(() => tester.binding.setSurfaceSize(null)); - late String firstId; - late String secondId; - await tester.runAsync(() async { - final task = await applyFixture(); - final first = await session.applyTranscription( - sequence, - ApplyTranscription(taskId: task, clipId: 'clip'), - ); - final second = await session.applyTranscription( - sequence, - ApplyTranscription(taskId: task, clipId: 'clip'), - ); - firstId = (first['captionIds'] as List).single as String; - secondId = (second['captionIds'] as List).single as String; - }); - Widget panel(String clipId) => MaterialApp( - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - locale: const Locale('zh'), - - home: Scaffold( - body: SizedBox( - width: 280, - child: CaptionProperties( - session: session, - sequence: sequence, - clipId: clipId, + final identity = session.view(sequence).selectedIdentities.single; + expect(identity, isA()); + final selected = session.resolveCaptionComponent( + sequence, + identity as LayoutBodyId, + ); + expect( + session.persistence + .timeline(sequence) + .current + .query() + .element(selected!) + .id + .value, + secondId, + ); + await tester.pumpWidget(panel(secondId)); + await tester.pumpAndSettle(); + final selectedRow = find.byKey(ValueKey('caption-list-$secondId')); + expect(selectedRow, findsOneWidget); + expect(find.byKey(const ValueKey('caption-search')), findsOneWidget); + expect(find.byKey(const Key('caption-fontSize')), findsNothing); + final selectedColor = Theme.of(tester.element(selectedRow)) + .colorScheme + .onSurface + .withValues(alpha: .05); + expect( + find.ancestor( + of: selectedRow, + matching: find.byWidgetPredicate( + (widget) => widget is Material && widget.color == selectedColor, + ), ), - ), - ), + findsOneWidget, + ); + await tester.tap(selectedRow); + await tester.pump(); + expect(selectedRow, findsOneWidget); + expect(find.byKey(const Key('caption-fontSize')), findsNothing); + }, ); - await tester.pumpWidget(panel(firstId)); - await tester.tap( - find.byKey(const ValueKey('caption-property-tab-captions')), - ); - await tester.pump(); - for (final id in [firstId, secondId]) { - final row = tester.getRect(find.byKey(ValueKey('caption-list-$id'))); - final number = tester.getRect(find.byKey(ValueKey('caption-number-$id'))); - final content = tester.getRect( - find.byKey(ValueKey('caption-content-$id')), - ); - final action = tester.getRect(find.byKey(ValueKey('caption-action-$id'))); - expect(row.height, 28); - final list = tester.getRect( - find.ancestor( - of: find.byKey(ValueKey('caption-list-$id')), - matching: find.byType(ListView), - ), - ); - expect(row.left - list.left, 14); - expect(number.left - row.left, 0); - expect(content.left - number.right, 6); - expect(number.right, lessThan(content.left)); - expect(content.right, lessThan(action.left)); - expect(number.center.dy, closeTo(content.center.dy, 0.1)); - expect(content.center.dy, closeTo(action.center.dy, 0.1)); - expect(action.right, lessThanOrEqualTo(row.right)); - } - await tester.runAsync(() async { - session.setCaption( - sequence, - SetCaption(captionId: secondId, text: 'Searchable CAPTION ' * 20), - ); - await session.flush(); - }); - await tester.pump(); - final search = find.byKey(const ValueKey('caption-search')); - final searchBounds = tester.getRect(search); - final wrapBounds = tester.getRect( - find.byKey(const ValueKey('caption-wrap-toggle')), - ); - expect(searchBounds.height, 28); - expect(wrapBounds.height, 28); - expect(searchBounds.top, wrapBounds.top); - expect(searchBounds.bottom, wrapBounds.bottom); - await tester.enterText(search, ' searchable '); - await tester.pump(); - expect(find.byKey(ValueKey('caption-list-$firstId')), findsNothing); - expect(find.byKey(ValueKey('caption-list-$secondId')), findsOneWidget); - expect( - tester - .widget(find.byKey(ValueKey('caption-number-$secondId'))) - .data, - '2', - ); - expect( - tester.getSize(find.byKey(ValueKey('caption-list-$secondId'))).height, - 28, - ); - await tester.enterText(search, 'no such caption'); - await tester.pump(); - expect(find.text('没有匹配的字幕'), findsOneWidget); - await tester.enterText(search, ''); - await tester.pump(); - expect(find.byKey(ValueKey('caption-list-$firstId')), findsOneWidget); - final toolbarPosition = tester.getTopLeft(search); - await tester.tap(find.byKey(const ValueKey('caption-wrap-toggle'))); - await tester.pump(); - expect( - tester.getSize(find.byKey(ValueKey('caption-list-$secondId'))).height, - greaterThan(28), - ); - expect(tester.getTopLeft(search), toolbarPosition); - final list = find.byKey(const ValueKey('caption-scroll-list')); - expect(list, findsOneWidget); - expect( - find.ancestor(of: search, matching: find.byType(ShaderMask)), - findsNothing, - ); - expect( - find.ancestor(of: list, matching: find.byType(ShaderMask)), - findsOneWidget, - ); - expect(tester.widget(list).physics, isA()); - final scroll = tester - .state( - find.descendant(of: list, matching: find.byType(Scrollable)), - ) - .position; - expect(scroll.extentBefore, 0); - expect(scroll.extentAfter, greaterThan(24)); - await tester.drag(list, const Offset(0, -60)); - await tester.pumpAndSettle(); - expect(scroll.pixels, greaterThan(0)); - scroll.jumpTo(scroll.maxScrollExtent / 2); - await tester.pumpAndSettle(); - expect(scroll.extentBefore, greaterThan(0)); - expect(scroll.extentAfter, greaterThan(0)); - scroll.jumpTo(scroll.maxScrollExtent); - await tester.pumpAndSettle(); - expect(scroll.extentAfter, 0); - expect(tester.getTopLeft(search), toolbarPosition); - expect(tester.takeException(), isNull); - await tester.tap(find.byKey(const ValueKey('caption-wrap-toggle'))); - await tester.pump(); - expect( - tester.getSize(find.byKey(ValueKey('caption-list-$secondId'))).height, - 28, - ); - await tester.pumpAndSettle(); - expect(scroll.extentAfter, 0); - expect(scroll.extentBefore, 0); - await tester.tap(find.byKey(ValueKey('caption-action-$secondId'))); - await tester.pump(); - - final identity = session.view(sequence).selectedIdentities.single; - expect(identity, isA()); - final selected = session.resolveCaptionComponent( - sequence, - identity as LayoutBodyId, - ); - expect( - session.persistence - .timeline(sequence) - .current - .query() - .element(selected!) - .id - .value, - secondId, - ); - await tester.pumpWidget(panel(secondId)); - await tester.pumpAndSettle(); - final selectedRow = find.byKey(ValueKey('caption-list-$secondId')); - expect(selectedRow, findsOneWidget); - expect(find.byKey(const ValueKey('caption-search')), findsOneWidget); - expect(find.byKey(const Key('caption-fontSize')), findsNothing); - final selectedColor = Theme.of(tester.element(selectedRow)) - .colorScheme - .onSurface - .withValues(alpha: .05); - expect( - find.ancestor( - of: selectedRow, - matching: find.byWidgetPredicate( - (widget) => widget is Material && widget.color == selectedColor, - ), - ), - findsOneWidget, - ); - await tester.tap(selectedRow); - await tester.pump(); - expect(selectedRow, findsOneWidget); - expect(find.byKey(const Key('caption-fontSize')), findsNothing); - }); + } test( 'completed transcription output is reused and persists inside the project', @@ -2552,7 +2581,7 @@ void main() { maxHeight: 180, builder: (_, toggle) => IconButton( onPressed: toggle, - icon: const Icon(Icons.task_alt), + icon: const Icon(AppIcons.success), ), child: BackgroundTasksContent(session: session), ), @@ -2566,7 +2595,7 @@ void main() { expect(find.text('后台任务'), findsNothing); expect(find.textContaining('字幕已生成'), findsOneWidget); expect(find.text('应用原文字幕'), findsNothing); - expect(find.byIcon(Icons.chevron_right), findsNothing); + expect(find.byIcon(AppIcons.chevronRight), findsNothing); final taskRow = find .ancestor(of: find.text('source'), matching: find.byType(InkWell)) .first; diff --git a/test/widget_test.dart b/test/widget_test.dart index 5ffe991..b7f03ff 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1,3 +1,4 @@ +import 'package:cutdex/workspace/workspace_navigation.dart'; import 'package:cutdex/workspace/workspace_mode.dart'; import 'package:cutdex/workspace/view_settings.dart'; import 'package:cutdex/app/editor_theme.dart'; @@ -14,13 +15,16 @@ import 'package:cutdex/features/timeline/timeline_panel.dart'; import 'package:cutdex/features/preview/preview_panel.dart'; import 'package:cutdex/features/properties/properties_panel.dart'; import 'package:cutdex/features/media/media_panel.dart'; +import 'package:cutdex/features/media/background_tasks_dialog.dart'; import 'package:cutdex/features/assistant/agent_chat_panel.dart'; import 'package:cutdex/features/editor/editor_page.dart'; +import 'package:cutdex/features/projects/project_sidebar.dart'; import 'package:cutdex/features/settings/settings_content.dart'; import 'package:cutdex/features/settings/appearance_settings.dart'; import 'support/memory_app_settings.dart'; +import 'package:cutdex_ui/icons.dart'; import 'package:cutdex_ui/theme.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; @@ -35,16 +39,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; -Future _hoverProjectHeader(WidgetTester tester) async { - final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); - await mouse.addPointer(location: Offset.zero); - await mouse.moveTo( - tester.getCenter(find.byKey(const Key('projects-heading'))), - ); - await tester.pumpAndSettle(); - addTearDown(mouse.removePointer); -} - void main() { testWidgets( 'desktop content switches retain editor, settings, draft and split widths', @@ -80,8 +74,8 @@ void main() { ); await tester.enterText(input, 'Keep settings draft'); await tester.drag( - find.byKey(const Key('agent-panel-resize')), - const Offset(-80, 0), + find.byKey(const Key('project-sidebar-resize')), + const Offset(80, 0), ); await tester.pumpAndSettle(); final agentWidth = tester.getSize(find.byType(AgentChatPanel)).width; @@ -90,14 +84,31 @@ void main() { final header = tester.element( find.byKey(const Key('desktop-window-header')), ); - final rail = tester.element( - find.byKey(const Key('desktop-navigation-rail')), + final taskButtonFinder = find.byKey( + const ValueKey('background-tasks-button'), + ); + final taskButton = tester.element(taskButtonFinder); + expect( + find.descendant( + of: find.byKey(const Key('desktop-window-header')), + matching: taskButtonFinder, + ), + findsOneWidget, + ); + expect( + find.descendant( + of: find.byKey(const Key('editor-content-header')), + matching: taskButtonFinder, + ), + findsNothing, ); final route = container .read(appRouterProvider) .routeInformationProvider .value .uri; + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); await tester.tap(find.byKey(const Key('project-settings-button'))); await tester.pumpAndSettle(); expect( @@ -109,7 +120,18 @@ void main() { final contentCard = find.byKey(const Key('settings-content-card')); final navigationRect = tester.getRect(navigationCard); final settingsRect = tester.getRect(contentCard); - expect(settingsRect.left - navigationRect.right, 1); + final settingsBack = find.byKey(const Key('settings-sidebar-back')); + expect(settingsBack, findsOneWidget); + expect(navigationRect.contains(tester.getCenter(settingsBack)), isTrue); + expect( + tester.getRect(settingsBack).bottom, + lessThan( + tester + .getRect(find.byKey(const ValueKey('settings-navigation-0'))) + .top, + ), + ); + expect(settingsRect.left - navigationRect.right, 6); expect(settingsRect.top, navigationRect.top); expect(settingsRect.bottom, navigationRect.bottom); expect(find.byKey(const Key('settings-sidebar-divider')), findsNothing); @@ -124,10 +146,13 @@ void main() { tester.element(find.byKey(const Key('desktop-window-header'))), same(header), ); - expect( - tester.element(find.byKey(const Key('desktop-navigation-rail'))), - same(rail), - ); + expect(tester.element(taskButtonFinder), same(taskButton)); + await tester.tap(taskButtonFinder); + await tester.pumpAndSettle(); + expect(find.byType(BackgroundTasksContent), findsOneWidget); + await tester.tap(taskButtonFinder); + await tester.pumpAndSettle(); + expect(find.byType(BackgroundTasksContent), findsNothing); expect( container.read(appRouterProvider).routeInformationProvider.value.uri, route, @@ -145,16 +170,18 @@ void main() { await tester.tap(find.byKey(const ValueKey('settings-navigation-1'))); await tester.pumpAndSettle(); final settings = tester.element(find.byType(SettingsContent)); - await tester.tap(find.byKey(const Key('desktop-rail-library'))); + await tester.tap(find.byKey(const ValueKey('project-tab-project'))); await tester.pumpAndSettle(); expect(find.byType(SettingsContent), findsNothing); expect(find.byKey(const Key('desktop-library-workspace')), findsNothing); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pumpAndSettle(); await tester.tap(find.byKey(const Key('project-settings-button'))); await tester.pumpAndSettle(); expect(tester.element(find.byType(SettingsContent)), same(settings)); expect(find.byKey(const Key('agent-settings-scroll')), findsOneWidget); - expect(find.byKey(const Key('desktop-rail-cut')), findsOneWidget); - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); + expect(find.byKey(const ValueKey('project-tab-project')), findsOneWidget); + await tester.tap(settingsBack); await tester.pumpAndSettle(); expect(find.byKey(const Key('desktop-settings-workspace')), findsNothing); expect(tester.element(find.byType(EditorWorkspace)), same(editor)); @@ -226,62 +253,22 @@ void main() { matching: find.byType(TextField), ); expect(input, findsOneWidget); - final projectBar = find.byKey(const Key('composer-project-bar')); - final composer = find.byKey(const Key('agent-composer')); - expect(tester.getSize(projectBar).height, 60); - expect( - tester.getRect(projectBar).left, - tester.getRect(composer).left + 13, - ); - expect( - tester.getRect(projectBar).right, - tester.getRect(composer).right - 13, - ); - expect(tester.getRect(projectBar).top + 38, tester.getRect(composer).top); - expect(find.text('Select project'), findsOneWidget); + expect(find.byKey(const Key('composer-project-bar')), findsNothing); + expect(find.byKey(const Key('window-project-tabs')), findsOneWidget); await tester.enterText(input, 'Keep this before selecting'); - await tester.tap(find.byKey(const Key('composer-project-trigger'))); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); await tester.pumpAndSettle(); - final search = find.byKey(const Key('composer-project-search')); - void expectProjectMenuAbove() { - final menu = find.ancestor( - of: search, - matching: find.byWidgetPredicate( - (widget) => widget.runtimeType.toString() == '_MenuPanel', - ), - ); - expect( - tester.getRect(menu).bottom + 4, - closeTo( - tester - .getRect(find.byKey(const Key('composer-project-trigger'))) - .top, - 1, - ), - ); - } - - expectProjectMenuAbove(); - await tester.enterText(search, 'unmatched'); + await tester.tap(find.byKey(const ValueKey('project-menu-project'))); await tester.pumpAndSettle(); - expectProjectMenuAbove(); - expect(find.text('No matching projects'), findsOneWidget); - expect(find.byKey(const Key('composer-new-project')), findsOneWidget); - await tester.enterText(search, '测试'); - await tester.pumpAndSettle(); - await tester.tap(find.byKey(const ValueKey('composer-project-project'))); - await tester.pumpAndSettle(); - expect(search, findsNothing); + expect(find.byKey(const ValueKey('project-tab-project')), findsOneWidget); expect( tester.widget(input).controller!.text, 'Keep this before selecting', ); - expect(find.text('Select project'), findsNothing); - await tester.tap(find.byKey(const Key('composer-project-trigger'))); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); await tester.pumpAndSettle(); - await tester.tap(find.byKey(const Key('composer-new-project'))); + await tester.tap(find.text('New project')); await tester.pumpAndSettle(); - expect(search, findsNothing); expect(find.byKey(const Key('app-dialog-frame')), findsOneWidget); await tester.tap(find.text('Cancel')); await tester.pumpAndSettle(); @@ -328,28 +315,27 @@ void main() { ), ); await tester.pumpAndSettle(); - final chatRow = find.byKey( - const ValueKey('sidebar-conversation-retained-chat'), + final container = ProviderScope.containerOf( + tester.element(find.byType(CutdexApp)), ); - final retainedRow = tester.element(chatRow); - final untouchedProjectRow = tester.widget( - find.byKey(const ValueKey('sidebar-project-third')), - ); - bool selected(String id) => tester - .widget(find.byKey(ValueKey('sidebar-project-$id'))) - .selected; + bool selected(String id) => + (container.read(workspaceNavigationProvider).selectedProjectId ?? + projects.state.requireValue.activeProject?.id) == + id; Future click(String id) async { - await tester.tap(find.byKey(ValueKey('sidebar-project-$id'))); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); + await tester.pump(); + await tester.tap(find.byKey(ValueKey('project-menu-$id'))); + await tester.pump(); await tester.pump(); } await click('other'); - expect( - tester.widget( - find.byKey(const ValueKey('sidebar-project-third')), - ), - same(untouchedProjectRow), - ); + expect(selected('other'), isTrue); + expect(find.byKey(const ValueKey('project-tab-other')), findsOneWidget); + await tester.tap(find.byKey(const Key('project-tabs-add'))); + await tester.pump(); + expect(find.byKey(const Key('app-dialog-frame')), findsNothing); expect(selected('other'), isTrue); expect(projects.requests, isEmpty); expect(find.byKey(const Key('editor-preview-card')), findsOneWidget); @@ -374,11 +360,10 @@ void main() { expect(projects.requests.map((r) => r.$1), ['third']); expect(selected('third'), isTrue); expect(find.byKey(const Key('editor-project-loading')), findsNothing); - await tester.pump(const Duration(milliseconds: 70)); - expect(find.byKey(const Key('preview-default-frame')), findsOneWidget); - expect(find.byKey(const Key('timeline-default-tracks')), findsOneWidget); + await tester.pump(const Duration(seconds: 2)); + expect(find.byKey(const Key('preview-default-frame')), findsNothing); + expect(find.byKey(const Key('timeline-default-tracks')), findsNothing); expect(find.byKey(const Key('editor-project-loading')), findsNothing); - expect(find.byType(CircularProgressIndicator), findsNothing); expect( tester.element(find.byKey(const Key('editor-preview-card'))), same(previewCard), @@ -389,7 +374,7 @@ void main() { ); expect( tester.widget(find.byType(EditorWorkspace)).projectName, - 'Third Project', + '测试项目', ); await click('other'); expect(selected('other'), isTrue); @@ -408,9 +393,7 @@ void main() { await tester.pump(const Duration(milliseconds: 100)); projects.requests.last.$2.complete(true); await tester.pump(); - expect(tester.element(chatRow), same(retainedRow)); await tester.pumpAndSettle(); - expect(tester.element(chatRow), same(retainedRow)); expect(selected('other'), isTrue); expect(projects.requests.length, 3); await click('other'); @@ -438,25 +421,19 @@ void main() { ), ); await tester.pumpAndSettle(); + expect(find.byKey(const Key('project-tabs-add')), findsOneWidget); + expect(find.byKey(const ValueKey('project-tab-project')), findsOneWidget); expect( tester - .widget(find.byKey(const Key('create-project'))) + .widget(find.byKey(const Key('project-tabs-add'))) .onPressed, isNotNull, ); - expect( - tester - .widget( - find.byKey(const ValueKey('sidebar-project-project')), - ) - .enabled, - isTrue, - ); - expect(find.byKey(const Key('projects-heading')), findsOneWidget); + expect(find.byKey(const Key('project-chat-header')), findsOneWidget); final addTimeline = find.byKey(const Key('timeline-add-button')); expect(tester.widget(addTimeline).onPressed, isNotNull); expect( - find.descendant(of: addTimeline, matching: find.byIcon(Icons.add)), + find.descendant(of: addTimeline, matching: find.byIcon(AppIcons.add)), findsOneWidget, ); expect( @@ -495,24 +472,12 @@ void main() { UncontrolledProviderScope(container: container, child: const CutdexApp()), ); await tester.pumpAndSettle(); - await tester.tap(find.byKey(const Key('projects-heading'))); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('project-popover')), findsNothing); - final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); - await mouse.addPointer(location: Offset.zero); - await mouse.moveTo( - tester.getCenter(find.byKey(const ValueKey('sidebar-project-project'))), - ); - await tester.pumpAndSettle(); - await tester.tap( - find.byKey(const ValueKey('new-agent-conversation-project')), - ); - await mouse.removePointer(); + await tester.tap(find.byKey(const Key('project-chat-new'))); await tester.pumpAndSettle(); expect(await tester.runAsync(repository.root.exists), isFalse); }); - testWidgets('sidebar mode is saved and restored after rebuilding the app', ( + testWidgets('saved workflow preferences keep the project workspace visible', ( tester, ) async { tester.view.physicalSize = const Size(1200, 800); @@ -551,414 +516,141 @@ void main() { } await launch(); - expect(find.byKey(const Key('desktop-agent-card')), findsOneWidget); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); await switchMode('cut'); expect(settings.value.mode, WorkspaceMode.cut); await tester.pumpWidget(const SizedBox()); await launch(); - expect(find.byKey(const Key('desktop-project-card')), findsOneWidget); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); await switchMode('agent'); expect(settings.value.mode, WorkspaceMode.agent); await tester.pumpWidget(const SizedBox()); await launch(); - expect(find.byKey(const Key('desktop-agent-card')), findsOneWidget); - }); - - testWidgets('sidebar mode defaults to Agent and can select Cut', ( - tester, - ) async { - tester.view.physicalSize = const Size(1200, 800); - tester.view.devicePixelRatio = 1; - addTearDown(tester.view.resetPhysicalSize); - addTearDown(tester.view.resetDevicePixelRatio); - await tester.pumpWidget( - ProviderScope( - overrides: [ - deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), - conversationRepositoryProvider.overrideWith( - (ref) async => EmptyConversationRepository(), - ), - projectsProvider.overrideWith(_TestProjects.new), - ], - child: const CutdexApp(), - ), - ); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('desktop-agent-card')), findsOneWidget); - Color chatSurface() => tester - .element(find.byKey(const Key('agent-conversation'))) - .findAncestorWidgetOfExactType()! - .color!; - ColorScheme chatColors() => - Theme.of(tester.element(find.byKey(const Key('agent-conversation')))) - .colorScheme; - expect( - tester - .widget(find.byKey(const Key('agent-conversation'))) - .child, - isNot(isA()), - ); - expect(chatSurface(), chatColors().surface); - final projectTitle = find.byKey(const Key('workspace-project-title')); - expect( - find.descendant( - of: find.byKey(const Key('agent-content-header')), - matching: projectTitle, - ), - findsNothing, - ); - final chatElement = tester.element(find.byType(AgentChatPanel)); - final editorElement = tester.element(find.byType(EditorWorkspace)); - final input = find.descendant( - of: find.byType(AgentChatPanel), - matching: find.byType(TextField), - ); - await tester.enterText(input, 'Keep this draft'); - expect(find.byKey(const Key('sidebar-mode-trigger')), findsNothing); - final container = ProviderScope.containerOf( - tester.element(find.byType(CutdexApp)), - ); - container - .read(workspaceViewSettingsProvider.notifier) - .setMode(WorkspaceMode.cut); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('desktop-project-card')), findsOneWidget); - expect(chatSurface(), chatColors().surface); - expect(tester.element(find.byType(AgentChatPanel)), same(chatElement)); - expect(tester.element(find.byType(EditorWorkspace)), same(editorElement)); - expect(tester.widget(input).controller!.text, 'Keep this draft'); - container - .read(workspaceViewSettingsProvider.notifier) - .setMode(WorkspaceMode.agent); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('desktop-agent-card')), findsOneWidget); - expect(tester.element(find.byType(AgentChatPanel)), same(chatElement)); - expect(tester.element(find.byType(EditorWorkspace)), same(editorElement)); - expect(tester.widget(input).controller!.text, 'Keep this draft'); - }); - - testWidgets('Agent left gutter resizes independently and respects limits', ( - tester, - ) async { - tester.view.physicalSize = const Size(1200, 800); - tester.view.devicePixelRatio = 1; - addTearDown(tester.view.resetPhysicalSize); - addTearDown(tester.view.resetDevicePixelRatio); - await tester.pumpWidget( - ProviderScope( - overrides: [ - deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), - conversationRepositoryProvider.overrideWith( - (ref) async => EmptyConversationRepository(), - ), - projectsProvider.overrideWith(_TestProjects.new), - ], - child: const CutdexApp(), - ), - ); - await tester.pumpAndSettle(); - final navigation = find.byKey(const Key('sidebar-projects-conversations')); - final resize = find.byKey(const Key('agent-panel-resize')); - final navigationWidth = tester.getSize(navigation).width; - final chatWidth = tester.getSize(find.byType(AgentChatPanel)).width; - final chatElement = tester.element(find.byType(AgentChatPanel)); - await tester.drag(resize, const Offset(-80, 0)); - await tester.pumpAndSettle(); - expect(tester.getSize(find.byType(AgentChatPanel)).width, chatWidth + 80); - expect(tester.getSize(navigation).width, navigationWidth); - expect(tester.element(find.byType(AgentChatPanel)), same(chatElement)); - await tester.drag(resize, const Offset(2000, 0)); - await tester.pumpAndSettle(); - expect( - tester.getSize(find.byType(AgentChatPanel)).width, - greaterThanOrEqualTo(218), - ); - await tester.drag(resize, const Offset(-2000, 0)); - await tester.pumpAndSettle(); - expect(find.byType(EditorWorkspace), findsOneWidget); - expect(tester.getSize(find.byType(EditorWorkspace)).width, 480); - expect(tester.getSize(navigation).width, navigationWidth); - expect(tester.takeException(), isNull); - }); - - testWidgets('Agent fullscreen preserves sidebar, draft and editor state', ( - tester, - ) async { - tester.view.physicalSize = const Size(1400, 800); - tester.view.devicePixelRatio = 1; - addTearDown(tester.view.resetPhysicalSize); - addTearDown(tester.view.resetDevicePixelRatio); - await tester.pumpWidget( - ProviderScope( - overrides: [ - deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), - conversationRepositoryProvider.overrideWith( - (ref) async => EmptyConversationRepository(), - ), - projectsProvider.overrideWith(_TestProjects.new), - ], - child: const CutdexApp(), - ), - ); - await tester.pumpAndSettle(); - final editor = tester.element(find.byType(EditorWorkspace)); - final agent = tester.element(find.byType(AgentChatPanel)); - final sidebar = find.byKey(const Key('sidebar-projects-conversations')); - final sidebarWidth = tester.getSize(sidebar).width; - final previewHeaderRect = tester.getRect( - find.byKey(const Key('editor-content-header')), - ); - final agentHeaderRect = tester.getRect( - find.byKey(const Key('agent-content-header')), - ); - expect(previewHeaderRect.top, agentHeaderRect.top); - expect(previewHeaderRect.bottom, agentHeaderRect.bottom); - expect(previewHeaderRect.height, 40); - expect(find.byKey(const Key('sidebar-tab-projects')), findsNothing); - final fullscreenRect = tester.getRect( - find.byKey(const Key('agent-fullscreen-button')), - ); - expect(fullscreenRect.size, const Size.square(28)); - final previewHeader = tester.getRect( - find.byKey(const Key('editor-content-header')), - ); - final previewButton = tester.getRect( - find.byKey(const Key('editor-properties-button')), - ); - expect( - previewHeader.right - previewButton.right, - AppSidebarMetrics.outerPadding, - ); - final agentHeader = tester.getRect( - find.byKey(const Key('agent-content-header')), - ); - expect(find.byKey(const Key('sidebar-tab-projects')), findsNothing); - expect(agentHeader.right - fullscreenRect.right, AppSpacing.gap); - expect( - fullscreenRect.center.dy, - tester.getCenter(find.byKey(const Key('editor-properties-button'))).dy, - ); - final input = find.descendant( - of: find.byType(AgentChatPanel), - matching: find.byType(TextField), - ); - await tester.enterText(input, 'Keep fullscreen draft'); - final resize = find.byKey(const Key('agent-panel-resize')); - await tester.drag(resize, const Offset(-2000, 0)); - await tester.pumpAndSettle(); - expect(tester.getSize(find.byType(EditorWorkspace)).width, 480); - final agentWidth = tester.getSize(find.byType(AgentChatPanel)).width; - final fullscreen = find.byKey(const Key('agent-fullscreen-button')); - expect(tester.widget(fullscreen).isSelected, isFalse); - expect( - find.descendant( - of: find.byKey(const Key('agent-content-header')), - matching: fullscreen, - ), - findsOneWidget, - ); - await tester.tap(fullscreen); - await tester.pumpAndSettle(); - expect(tester.widget(fullscreen).isSelected, isTrue); - expect(find.byType(EditorWorkspace), findsNothing); - expect( - tester.element(find.byType(EditorWorkspace, skipOffstage: false)), - same(editor), - ); - expect(tester.getSize(sidebar).width, sidebarWidth); - expect(tester.element(find.byType(AgentChatPanel)), same(agent)); - expect(resize, findsNothing); - expect( - tester.widget(input).controller!.text, - 'Keep fullscreen draft', - ); - await tester.tap(fullscreen); - await tester.pumpAndSettle(); - expect(tester.widget(fullscreen).isSelected, isFalse); - expect(tester.element(find.byType(EditorWorkspace)), same(editor)); - expect(tester.getSize(find.byType(AgentChatPanel)).width, agentWidth); - expect(tester.getSize(sidebar).width, sidebarWidth); - expect( - tester.widget(input).controller!.text, - 'Keep fullscreen draft', - ); - expect(resize, findsOneWidget); - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); - await tester.pumpAndSettle(); - await tester.tap(fullscreen); - await tester.pumpAndSettle(); - expect(find.byType(EditorWorkspace), findsNothing); - expect(tester.getSize(sidebar).width, sidebarWidth); - expect(tester.element(find.byType(AgentChatPanel)), same(agent)); - await tester.tap(fullscreen); - await tester.pumpAndSettle(); - expect(tester.element(find.byType(EditorWorkspace)), same(editor)); - expect(tester.getSize(find.byType(AgentChatPanel)).width, agentWidth); - expect(tester.takeException(), isNull); - }); - testWidgets('sidebar groups conversations under projects', (tester) async { - tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark; - addTearDown(tester.platformDispatcher.clearPlatformBrightnessTestValue); - tester.view.physicalSize = const Size(1200, 800); - tester.view.devicePixelRatio = 1; - addTearDown(tester.view.resetPhysicalSize); - addTearDown(tester.view.resetDevicePixelRatio); - ConversationMetadata conversation(String projectId, int index) => - ConversationMetadata( - id: '$projectId-$index', - projectId: projectId, - title: 'Conversation $index', - createdAt: DateTime.utc(2026, 9, 24), - updatedAt: DateTime.utc(2026, 9, 24), - providerId: 'provider', - modelId: 'model', - timelineId: projectId, - pending: false, - responseDurationsMs: const [], - ); - final repository = _GroupedConversationRepository({ - 'project': [for (var i = 1; i <= 7; i++) conversation('project', i)], - 'other': [conversation('other', 1)], - }); - await tester.pumpWidget( - ProviderScope( - overrides: [ - deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), - projectsProvider.overrideWith(_GroupedProjects.new), - conversationRepositoryProvider.overrideWith( - (ref) async => repository, - ), - ], - child: const CutdexApp(), - ), - ); - await tester.pumpAndSettle(); - expect( - find.byKey(const ValueKey('sidebar-project-project')), - findsOneWidget, - ); - expect(find.byKey(const ValueKey('sidebar-project-other')), findsOneWidget); - expect( - find.byKey(const ValueKey('sidebar-conversation-project-1')), - findsOneWidget, - ); - expect( - find.byKey(const ValueKey('sidebar-conversation-project-6')), - findsNothing, - ); - expect( - find.byKey(const ValueKey('sidebar-conversation-other-1')), - findsOneWidget, - ); - final projectRow = find.byKey(const ValueKey('sidebar-project-project')); - final chatRow = find.byKey( - const ValueKey('sidebar-conversation-project-1'), - ); - expect(tester.getSize(projectRow).height, 30); - expect(tester.getSize(chatRow).height, 30); - final selectedProjectTile = tester.widget(projectRow); - expect(selectedProjectTile.selected, isTrue); - expect( - selectedProjectTile.hoverColor, - AppSidebarColors.of(tester.element(projectRow)).hover, - ); - expect( - selectedProjectTile.focusColor, - AppSidebarColors.of(tester.element(projectRow)).hover, - ); - expect(find.byKey(const Key('sidebar-mode-trigger')), findsNothing); - expect( - tester.getTopLeft(find.byKey(const Key('projects-heading'))).dy - - tester - .getBottomLeft(find.byKey(const Key('projects-window-header'))) - .dy, - AppSpacing.gap, - ); - final conversationText = tester.widget( - find.descendant(of: chatRow, matching: find.text('Conversation 1')), - ); - expect(conversationText.style?.fontSize, 14); - expect(conversationText.style?.height, closeTo(20 / 14, 0.001)); - expect(conversationText.style?.fontVariations, isNull); - expect( - conversationText.style?.color, - const Color(0xFFFCFCFC).withValues(alpha: 0.85), - ); - expect( - tester - .getTopLeft( - find.byKey(const ValueKey('sidebar-conversation-project-2')), - ) - .dy - - tester.getTopLeft(chatRow).dy, - 31, - ); - expect(tester.getRect(chatRow).left, tester.getRect(projectRow).left); - expect(tester.getRect(chatRow).right, tester.getRect(projectRow).right); - expect( - tester - .getTopLeft( - find.descendant(of: chatRow, matching: find.text('Conversation 1')), - ) - .dx, - tester - .getTopLeft( - find.descendant(of: projectRow, matching: find.byType(Text)).first, - ) - .dx, - ); - await tester.tap(chatRow, buttons: kSecondaryMouseButton); - await tester.pumpAndSettle(); - await tester.tap(find.text('Rename')); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('app-dialog-frame')), findsOneWidget); - expect(find.text('Rename chat'), findsOneWidget); - expect(find.text('Keep it short and easy to recognize.'), findsOneWidget); - await tester.enterText(find.byType(TextFormField), 'Updated chat'); - await tester.tap(find.widgetWithText(FilledButton, 'Save')); - await tester.pumpAndSettle(); - expect(repository.groups['project']!.first.title, 'Updated chat'); - expect(find.text('Updated chat'), findsOneWidget); - await tester.tap(chatRow, buttons: kSecondaryMouseButton); - await tester.pumpAndSettle(); - await tester.tap(find.text('Delete permanently…')); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('app-dialog-frame')), findsOneWidget); - expect(find.textContaining('This cannot be undone.'), findsOneWidget); - await tester.tap(find.text('Cancel')); - await tester.pumpAndSettle(); - expect(chatRow, findsOneWidget); - await tester.tap( - find.byKey(const ValueKey('sidebar-project-toggle-project')), - ); - await tester.pumpAndSettle(); - expect(chatRow, findsNothing); - expect( - tester - .getTopLeft(find.byKey(const ValueKey('sidebar-project-other'))) - .dy - - tester.getBottomLeft(projectRow).dy, - 1, - ); - await tester.tap( - find.byKey(const ValueKey('sidebar-project-toggle-project')), - ); - await tester.pumpAndSettle(); - await tester.tap(find.text('Show more')); - await tester.pumpAndSettle(); - expect( - find.byKey(const ValueKey('sidebar-conversation-project-7')), - findsOneWidget, - ); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); }); testWidgets( - 'empty project hint follows expansion and project menu offers removal', + 'workflow changes preserve chat and editor in the project workspace', (tester) async { tester.view.physicalSize = const Size(1200, 800); tester.view.devicePixelRatio = 1; addTearDown(tester.view.resetPhysicalSize); addTearDown(tester.view.resetDevicePixelRatio); + await tester.pumpWidget( + ProviderScope( + overrides: [ + deviceExperienceProvider.overrideWithValue( + DeviceExperience.desktop, + ), + conversationRepositoryProvider.overrideWith( + (ref) async => EmptyConversationRepository(), + ), + projectsProvider.overrideWith(_TestProjects.new), + ], + child: const CutdexApp(), + ), + ); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); + Color chatSurface() => tester + .element( + find.byKey(const Key('agent-conversation'), skipOffstage: false), + ) + .findAncestorWidgetOfExactType()! + .color!; + ColorScheme chatColors() => Theme.of( + tester.element( + find.byKey(const Key('agent-conversation'), skipOffstage: false), + ), + ).colorScheme; + expect( + tester + .widget( + find.byKey(const Key('agent-conversation'), skipOffstage: false), + ) + .child, + isNot(isA()), + ); + expect(chatSurface(), chatColors().surface); + final projectTitle = find.byKey(const Key('workspace-project-title')); + expect( + find.descendant( + of: find.byKey(const Key('agent-content-header')), + matching: projectTitle, + ), + findsNothing, + ); + final chatElement = tester.element( + find.byType(AgentChatPanel, skipOffstage: false), + ); + final editorElement = tester.element(find.byType(EditorWorkspace)); + final input = find.descendant( + of: find.byType(AgentChatPanel, skipOffstage: false), + matching: find.byType(TextField, skipOffstage: false), + ); + await tester.enterText(input, 'Keep this draft'); + expect(find.byKey(const Key('sidebar-mode-trigger')), findsNothing); + final container = ProviderScope.containerOf( + tester.element(find.byType(CutdexApp)), + ); + container + .read(workspaceViewSettingsProvider.notifier) + .setMode(WorkspaceMode.cut); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); + expect(chatSurface(), chatColors().surface); + expect( + tester.element(find.byType(AgentChatPanel, skipOffstage: false)), + same(chatElement), + ); + expect(tester.element(find.byType(EditorWorkspace)), same(editorElement)); + expect( + tester.widget(input).controller!.text, + 'Keep this draft', + ); + container + .read(workspaceViewSettingsProvider.notifier) + .setMode(WorkspaceMode.agent); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); + expect( + tester.element(find.byType(AgentChatPanel, skipOffstage: false)), + same(chatElement), + ); + expect(tester.element(find.byType(EditorWorkspace)), same(editorElement)); + expect( + tester.widget(input).controller!.text, + 'Keep this draft', + ); + }, + ); + + testWidgets( + 'chat history contains only current project conversations and can rename', + (tester) async { + tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark; + addTearDown(tester.platformDispatcher.clearPlatformBrightnessTestValue); + tester.view.physicalSize = const Size(1200, 800); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + ConversationMetadata conversation(String projectId, int index) => + ConversationMetadata( + id: '$projectId-$index', + projectId: projectId, + title: 'Conversation $index', + createdAt: DateTime.utc(2026, 9, 24), + updatedAt: DateTime.utc(2026, 9, 24), + providerId: 'provider', + modelId: 'model', + timelineId: projectId, + pending: false, + responseDurationsMs: const [], + ); + final repository = _GroupedConversationRepository({ + 'project': [for (var i = 1; i <= 7; i++) conversation('project', i)], + 'other': [conversation('other', 1)], + }); await tester.pumpWidget( ProviderScope( overrides: [ @@ -967,30 +659,76 @@ void main() { ), projectsProvider.overrideWith(_GroupedProjects.new), conversationRepositoryProvider.overrideWith( - (ref) async => _GroupedConversationRepository({}), + (ref) async => repository, ), ], child: const CutdexApp(), ), ); await tester.pumpAndSettle(); - final hint = find.byKey(const ValueKey('sidebar-project-empty-other')); - expect(hint, findsOneWidget); - await tester.tap( - find.byKey(const ValueKey('sidebar-project-toggle-other')), + expect(find.byKey(const ValueKey('project-tab-project')), findsOneWidget); + expect( + find.byKey(const ValueKey('sidebar-project-project')), + findsNothing, ); + await tester.tap(find.byKey(const Key('project-chat-history'))); await tester.pumpAndSettle(); - expect(hint, findsNothing); - await tester.tap( - find.byKey(const ValueKey('sidebar-project-other')), - buttons: kSecondaryMouseButton, + final chatRow = find.byKey( + const ValueKey('sidebar-conversation-project-1'), ); + expect(chatRow, findsOneWidget); + expect( + find.byKey(const ValueKey('sidebar-conversation-project-7')), + findsOneWidget, + ); + expect( + find.byKey(const ValueKey('sidebar-conversation-other-1')), + findsNothing, + ); + expect(tester.getSize(chatRow).height, AppMenuMetrics.rowHeight); + await tester.tap(chatRow, buttons: kSecondaryMouseButton); await tester.pumpAndSettle(); - expect(find.text('Remove from sidebar'), findsOneWidget); + await tester.tap(find.text('Rename')); + await tester.pumpAndSettle(); + await tester.enterText(find.byType(TextFormField), 'Updated chat'); + await tester.tap(find.widgetWithText(FilledButton, 'Save')); + await tester.pumpAndSettle(); + expect(repository.groups['project']!.first.title, 'Updated chat'); + expect(tester.takeException(), isNull); }, ); - testWidgets('project header more is inert and project rows switch projects', ( + testWidgets('empty chat history does not introduce project groups', ( + tester, + ) async { + tester.view.physicalSize = const Size(1200, 800); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + await tester.pumpWidget( + ProviderScope( + overrides: [ + deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), + projectsProvider.overrideWith(_GroupedProjects.new), + conversationRepositoryProvider.overrideWith( + (ref) async => _GroupedConversationRepository({}), + ), + ], + child: const CutdexApp(), + ), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('project-chat-history'))); + await tester.pumpAndSettle(); + expect(find.byKey(const ValueKey('sidebar-project-other')), findsNothing); + expect( + find.byKey(const ValueKey('sidebar-conversation-other-1')), + findsNothing, + ); + expect(tester.takeException(), isNull); + }); + + testWidgets('project header opens recent projects and switches tabs', ( tester, ) async { tester.view.physicalSize = const Size(1200, 800); @@ -1010,34 +748,23 @@ void main() { ), ); await tester.pumpAndSettle(); - final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); - await mouse.addPointer(location: Offset.zero); - await mouse.moveTo( - tester.getCenter(find.byKey(const Key('projects-heading'))), - ); + await tester.tap(find.byKey(const Key('project-tabs-projects'))); await tester.pumpAndSettle(); - await tester.tap(find.byKey(const Key('projects-more'))); + await tester.tap(find.byKey(const ValueKey('project-menu-other'))); await tester.pumpAndSettle(); - expect(find.byKey(const Key('project-popover')), findsNothing); - await tester.tap(find.byKey(const ValueKey('sidebar-project-other'))); + expect(find.byKey(const ValueKey('project-tab-other')), findsOneWidget); + expect(find.byKey(const ValueKey('project-tab-project')), findsOneWidget); + await tester.tap(find.byKey(const ValueKey('project-tab-project'))); await tester.pumpAndSettle(); expect( - tester - .widget(find.byKey(const ValueKey('sidebar-project-other'))) - .selected, - isTrue, + ProviderScope.containerOf(tester.element(find.byType(CutdexApp))) + .read(projectsProvider) + .requireValue + .activeProject + ?.id, + 'project', ); - await tester.tap(find.byKey(const ValueKey('sidebar-project-project'))); - await tester.pumpAndSettle(); - expect( - tester - .widget( - find.byKey(const ValueKey('sidebar-project-project')), - ) - .selected, - isTrue, - ); - await mouse.removePointer(); + expect(tester.takeException(), isNull); }); test('dark workspace uses the configured panel palette', () { @@ -1090,13 +817,10 @@ void main() { await tester.pumpAndSettle(); } - await rename( - find.byKey(const ValueKey('sidebar-project-project')), - '重命名项目', - ); + await rename(find.byKey(const ValueKey('project-tab-project')), '重命名项目'); expect( find.descendant( - of: find.byKey(const ValueKey('sidebar-project-project')), + of: find.byKey(const ValueKey('project-tab-project')), matching: find.text('重命名项目'), ), findsOneWidget, @@ -1136,7 +860,7 @@ void main() { ); expect( tester.getSize(find.byKey(const Key('timeline-tabs-bar'))).height, - 26, + 32, ); expect( find.descendant( @@ -1161,21 +885,32 @@ void main() { .textStyle! .resolve({})! .fontSize, - 12, + 13, ); final projectTabFinder = find.byKey( const ValueKey('timeline-tab-project'), ); - final selectedInk = Theme.of(tester.element(projectTabFinder)) - .colorScheme - .onSurface; + final tabRect = tester.getRect(projectTabFinder); + expect(tabRect.height, 26); + for (final key in ['timeline-add-button', 'timeline-list-button']) { + final buttonRect = tester.getRect(find.byKey(Key(key))); + expect(buttonRect.height, tabRect.height); + expect(buttonRect.top, tabRect.top); + expect(buttonRect.bottom, tabRect.bottom); + } + expect( + tester.getRect(find.byKey(const Key('timeline-tabs-bar'))).right - + tester.getRect(find.byKey(const Key('timeline-list-button'))).right, + 4, + ); expect( tester .widget(projectTabFinder) .style! .backgroundColor! .resolve({}), - selectedInk.withValues(alpha: .05), + Theme.of(tester.element(projectTabFinder)).colorScheme.primary + .withValues(alpha: .12), ); expect(find.byKey(const ValueKey('timeline-tab-second')), findsOneWidget); final tabs = find.byKey(const Key('timeline-tabs-list')); @@ -1211,12 +946,8 @@ void main() { .timelineId, 'timeline-3', ); - final navigation = tester.element( - find.byKey(const Key('projects-heading')), - ); + final navigation = tester.element(find.byType(ProjectSidebar)); final workspace = tester.element(find.byType(EditorWorkspace)); - await tester.tap(find.byKey(const Key('desktop-rail-library'))); - await tester.pumpAndSettle(); await tester.tap(find.byKey(const Key('editor-properties-button'))); await tester.pumpAndSettle(); final timelineListButton = find.byKey(const Key('timeline-list-button')); @@ -1271,15 +1002,10 @@ void main() { .openTimeline('project', id); await tester.pumpAndSettle(); expect( - tester.element(find.byKey(const Key('projects-window-header'))), + tester.element(find.byKey(const Key('project-chat-header'))), isNotNull, ); - expect( - tester.element( - find.byKey(const Key('projects-heading'), skipOffstage: false), - ), - same(navigation), - ); + expect(tester.element(find.byType(ProjectSidebar)), same(navigation)); expect(tester.element(find.byType(EditorWorkspace)), same(workspace)); expect( tester.element(find.byKey(const Key('editor-content-header'))), @@ -1567,142 +1293,70 @@ void main() { ), ); await tester.pumpAndSettle(); - expect( - tester.getTopLeft(find.byKey(const Key('projects-window-header'))).dy, - 41.0, - ); - expect(find.byKey(const Key('sidebar-mode-trigger')), findsNothing); expect( tester.getSize(find.byKey(const Key('native-window-controls-space'))), - const Size(88, 40), + const Size(68, 44), ); - expect( - tester.getSize(find.byKey(const Key('project-sidebar-divider'))).width, - 1, - ); - expect( - tester.getSize(find.byKey(const Key('project-sidebar-divider'))).height, - tester.getSize(find.byKey(const Key('desktop-editor-card'))).height, - ); - final sidebarToggle = find.byKey(const Key('project-sidebar-toggle')); - expect(tester.getRect(sidebarToggle).center.dy, 20.0); - final projectSettings = find.byKey(const Key('project-settings-button')); - final backgroundTasks = find.byKey( - const ValueKey('background-tasks-button'), - ); - expect(projectSettings, findsOneWidget); - expect(backgroundTasks, findsOneWidget); - expect(tester.getRect(projectSettings).center.dx, 22); - expect( - tester.getRect(projectSettings).bottom, - tester.getRect(find.byKey(const Key('desktop-navigation-rail'))).bottom - - 10, - ); - expect(tester.getTopLeft(sidebarToggle).dx, 96); - expect(tester.getSize(sidebarToggle), const Size.square(28)); - expect(tester.getSize(backgroundTasks), const Size.square(28)); - expect( - tester.getRect(sidebarToggle).center.dx - 88, - tester.getRect(find.byKey(const Key('desktop-rail-cut'))).center.dx, - ); - await tester.tap(sidebarToggle); - await tester.pump(); - expect(find.byKey(const ValueKey('open-project-project')), findsNothing); - expect(find.byTooltip('展开侧边栏'), findsOneWidget); - expect(find.byKey(const Key('desktop-workspace-mode')), findsNothing); - expect(projectSettings, findsOneWidget); - expect(backgroundTasks, findsOneWidget); - expect(find.byKey(const Key('workspace-project-title')), findsNothing); - expect( - tester.getTopLeft(find.byType(EditorPreviewPanel)).dx, - tester.getRect(find.byKey(const Key('desktop-editor-card'))).left + 1, - ); - expect(sidebarToggle, findsOneWidget); - await tester.tap(sidebarToggle); - await tester.pump(); - expect(find.byKey(const Key('projects-heading')), findsOneWidget); - expect(find.byTooltip('收起侧边栏'), findsOneWidget); - await _hoverProjectHeader(tester); - await tester.tap(find.byKey(const Key('projects-more'))); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('project-popover')), findsNothing); - expect( - find.byKey(const ValueKey('sidebar-project-project')), - findsOneWidget, - ); - expect(find.byKey(const ValueKey('open-timeline-project')), findsNothing); - expect( - tester - .getSize(find.byKey(const ValueKey('sidebar-project-project'))) - .height, - 30, - ); - final projectTitle = tester.widget( - find.descendant( - of: find.byKey(const ValueKey('sidebar-project-project')), - matching: find.text('测试项目'), - ), - ); - expect(projectTitle.style?.fontSize, 14); - final projectRow = find.byKey(const ValueKey('sidebar-project-project')); - expect( - find.descendant(of: projectRow, matching: find.byIcon(Icons.add)), - findsNothing, - ); - expect(find.byKey(const Key('projects-section-header')), findsNothing); - expect(find.byKey(const Key('projects-more')), findsOneWidget); - expect( - tester.getSize(find.byKey(const Key('create-project'))), - const Size.square(24), - ); - expect( - tester.getRect(find.byKey(const Key('projects-heading'))).right + - AppSpacing.tiny, - tester.getRect(find.byKey(const Key('projects-more'))).left, - ); - expect( - find.descendant(of: projectRow, matching: find.byIcon(Icons.add)), - findsNothing, - ); - expect( - tester.getTopLeft(find.byKey(const Key('project-sidebar-resize'))).dx, - 302, - ); - expect( - tester.getTopLeft(find.byType(EditorPreviewPanel)).dy, - tester.getRect(find.byKey(const Key('editor-content-header'))).bottom, - ); - expect(find.byKey(const Key('editor-content-header')), findsOneWidget); - tester.view.physicalSize = const Size(500, 450); - await tester.pumpAndSettle(); - final navigationButton = find.byKey(const Key('project-sidebar-toggle')); + final tabs = find.byKey(const ValueKey('project-tab-project')); expect( controlRegions.values.any( - (region) => region.contains(tester.getCenter(navigationButton)), - ), - isTrue, - reason: 'AppKit must forward navigation clicks instead of dragging.', - ); - await tester.tap(navigationButton); - await tester.pumpAndSettle(); - expect( - find.byKey(const ValueKey('sidebar-project-project')), - findsOneWidget, - ); - final closeNavigation = find.byTooltip('关闭'); - expect(tester.getRect(closeNavigation).left, greaterThanOrEqualTo(44)); - expect( - controlRegions.values.any( - (region) => region.contains(tester.getCenter(closeNavigation)), + (region) => region.contains(tester.getCenter(tabs)), ), isTrue, ); - await tester.tap(closeNavigation); - await tester.pumpAndSettle(); + final taskButton = find.byKey(const ValueKey('background-tasks-button')); + expect(taskButton, findsOneWidget); expect( - tester.getRect(find.byKey(const Key('agent-content-header'))).left, - 45, + controlRegions.values.any( + (region) => region.contains(tester.getCenter(taskButton)), + ), + isTrue, + reason: 'AppKit must forward task button clicks instead of dragging.', ); + expect(tester.getCenter(taskButton).dy, 22); + for (final key in ['project-sidebar-toggle', 'agent-minimize-button']) { + final control = find.byKey(Key(key)); + expect( + find.descendant( + of: find.byKey(const Key('desktop-window-header')), + matching: control, + ), + findsOneWidget, + ); + expect(tester.getSize(control), const Size.square(28)); + expect(tester.getCenter(control).dy, 22); + expect( + controlRegions.values.any( + (region) => region.contains(tester.getCenter(control)), + ), + isTrue, + reason: 'AppKit must forward $key clicks instead of dragging.', + ); + } + final minimizeRect = tester.getRect( + find.byKey(const Key('agent-minimize-button')), + ); + expect( + tester.getRect(taskButton).left - minimizeRect.right, + AppProjectTabMetrics.gap, + ); + final addRect = tester.getRect(find.byKey(const Key('project-tabs-add'))); + final listRect = tester.getRect(find.byKey(const Key('project-tabs-list'))); + final emptyHeaderPoint = Offset( + (addRect.right + listRect.left) / 2, + addRect.center.dy, + ); + expect(listRect.left - addRect.right, greaterThan(100)); + expect( + controlRegions.values.any((region) => region.contains(emptyHeaderPoint)), + isFalse, + ); + await tester.tap(find.byKey(const Key('project-sidebar-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('desktop-chat-card')), findsNothing); + await tester.tap(find.byKey(const Key('project-sidebar-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('desktop-chat-card')), findsOneWidget); final reply = Completer(); messenger.handlePlatformMessage( channel.name, @@ -1720,186 +1374,13 @@ void main() { expect(calls, [true]); expect(closeModes, [false]); expect( - tester.getTopLeft(find.byKey(const Key('agent-content-header'))).dy, - 41.0, + tester.getTopLeft(find.byKey(const Key('project-chat-header'))).dy, + 45.0, ); expect(tester.takeException(), isNull); debugDefaultTargetPlatformOverride = null; }); - testWidgets('editing page keeps sidebar and editing workspace', ( - tester, - ) async { - tester.platformDispatcher.localesTestValue = const [Locale('zh')]; - addTearDown(tester.platformDispatcher.clearLocalesTestValue); - tester.view.physicalSize = const Size(2000, 900); - tester.view.devicePixelRatio = 1; - addTearDown(tester.view.resetPhysicalSize); - addTearDown(tester.view.resetDevicePixelRatio); - await tester.pumpWidget( - ProviderScope( - overrides: [ - deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), - conversationRepositoryProvider.overrideWith( - (ref) async => EmptyConversationRepository(), - ), - projectsProvider.overrideWith(_TestProjects.new), - ], - child: const CutdexApp(), - ), - ); - await tester.pumpAndSettle(); - final projectHeading = find.byKey(const Key('projects-heading')); - final createProjectButton = find.byKey(const Key('create-project')); - expect(projectHeading, findsOneWidget); - expect(createProjectButton, findsOneWidget); - expect( - tester.getRect(projectHeading).right + AppSpacing.tiny, - tester.getRect(find.byKey(const Key('projects-more'))).left, - ); - expect(find.byKey(const ValueKey('open-project-project')), findsNothing); - expect(find.byKey(const ValueKey('open-timeline-project')), findsNothing); - expect(find.byType(AgentChatPanel), findsOneWidget); - final upperSidebar = find.byKey( - const Key('sidebar-projects-conversations'), - ); - final projectCard = tester.getRect( - find.byKey(const Key('desktop-project-card')), - ); - final editorCard = tester.getRect( - find.byKey(const Key('desktop-editor-card')), - ); - final agentCard = tester.getRect( - find.byKey(const Key('desktop-agent-card')), - ); - expect(upperSidebar, findsOneWidget); - expect(editorCard.left - projectCard.right, 1); - expect(agentCard.left - editorCard.right, 1); - expect( - tester.getRect(find.byKey(const Key('agent-composer'))).bottom, - lessThanOrEqualTo(tester.getRect(find.byType(AgentChatPanel)).bottom), - ); - expect( - tester.getRect(find.byType(EditorWorkspace)).right, - lessThanOrEqualTo(tester.getRect(find.byType(AgentChatPanel)).left), - ); - await _hoverProjectHeader(tester); - await tester.tap(find.byKey(const Key('projects-more'))); - await tester.pumpAndSettle(); - expect(find.byKey(const Key('projects-section-header')), findsNothing); - expect(find.byKey(const Key('project-popover')), findsNothing); - expect(find.byKey(const ValueKey('open-timeline-project')), findsNothing); - expect(find.byKey(const Key('editor-content-header')), findsOneWidget); - expect(find.byKey(const Key('editor-media-button')), findsNothing); - expect(find.byKey(const Key('timeline-tabs-bar')), findsOneWidget); - expect(find.byKey(const Key('timeline-add-button')), findsOneWidget); - expect(find.byKey(const ValueKey('timeline-tab-project')), findsOneWidget); - await tester.tap(find.byKey(const Key('timeline-add-button'))); - await tester.pumpAndSettle(); - expect(find.text('时间线 1'), findsWidgets); - expect( - find.byKey(const ValueKey('timeline-tab-created-1')), - findsOneWidget, - ); - expect(find.byKey(const Key('workspace-project-title')), findsNothing); - final sidebarDivider = find.byKey(const Key('project-sidebar-resize')); - final sidebarLeftBefore = tester.getTopLeft(sidebarDivider).dx; - await tester.drag(sidebarDivider, const Offset(80, 0)); - await tester.pumpAndSettle(); - expect( - tester.getTopLeft(sidebarDivider).dx, - greaterThan(sidebarLeftBefore), - ); - final agentWidth = tester.getSize(find.byType(AgentChatPanel)).width; - await tester.drag(sidebarDivider, const Offset(2000, 0)); - await tester.pumpAndSettle(); - expect( - tester - .getSize(find.byKey(const Key('sidebar-projects-conversations'))) - .width, - 358, - ); - expect(tester.getSize(find.byType(AgentChatPanel)).width, agentWidth); - final preview = tester.getTopLeft(find.byType(EditorPreviewPanel)); - final timeline = tester.getTopLeft(find.byType(EditorTimelinePanel)); - expect( - tester.getRect(find.byKey(const Key('editor-timeline-card'))).top - - tester.getRect(find.byKey(const Key('editor-preview-card'))).bottom, - 1, - ); - expect(timeline.dx, tester.getTopLeft(find.byType(EditorPreviewPanel)).dx); - expect(timeline.dy, greaterThan(preview.dy)); - expect(find.byType(AgentChatPanel), findsOneWidget); - expect(find.byKey(const Key('agent-top-divider')), findsNothing); - expect(find.byType(EditorPropertiesPanel), findsNothing); - final editingPropertiesButton = find.byKey( - const Key('editor-properties-button'), - ); - expect(editingPropertiesButton, findsOneWidget); - await tester.tap(editingPropertiesButton); - await tester.pumpAndSettle(); - expect(find.byType(EditorPropertiesPanel), findsOneWidget); - await tester.tap(editingPropertiesButton); - await tester.pumpAndSettle(); - expect(find.byType(EditorPropertiesPanel), findsNothing); - expect(tester.takeException(), isNull); - - final timelineResize = find.byKey(const Key('editor-timeline-resize')); - final timelineHeightBefore = tester - .getSize(find.byType(EditorTimelinePanel)) - .height; - await tester.drag(timelineResize, const Offset(0, -80)); - await tester.pumpAndSettle(); - expect( - tester.getSize(find.byType(EditorTimelinePanel)).height, - greaterThan(timelineHeightBefore), - ); - - expect(find.byKey(const Key('editor-media-button')), findsNothing); - expect(find.byKey(const Key('workspace-layout-menu')), findsNothing); - expect(find.byKey(const Key('editor-editing-toggle')), findsNothing); - expect(find.byKey(const Key('agent-editing-divider')), findsNothing); - expect( - tester.getTopLeft(find.byType(EditorTimelinePanel)).dy, - greaterThan(tester.getTopLeft(find.byType(EditorPreviewPanel)).dy), - ); - - final editorElement = tester.element(find.byType(EditorWorkspace)); - await tester.tap(find.byKey(const Key('desktop-rail-library'))); - await tester.pumpAndSettle(); - expect(find.byType(MediaPanel), findsOneWidget); - expect(find.byType(EditorWorkspace), findsOneWidget); - expect(find.byType(Dialog), findsNothing); - final mediaRegion = find.byKey(const Key('media-panel-surface')); - expect( - tester - .getRect(find.byKey(const Key('desktop-project-card'))) - .contains(tester.getRect(mediaRegion).center), - isTrue, - ); - final mediaElement = tester.element(find.byType(MediaPanel)); - await tester.tap(find.byKey(const Key('media-layout-toggle'))); - await tester.pumpAndSettle(); - expect(find.byTooltip('宫格布局'), findsOneWidget); - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); - await tester.pumpAndSettle(); - expect(mediaRegion, findsNothing); - expect(tester.element(find.byType(EditorWorkspace)), same(editorElement)); - await tester.tap(find.byKey(const Key('editor-properties-button'))); - await tester.pumpAndSettle(); - final propertiesRegion = find.byKey(const Key('editor-properties-region')); - expect(propertiesRegion, findsOneWidget); - await tester.tap(find.byKey(const Key('desktop-rail-library'))); - await tester.pumpAndSettle(); - expect(tester.element(find.byType(MediaPanel)), same(mediaElement)); - expect(propertiesRegion, findsOneWidget); - expect(find.byTooltip('宫格布局'), findsOneWidget); - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); - await tester.pumpAndSettle(); - expect(propertiesRegion, findsOneWidget); - expect(tester.element(find.byType(EditorWorkspace)), same(editorElement)); - expect(tester.takeException(), isNull); - }); for (final locale in const [ Locale('en'), Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans'), @@ -1935,7 +1416,9 @@ void main() { ), ); await tester.pumpAndSettle(); - await tester.tap(find.byKey(const Key('desktop-rail-cut'))); + ProviderScope.containerOf(tester.element(find.byType(CutdexApp))) + .read(workspaceViewSettingsProvider.notifier) + .setMode(WorkspaceMode.cut); await tester.pumpAndSettle(); expect( find.ancestor( @@ -1977,6 +1460,7 @@ void main() { ), projectsProvider.overrideWith(_TestProjects.new), ], + retry: (_, _) => null, ); addTearDown(container.dispose); container.read(appRouterProvider).go('/projects/missing'); diff --git a/test/workspace/preview_controller_registry_test.dart b/test/workspace/preview_controller_registry_test.dart index 3f54d58..8cf0da8 100644 --- a/test/workspace/preview_controller_registry_test.dart +++ b/test/workspace/preview_controller_registry_test.dart @@ -87,4 +87,95 @@ void main() { } }, ); + test( + 'LRU trims idle output but preserves leased controllers until release', + () async { + var sessionId = 0; + final closed = []; + for (final id in ['1', '2', '3']) { + final events = MethodChannel('cutdex_runtime/sessions/$id'); + messenger.setMockMethodCallHandler(events, (call) async { + if (call.method == 'listen') { + scheduleMicrotask( + () => messenger.handlePlatformMessage( + events.name, + const StandardMethodCodec().encodeSuccessEnvelope({ + 'type': 'attached', + }), + (_) {}, + ), + ); + } + return null; + }); + } + messenger.setMockMethodCallHandler(channel, (call) async { + switch (call.method) { + case 'capabilities': + return { + 'contractVersion': 1, + 'features': {'playback.preview': 'available'}, + }; + case 'createSession': + return {'sessionId': '${++sessionId}'}; + case 'probe': + return { + 'duration': MediaTime(2, 1).toMap(), + 'videoTrackCount': 1, + 'videoTrackIds': [1], + 'audioTrackCount': 0, + 'audioTrackIds': [], + 'isProtected': false, + }; + case 'load': + return (call.arguments as Map)['plan']['revision']; + case 'close': + closed.add((call.arguments as Map)['sessionId'] as String); + } + return null; + }); + final first = await createPreviewFixture(Uri.file('/fixture-1.mov')); + final second = await createPreviewFixture(Uri.file('/fixture-2.mov')); + final third = await createPreviewFixture(Uri.file('/fixture-3.mov')); + final registry = PreviewControllerRegistry( + CutdexRuntime(channel: channel), + maximumCachedControllers: 2, + ); + try { + final releaseFirst = registry.retain(('p', 'first')); + final releaseSecond = registry.retain(('p', 'second')); + final releaseThird = registry.retain(('p', 'third')); + final one = await registry.prepare(('p', 'first'), first.timeline); + final two = await registry.prepare(('p', 'second'), second.timeline); + final three = await registry.prepare(('p', 'third'), third.timeline); + expect(one!.ready, isTrue); + expect(two!.ready, isTrue); + expect(three!.ready, isTrue); + expect(registry.cached(('p', 'first')), same(one)); + releaseFirst(); + expect(registry.cached(('p', 'first')), isNull); + expect(registry.cached(('p', 'second')), same(two)); + expect(registry.cached(('p', 'third')), same(three)); + releaseFirst(); // Releases are idempotent. + releaseSecond(); + releaseThird(); + await registry.invalidate(('p', 'second')); + await registry.invalidate(('p', 'third')); + expect(closed.toSet(), {'1', '2', '3'}); + } finally { + registry.dispose(); + for (final id in ['1', '2', '3']) { + messenger.setMockMethodCallHandler( + MethodChannel('cutdex_runtime/sessions/$id'), + null, + ); + } + messenger.setMockMethodCallHandler(channel, null); + for (final fixture in [first, second, third]) { + await fixture.workspace.close(); + await fixture.directory.delete(recursive: true); + } + } + }, + ); } diff --git a/test/workspace/project_switch_preparation_test.dart b/test/workspace/project_switch_preparation_test.dart new file mode 100644 index 0000000..e41a061 --- /dev/null +++ b/test/workspace/project_switch_preparation_test.dart @@ -0,0 +1,122 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex/workspace/persistence/recent_projects.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/view_settings.dart'; +import 'package:drift/native.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../support/memory_app_settings.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + for (final superseded in [false, true]) { + test( + 'project layout is prepared before publication (superseded: $superseded)', + () async { + final root = await Directory.systemTemp.createTemp( + 'cutdex-project-layout-', + ); + final database = AppDatabase(NativeDatabase.memory()); + final layouts = _DelayedLayouts(); + final container = ProviderContainer( + overrides: [ + appDatabaseProvider.overrideWithValue(database), + recentProjectsProvider.overrideWithValue( + MemoryRecentProjectsRepository(), + ), + resourceLocationSettingsRepositoryProvider.overrideWithValue( + MemoryResourceLocationSettingsRepository(root.path), + ), + projectViewSettingsRepositoryProvider.overrideWithValue(layouts), + ], + ); + try { + final projects = container.read(projectsProvider.notifier); + expect( + await projects.open('${root.path}/First.cutdex', name: 'First'), + isTrue, + ); + final initial = container.read(projectsProvider).requireValue; + var current = true; + final opening = projects.open( + '${root.path}/Second.cutdex', + name: 'Second', + isCurrent: () => current, + ); + final targetId = await layouts.requested.future; + expect( + container.read(projectsProvider).requireValue.activeProject, + initial.activeProject, + ); + expect( + container.read(projectsProvider).requireValue.timeline, + initial.timeline, + ); + expect( + container.read(projectsProvider).requireValue.projectBusy, + isTrue, + ); + expect( + container.read(projectViewSettingsProvider(targetId)).isLoading, + isTrue, + ); + current = !superseded; + layouts.prepared.complete( + const ProjectViewSettingsData( + propertiesOpen: true, + timelineHeight: 320, + ), + ); + expect(await opening, !superseded); + final published = container.read(projectsProvider).requireValue; + expect( + published.activeProject?.id, + superseded ? initial.activeProject!.id : targetId, + ); + expect(published.projectBusy, isFalse); + expect(published.error, isNull); + expect( + container + .read(projectViewSettingsProvider(targetId)) + .requireValue + .propertiesOpen, + isTrue, + ); + expect( + container + .read(projectViewSettingsProvider(targetId)) + .requireValue + .timelineHeight, + 320, + ); + } finally { + await container.read(projectsProvider.notifier).prepareToQuit(); + container.dispose(); + await database.close(); + await root.delete(recursive: true); + } + }, + ); + } +} + +class _DelayedLayouts implements ProjectViewSettingsRepository { + String? _firstProjectId; + final requested = Completer(); + final prepared = Completer(); + @override + Future load(String projectId) async { + _firstProjectId ??= projectId; + if (projectId == _firstProjectId) return const ProjectViewSettingsData(); + requested.complete(projectId); + return prepared.future; + } + + @override + Future save(String projectId, ProjectViewSettingsData settings) async {} +} diff --git a/test/workspace/project_tabs_lifecycle_test.dart b/test/workspace/project_tabs_lifecycle_test.dart new file mode 100644 index 0000000..e956405 --- /dev/null +++ b/test/workspace/project_tabs_lifecycle_test.dart @@ -0,0 +1,85 @@ +import 'dart:io'; + +import 'package:cutdex/features/projects/project_tabs_controller.dart'; +import 'package:cutdex/integrations/platform/device_experience.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex/workspace/persistence/recent_projects.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../support/memory_app_settings.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + test( + 'closing active project preserves files, history and a reusable session', + () async { + final root = await Directory.systemTemp.createTemp( + 'cutdex-project-tabs-', + ); + final container = ProviderContainer( + overrides: [ + deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), + recentProjectsProvider.overrideWithValue( + MemoryRecentProjectsRepository(), + ), + resourceLocationSettingsRepositoryProvider.overrideWithValue( + MemoryResourceLocationSettingsRepository(root.path), + ), + ], + ); + final projects = container.read(projectsProvider.notifier); + final tabs = container.read(projectTabsProvider.notifier); + try { + expect( + await projects.open('${root.path}/One.cutdex', name: 'One'), + isTrue, + ); + final first = container.read(projectsProvider).requireValue; + final session = await projects.openTimelineSession( + first.activeProject!.id, + first.timeline!.id, + ); + final view = session.view(session.activeSequenceId!); + view.seekTo(100); + expect( + await projects.open('${root.path}/Two.cutdex', name: 'Two'), + isTrue, + ); + final second = container + .read(projectsProvider) + .requireValue + .activeProject!; + expect( + container.read(projectTabsProvider).map((project) => project.id), + [first.activeProject!.id, second.id], + ); + expect(await projects.closeActiveProject(), isTrue); + tabs.remove(second.id); + final closed = container.read(projectsProvider).requireValue; + expect(closed.activeProject, isNull); + expect(closed.timeline, isNull); + expect(closed.assets, isEmpty); + expect(closed.recent.length, 2); + expect(await File('${second.path}/manifest.json').exists(), isTrue); + expect(await projects.open(first.activeProject!.path), isTrue); + final reopened = await projects.openTimelineSession( + first.activeProject!.id, + first.timeline!.id, + ); + expect(reopened, same(session)); + expect(reopened.view(reopened.activeSequenceId!), same(view)); + expect(view.playheadTick, 100); + expect( + container.read(projectTabsProvider).map((project) => project.id), + [first.activeProject!.id], + ); + } finally { + await projects.prepareToQuit(); + container.dispose(); + await root.delete(recursive: true); + } + }, + ); +} diff --git a/test/workspace/projects_creation_test.dart b/test/workspace/projects_creation_test.dart new file mode 100644 index 0000000..73129f2 --- /dev/null +++ b/test/workspace/projects_creation_test.dart @@ -0,0 +1,179 @@ +import 'dart:io'; + +import 'package:cutdex/errors/app_failure.dart'; +import 'package:cutdex/integrations/platform/device_experience.dart'; +import 'package:cutdex/persistence/app_settings_repositories.dart'; +import 'package:cutdex/workspace/persistence/recent_projects.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:path/path.dart' as p; + +import '../support/memory_app_settings.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group('project creation collisions', () { + late Directory root; + late ProviderContainer container; + late Projects projects; + + setUp(() async { + root = await Directory.systemTemp.createTemp('cutdex-name-conflict-'); + container = ProviderContainer( + overrides: [ + deviceExperienceProvider.overrideWithValue(DeviceExperience.desktop), + recentProjectsProvider.overrideWithValue( + MemoryRecentProjectsRepository(), + ), + projectLocationSettingsRepositoryProvider.overrideWithValue( + DefaultingProjectLocationSettingsRepository( + MemoryProjectLocationSettingsRepository(root.path), + ), + ), + resourceLocationSettingsRepositoryProvider.overrideWithValue( + MemoryResourceLocationSettingsRepository(root.path), + ), + ], + ); + projects = container.read(projectsProvider.notifier); + }); + + tearDown(() async { + await projects.prepareToQuit(); + container.dispose(); + await root.delete(recursive: true); + }); + + test( + 'duplicate creation preserves the existing project and session', + () async { + expect( + await projects.createProject('One', initialTimelineName: 'Timeline'), + isTrue, + ); + final before = container.read(projectsProvider).requireValue; + final project = before.activeProject!; + final session = await projects.openTimelineSession( + project.id, + before.timeline!.id, + ); + final manifest = File(p.join(project.path, 'manifest.json')); + final contents = await manifest.readAsString(); + expect( + (await projects.validateNewProjectName(' One '))?.code, + AppErrorCode.projectAlreadyExists, + ); + expect(container.read(projectsProvider).requireValue.error, isNull); + + expect( + await projects.createProject( + ' One ', + initialTimelineName: 'Replacement', + ), + isFalse, + ); + final after = container.read(projectsProvider).requireValue; + expect(after.error?.code, AppErrorCode.projectAlreadyExists); + expect(after.activeProject?.id, project.id); + expect(after.timeline?.id, before.timeline?.id); + expect(after.recent, before.recent); + expect(await manifest.readAsString(), contents); + expect( + await projects.openTimelineSession(project.id, before.timeline!.id), + same(session), + ); + + expect(await projects.validateNewProjectName('Two'), isNull); + expect( + await projects.createProject('Two', initialTimelineName: 'Timeline'), + isTrue, + ); + expect(container.read(projectsProvider).requireValue.error, isNull); + expect( + container.read(projectsProvider).requireValue.activeProject?.name, + 'Two', + ); + expect(await manifest.readAsString(), contents); + }, + ); + + test( + 'creation detects a destination occupied after name validation', + () async { + expect(await projects.validateNewProjectName('Racing'), isNull); + final destination = File(p.join(root.path, 'Racing.cutdex')); + await destination.writeAsString('created by another operation'); + expect( + await projects.createProject( + 'Racing', + initialTimelineName: 'Timeline', + ), + isFalse, + ); + expect( + container.read(projectsProvider).requireValue.error?.code, + AppErrorCode.projectAlreadyExists, + ); + expect( + await destination.readAsString(), + 'created by another operation', + ); + }, + ); + + for (final type in ['file', 'directory', 'broken link']) { + test('occupied $type is reported without replacing it', () async { + final destination = p.join(root.path, 'Occupied.cutdex'); + switch (type) { + case 'file': + await File(destination).writeAsString('keep this file'); + case 'directory': + await Directory(destination).create(); + await File(p.join(destination, 'keep.txt')) + .writeAsString('keep this directory'); + case 'broken link': + await Link(destination).create(p.join(root.path, 'missing-target')); + } + final before = await FileSystemEntity.type( + destination, + followLinks: false, + ); + expect( + (await projects.validateNewProjectName('Occupied'))?.code, + AppErrorCode.projectAlreadyExists, + ); + expect( + await projects.createProject( + 'Occupied', + initialTimelineName: 'Timeline', + ), + isFalse, + ); + final state = container.read(projectsProvider).requireValue; + expect(state.error?.code, AppErrorCode.projectAlreadyExists); + expect(state.activeProject, isNull); + expect(state.recent, isEmpty); + expect( + await FileSystemEntity.type(destination, followLinks: false), + before, + ); + switch (type) { + case 'file': + expect(await File(destination).readAsString(), 'keep this file'); + case 'directory': + expect( + await File(p.join(destination, 'keep.txt')).readAsString(), + 'keep this directory', + ); + case 'broken link': + expect( + await Link(destination).target(), + p.join(root.path, 'missing-target'), + ); + } + }); + } + }); +} diff --git a/test/workspace/timeline_navigation_test.dart b/test/workspace/timeline_navigation_test.dart index 94da6d1..198d31b 100644 --- a/test/workspace/timeline_navigation_test.dart +++ b/test/workspace/timeline_navigation_test.dart @@ -1,3 +1,5 @@ +import 'package:cutdex/workspace/timeline_session.dart'; + import 'dart:async'; import 'dart:io'; @@ -209,7 +211,13 @@ void main() { testWidgets('pending tabs accept a newer real click', (tester) async { final widgetContainer = ProviderContainer( - overrides: [projectsProvider.overrideWith(_PendingProjects.new)], + overrides: [ + projectsProvider.overrideWith(_PendingProjects.new), + editorTimelineProvider( + 'project', + 'a', + ).overrideWith((ref) => Completer().future), + ], ); addTearDown(widgetContainer.dispose); await tester.pumpWidget( @@ -226,7 +234,7 @@ void main() { if (state == null) return const SizedBox(); return EditorWorkspace( projectId: 'project', - timelineId: state.visibleTimelineId!, + timelineId: state.timeline!.id, projectName: 'Project', integratedTitlebar: false, headerLeading: const SizedBox(), @@ -247,7 +255,7 @@ void main() { final panel = tester.widget( find.byType(EditorTimelinePanel), ); - expect(panel.timelineId, 'b'); + expect(panel.timelineId, 'a'); await tester.tap(find.byKey(const ValueKey('timeline-tab-c'))); await tester.pump(); expect( @@ -258,7 +266,7 @@ void main() { tester .widget(find.byType(EditorTimelinePanel)) .timelineId, - 'c', + 'a', ); await tester.pumpWidget(const SizedBox()); }); diff --git a/test/workspace_resize_handle_test.dart b/test/workspace_resize_handle_test.dart index 4ed8093..1ed66fc 100644 --- a/test/workspace_resize_handle_test.dart +++ b/test/workspace_resize_handle_test.dart @@ -13,6 +13,7 @@ void main() { var showHandle = true; var taps = 0; var ends = 0; + var starts = 0; var updates = 0; late StateSetter update; await tester.pumpWidget( @@ -47,7 +48,11 @@ void main() { key: const Key('handle'), axis: axis, initialValue: 100, - onResize: (_) => updates++, + onStart: () => starts++, + onResize: (_) { + expect(starts, 1); + updates++; + }, onEnd: () => ends++, ), ), @@ -70,6 +75,7 @@ void main() { await mouse.moveTo(button); await tester.pump(); expect(updates, greaterThan(0)); + expect(starts, 1); expect( RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), axis == Axis.horizontal diff --git a/tool/README.md b/tool/README.md index 82fc4cd..a9a777b 100644 --- a/tool/README.md +++ b/tool/README.md @@ -122,12 +122,26 @@ deskup 0.3.0 的开发更新源由 Dart 参数配置。Windows 的编译期配 ## 诊断与共享测试入口 - `diagnostics/frame_budget.py`:读取 `CUTDEX_FRAME_TIMINGS` JSONL,可带阶段标记文件;报告帧耗时。 +- `testing/app_frame_bench.dart`:独立原生 Profile 入口,运行生产 `CutdexApp`、临时项目和内存数据库;测试时间线冷/热切换、1080p 播放、真实指针协议拖动/缩放、属性连续修改和本地助手流式回复,每个常用场景重复三轮。助手带 30 条历史消息,不调用模型。通过引擎 vsync 时间界定阶段,等待异步帧回调后统计 build/raster P50/P95/P99、最大值和帧预算超时,保存原始数据;不使用 WidgetTester 强制帧。该报告不能替代物理屏幕呈现或视频解码器丢帧统计。 - `diagnostics/benchmark_diagnostic_store.dart`:无输入数据,比较逐条刷盘与默认批写策略的合成日志突发;`--samples=7` 设置测量轮数,JSON 输出包含同步记录耗时、排空耗时、定时器间隔与持久化追加次数。可先 `fvm dart compile exe tool/diagnostics/benchmark_diagnostic_store.dart -o /tmp/cutdex-diagnostic-benchmark` 再运行可执行文件,排除 JIT 预热影响;不测量实际剪辑帧率。合成突发使用 320 项队列容量,其中 40 项预留给错误。 - `diagnostics/benchmark_agent_context.dart`:读取第一个参数指定的 AgentMessage JSON 数组,比较完整历史和 Harness 投影的估算 token/字节量。 - `testing/release_smoke.dart`:macOS/Windows 发布测试共用的 Flutter 入口,验证导出、翻译和资源配置。测试 App 不得分发;结束后使用 `lib/main.dart` 重建正式 App。 构建前退出相同构建目录中的运行实例。真实发布/更新/处理测试可能构建应用、启动 worker 或本地服务器,按脚本参数入口运行,不由通用检查隐式执行。 +macOS 全应用帧测试使用独立产物,避免覆盖正在调试的应用。先准备至少 12 秒的 1920×1080、30fps H.264/AAC 测试视频,再执行(测试窗口应保持可见): + +```sh +xcodebuild -workspace macos/Runner.xcworkspace -scheme development \ + -configuration Profile-development -derivedDataPath /tmp/cutdex-frame-profile-build \ + FLUTTER_TARGET=tool/testing/app_frame_bench.dart FLUTTER_BUILD_DIR=build/frame-profile \ + MACOSX_DEPLOYMENT_TARGET=14.0 CODE_SIGNING_ALLOWED=NO build +CUTDEX_APP_FRAME_BENCH=/tmp/cutdex-frame-report CUTDEX_BENCH_SOURCE=/absolute/path/source.mp4 \ + /tmp/cutdex-frame-profile-build/Build/Products/Profile-development/cutdex.app/Contents/MacOS/cutdex +``` + +完成后测试进程退出,临时项目删除,报告保留在指定目录的 `report.json`。这个测试入口不得用于分发;正式应用入口仍为 `lib/main.dart`。 + ## 语言与入口约定 - Python 负责构建和发布编排、临时资源清理及格式/依赖验证;参数、环境和进程调用使用公共层。签名筛选和顺序只有一份 macOS 实现。 diff --git a/tool/testing/app_frame_bench.dart b/tool/testing/app_frame_bench.dart new file mode 100644 index 0000000..084458a --- /dev/null +++ b/tool/testing/app_frame_bench.dart @@ -0,0 +1,478 @@ +// Native Profile entrypoint. Uses the production app with an isolated database +// and temporary project. No WidgetTester pumps or forced hidden-window frames. +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'dart:math' as math; +import 'dart:ui' as ui; + +import 'package:cutdex/app/app.dart'; +import 'package:cutdex/diagnostics/full_app_viewport_bench/drag.dart'; +import 'package:cutdex/features/assistant/agent_chat_panel.dart'; +import 'package:cutdex/features/assistant/chat_controller.dart'; +import 'package:cutdex/features/assistant/chat_state.dart'; +import 'package:cutdex/features/preview/preview_panel.dart'; +import 'package:cutdex/features/projects/conversation_sidebar.dart'; +import 'package:cutdex/integrations/app_updates.dart'; +import 'package:cutdex/integrations/editor_tools.dart'; +import 'package:cutdex/persistence/app_database.dart'; +import 'package:cutdex/workspace/projects.dart'; +import 'package:cutdex/workspace/timeline_provider.dart'; +import 'package:cutdex/workspace/view_settings.dart'; +import 'package:cutdex/workspace/workspace_mode.dart'; +import 'package:cutdex/workspace/workspace_navigation.dart'; +import 'package:cutdex_sdk/editor.dart'; +import 'package:cutdex_sdk/preview.dart'; +import 'package:cutdex_sdk/project.dart'; +import 'package:cutdex_sdk/timeline/layout.dart'; +import 'package:cutdex_sdk/timeline/model.dart'; +import 'package:cutdex_sdk/timeline_ui.dart'; +import 'package:drift/native.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../test/support/preview_fixture.dart'; + +class _StreamingChat extends ChatController { + @override + ChatState build( + String projectId, { + String? conversationId, + String? draftKey, + }) => ChatState( + messages: [ + for (var i = 0; i < 30; i++) + ChatMessage(text: '历史消息 $i:时间线、画布和素材的编辑记录。' * 12), + ], + ); + + void chunk(String text) => + state = state.copyWith(busy: true, partialResponse: text); +} + +Future _sleep(int ms) => Future.delayed(Duration(milliseconds: ms)); + +Element _element(bool Function(Widget) matches) { + Element? found; + void visit(Element element) { + if (matches(element.widget)) found ??= element; + element.visitChildElements(visit); + } + + WidgetsBinding.instance.rootElement!.visitChildElements(visit); + if (found == null) throw StateError('Expected visible benchmark widget'); + return found!; +} + +Future _until(bool Function() ready, String label) async { + final clock = Stopwatch()..start(); + while (!ready()) { + if (clock.elapsed.inSeconds > 60) throw TimeoutException(label); + await _sleep(20); + } +} + +Future _boundary() async { + SchedulerBinding.instance.scheduleFrame(); + await SchedulerBinding.instance.endOfFrame; +} + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + if (!kProfileMode) throw StateError('Run this benchmark in Profile mode'); + final output = Directory(Platform.environment['CUTDEX_APP_FRAME_BENCH']!); + final rounds = int.parse(Platform.environment['CUTDEX_BENCH_ROUNDS'] ?? '3'); + if (rounds < 1) throw ArgumentError('CUTDEX_BENCH_ROUNDS must be positive'); + await output.create(recursive: true); + final frames = []; + final errors = []; + SchedulerBinding.instance.addTimingsCallback(frames.addAll); + final previousError = FlutterError.onError; + FlutterError.onError = (details) { + errors.add(details.exceptionAsString()); + previousError?.call(details); + }; + final result = { + 'status': 'running', + 'mode': 'profile', + 'rounds': rounds, + 'platform': Platform.operatingSystem, + 'startedAt': DateTime.now().toUtc().toIso8601String(), + 'scope': 'Production CutdexApp, native preview, temporary project and in-memory settings database', + 'input': 'Replayed pointer protocol for tab clicks, ruler drag and trackpad zoom; production commands for property values', + 'assistant': 'Local deterministic streaming fixture, 30 history messages; no network/model latency', + 'measurement': 'Flutter engine build/raster durations; not physical display scanout or video decoder dropped-frame counters', + 'phases': >[], + }; + void save() => File('${output.path}/report.json') + .writeAsStringSync(const JsonEncoder.withIndent(' ').convert(result)); + final phases = result['phases']! as List>; + save(); + final fixture = await createPreviewFixture( + File(Platform.environment['CUTDEX_BENCH_SOURCE']!).uri, + hasAudio: true, + clipDuration: RationalTime.seconds(12), + renderSize: {'width': 1920, 'height': 1080}, + ); + final document = await fixture.workspace.project!.loadTimeline('project'); + for (final id in ['second', 'third']) { + await fixture.workspace.project!.saveTimeline( + TimelineDocument( + id: id, + name: id, + sequences: document.sequences, + defaultSequenceId: document.defaultSequenceId, + payloads: document.payloads, + settings: document.settings, + ), + ); + } + await fixture.workspace.close(); + final database = AppDatabase(NativeDatabase.memory()); + final container = ProviderContainer( + overrides: [ + appDatabaseProvider.overrideWithValue(database), + applicationMcpConnectionProvider.overrideWith((ref) {}), + appUpdateLifecycleProvider.overrideWith((ref) {}), + chatControllerProvider.overrideWith2((_) => _StreamingChat()), + ], + ); + final projects = container.read(projectsProvider.notifier); + try { + runApp( + UncontrolledProviderScope(container: container, child: const CutdexApp()), + ); + await container.read(workspaceViewSettingsProvider.future); + await _until( + () => container.read(workspaceNavigationProvider).ready, + 'navigation', + ); + container + .read(workspaceViewSettingsProvider.notifier) + .setMode(WorkspaceMode.cut); + if (!await projects.open('${fixture.directory.path}/Preview.cutdex')) { + throw StateError('Could not open isolated project'); + } + final project = container + .read(projectsProvider) + .requireValue + .activeProject! + .id; + await projects.openTimeline(project, 'project'); + PreviewController? active() { + final state = container.read(projectsProvider).value; + if (state?.timeline == null || state!.openingTimelineId != null) { + return null; + } + return container + .read(editorPreviewProvider(project, state.timeline!.id)) + .value; + } + + Future ready() => _until( + () => active()?.ready == true && active()?.busy == false, + 'native preview', + ); + await ready(); + await File('${output.path}/ready.json').writeAsString('{"ready":true}'); + if (Platform.environment['CUTDEX_APP_FRAME_BENCH_GATE'] case final gate?) { + await _until(() => File(gate).existsSync(), 'benchmark start gate'); + } + await _sleep(3000); + final display = ui.PlatformDispatcher.instance.views.first.display; + final hz = display.refreshRate > 0 ? display.refreshRate : 60.0; + final budgetUs = 1000000 / hz; + final root = _element((w) => w is EditorPreviewPanel); + final logicalSize = MediaQuery.sizeOf(root); + final pixelRatio = View.of(root).devicePixelRatio; + result.addAll({ + 'refreshHz': hz, + 'budgetMs': budgetUs / 1000, + 'windowLogicalSize': [logicalSize.width, logicalSize.height], + 'devicePixelRatio': pixelRatio, + 'media': '12s 1920x1080 H.264 30fps with AAC audio', + }); + Future phase(String name, Future Function() action) async { + debugPrint('FRAME BENCH START: $name'); + await _boundary(); + final start = + SchedulerBinding.instance.currentSystemFrameTimeStamp.inMicroseconds; + final clock = Stopwatch()..start(); + await action(); + await _boundary(); + final end = + SchedulerBinding.instance.currentSystemFrameTimeStamp.inMicroseconds; + final duration = clock.elapsedMilliseconds; + // Engine timing callbacks arrive in batches. Keep the scenario boundary + // in engine vsync time and wait for its last batch before selecting rows. + await _sleep(2200); + final selected = frames.where((f) { + final vsync = f.timestampInMicroseconds(ui.FramePhase.vsyncStart); + return vsync > start && vsync <= end; + }).toList(); + Map stats(List values) { + values.sort(); + if (values.isEmpty) throw StateError('No engine frames for $name'); + return { + for (final p in [50, 95, 99]) + 'p${p}Ms': values[((values.length - 1) * p / 100).floor()] / 1000, + 'maxMs': values.last / 1000, + 'overBudget': values.where((v) => v > budgetUs).length, + }; + } + + final row = { + 'name': name, + 'durationMs': duration, + 'frames': selected.length, + 'build': stats([ + for (final f in selected) f.buildDuration.inMicroseconds, + ]), + 'raster': stats([ + for (final f in selected) f.rasterDuration.inMicroseconds, + ]), + 'overBudgetFrames': selected + .where( + (f) => + f.buildDuration.inMicroseconds > budgetUs || + f.rasterDuration.inMicroseconds > budgetUs, + ) + .length, + 'overBudget60Hz': selected + .where( + (f) => + f.buildDuration.inMicroseconds > 1000000 / 60 || + f.rasterDuration.inMicroseconds > 1000000 / 60, + ) + .length, + 'overBudget120Hz': selected + .where( + (f) => + f.buildDuration.inMicroseconds > 1000000 / 120 || + f.rasterDuration.inMicroseconds > 1000000 / 120, + ) + .length, + 'engineRangeUs': [start, end], + 'rawFrames': [ + for (final f in selected) + [ + f.timestampInMicroseconds(ui.FramePhase.vsyncStart), + f.buildDuration.inMicroseconds, + f.rasterDuration.inMicroseconds, + f.totalSpan.inMicroseconds, + ], + ], + }; + phases.add(row); + save(); + debugPrint( + 'FRAME BENCH: $name ${selected.length} frames, ${row['overBudgetFrames']} over budget', + ); + if (errors.isNotEmpty) throw StateError(errors.join('\n')); + if (active()?.error != null) { + throw StateError('Preview error: ${active()!.error}'); + } + } + + final clock = Stopwatch()..start(); + Future tapKey(String key) async { + final element = _element((w) => w.key == ValueKey(key)); + await Scrollable.ensureVisible(element, alignment: .5); + await _boundary(); + final box = element.findRenderObject()! as RenderBox; + final point = box.localToGlobal(box.size.center(Offset.zero)); + for (final event in [ + PointerAddedEvent(pointer: 7300, device: 73, position: point), + PointerDownEvent( + pointer: 7300, + device: 73, + position: point, + buttons: kPrimaryButton, + timeStamp: clock.elapsed, + ), + PointerUpEvent( + pointer: 7300, + device: 73, + position: point, + timeStamp: clock.elapsed, + ), + PointerRemovedEvent(pointer: 7300, device: 73, position: point), + ]) { + GestureBinding.instance.handlePointerEvent(event); + } + } + + await phase('cold-timeline-switch', () async { + await tapKey('timeline-tab-second'); + await _until( + () => container.read(projectsProvider).value?.timeline?.id == 'second', + 'cold switch', + ); + await ready(); + }); + for (final id in ['third', 'project']) { + await projects.openTimeline(project, id); + await ready(); + } + await _sleep(2000); + for (var round = 1; round <= rounds; round++) { + await phase('warm-timeline-switch-$round', () async { + for (var i = 0; i < 30; i++) { + final id = ['second', 'third', 'project'][i % 3]; + await tapKey('timeline-tab-$id'); + await _until( + () => container.read(projectsProvider).value?.timeline?.id == id, + 'warm switch', + ); + await ready(); + await _sleep(160); + } + }); + final preview = active()!; + final timeline = await container.read( + editorTimelineProvider(project, 'project').future, + ); + final view = timeline.view(SequenceId('one')); + await phase('playback-$round', () async { + await preview.controlPreview( + SequenceId('one'), + PreviewAction.seek, + at: CommandTime(0, 30), + ); + await preview.controlPreview(SequenceId('one'), PreviewAction.play); + await _sleep(8000); + final position = (await preview.session!.refresh()).position.seconds; + result['playbackPositionSeconds-$round'] = position; + if (position < 7) { + throw StateError('Native video clock did not advance'); + } + await preview.controlPreview(SequenceId('one'), PreviewAction.pause); + }); + view.fitTimeline(); + view.seekTo(TimelineClock.ticksPerSecond); + await ready(); + await _sleep(500); + final ruler = + _element((w) => w is TimelineRuler).findRenderObject()! as RenderBox; + final drag = BenchPlayheadDrag( + view: view, + ruler: ruler, + viewport: TimelineViewportRect( + width: ruler.size.width, + height: ruler.size.height, + ), + scale: pixelRatio, + clock: clock, + pointer: 7400 + round, + warmFrame: 30, + fps: 30, + ); + await phase('playhead-drag-$round', () async { + try { + await drag.begin(); + for (var i = 0; i < 480; i++) { + drag.moveTo(30 + (270 * (math.sin(i / 30) + 1) / 2).round()); + await _sleep(16); + } + drag.end(); + await preview.waitForPendingPreview(); + } finally { + drag.cancel(); + } + }); + final region = _element( + (w) => w is TimelineInteractionRegion && !w.ruler, + ); + final box = region.findRenderObject()! as RenderBox; + final point = box.localToGlobal(box.size.center(Offset.zero)); + final camera = view.camera; + await phase('timeline-zoom-$round', () async { + GestureBinding.instance.handlePointerEvent( + PointerPanZoomStartEvent(pointer: 7500, device: 75, position: point), + ); + for (var i = 0; i < 480; i++) { + GestureBinding.instance.handlePointerEvent( + PointerPanZoomUpdateEvent( + pointer: 7500, + device: 75, + position: point, + scale: 1.5 + math.sin(i / 30) * .45, + ), + ); + await _sleep(16); + } + GestureBinding.instance.handlePointerEvent( + PointerPanZoomEndEvent(pointer: 7500, device: 75, position: point), + ); + view.setCamera(camera); + }); + container + .read(projectViewSettingsProvider(project).notifier) + .setPropertiesOpen(true); + preview.selectVisual(ElementId('clip')); + await _sleep(500); + await phase('property-edit-$round', () async { + for (var i = 0; i < 240; i++) { + timeline.commands.setTransform( + sequence: SequenceId('one'), + clip: ElementId('clip'), + tick: 0, + change: (value) => value.copyWith(x: math.sin(i / 20) * .1), + ); + await _sleep(33); + } + await preview.waitForPendingPreview(); + await timeline.flush(); + }); + container + .read(workspaceViewSettingsProvider.notifier) + .setMode(WorkspaceMode.agent); + await _sleep(1500); + final selection = container.read(conversationSelectionProvider(project)); + final chat = container.read( + chatControllerProvider( + project, + conversationId: selection.selectedId, + draftKey: selection.selectedId == null ? selection.draftKey : null, + ).notifier, + ) as _StreamingChat; + _element((w) => w is AgentChatPanel); + await phase('assistant-stream-$round', () async { + var text = ''; + for (var i = 0; i < 480; i++) { + text += '这是逐字更新的回复内容 $i。'; + chat.chunk(text); + await _sleep(16); + } + }); + // Narrow desktop windows show properties as an overlay over tab hit + // targets. Restore the same navigation geometry before the next round. + container + .read(projectViewSettingsProvider(project).notifier) + .setPropertiesOpen(false); + preview.selectVisual(null); + container + .read(workspaceViewSettingsProvider.notifier) + .setMode(WorkspaceMode.cut); + await _sleep(1000); + } + result['status'] = 'passed'; + } catch (error, stack) { + result['status'] = 'failed'; + result['error'] = '$error\n$stack'; + } finally { + result['flutterErrors'] = errors; + result['endedAt'] = DateTime.now().toUtc().toIso8601String(); + save(); + await projects.prepareToQuit(); + runApp(const ProviderScope(child: SizedBox.shrink())); + await _sleep(300); + container.dispose(); + await database.close(); + await fixture.directory.delete(recursive: true); + } + exit(result['status'] == 'passed' ? 0 : 1); +}