feat: initial Cutdex application

Add the Flutter video editing application with project management, media
import, timeline editing, preview, AI assistance, diagnostics and settings.

Include shared UI and native host packages, platform runners, application
tests and release tooling.

Provide usage and contribution guides, the MIT license and third-party
notices. Exclude local credentials, build outputs and validation data.
This commit is contained in:
lingjhf committed 2026-10-05 23:36:23 +08:00
commit 27e77fff39
718 files changed
+183958

No files matched your search

@@ -0,0 +1,16 @@
import 'package:flutter/foundation.dart';
/// Desktop split preferences outlive the desktop shell when a window narrows.
class DesktopWorkspaceController extends ChangeNotifier {
double? _agentWidth;
bool _editorCollapsedByAgent = false;
double? get agentWidth => _agentWidth;
bool get editorCollapsedByAgent => _editorCollapsedByAgent;
void setSplit(double? width, {required bool editorCollapsed}) {
_agentWidth = width;
_editorCollapsedByAgent = editorCollapsed;
notifyListeners();
}
}
@@ -0,0 +1,78 @@
import 'dart:math' as math;
import '../../workspace/workspace_mode.dart';
import '../../shared/layout/workspace_layout_metrics.dart';
/// Spatial rules used within a device experience; never selects a device shell.
abstract final class WorkspaceLayoutPolicy {
static bool desktopNavigationFits(double width) =>
width >=
WorkspaceLayoutMetrics.sidebarMinimumWidth +
WorkspaceLayoutMetrics.contentMinimumWidth +
1;
static bool showAgentBesideEditor(double width) =>
width >= WorkspaceLayoutMetrics.dualPaneMinimumWidth;
}
/// Desktop geometry is resolved without mutating preferences during build.
final class DesktopWorkspaceGeometry {
const DesktopWorkspaceGeometry({
required this.sidebarWidth,
required this.agentWidth,
required this.editorHidden,
});
static const editorCollapseWidth = 480.0;
static const editorCollapseDragBuffer = editorCollapseWidth / 3;
static const editorRestoreWidth = 560.0;
final double sidebarWidth;
final double agentWidth;
final bool editorHidden;
static double sidebarMaximum(double width, WorkspaceMode mode) =>
WorkspaceLayoutMetrics.sidebarMaximumWidth(
width - (mode == WorkspaceMode.agent ? 221 : 0),
);
factory DesktopWorkspaceGeometry.resolve({
required double width,
required WorkspaceMode mode,
required bool sidebarCollapsed,
double? sidebarWidth,
double? agentWidth,
bool editorCollapsedByAgent = false,
}) {
final navigationWidth =
(sidebarWidth ?? WorkspaceLayoutMetrics.sidebarDefaultWidth)
.clamp(
WorkspaceLayoutMetrics.sidebarMinimumWidth,
sidebarMaximum(width, mode),
)
.toDouble();
final navigationSpace = sidebarCollapsed ? 0.0 : navigationWidth;
final requestedAgentWidth = mode == WorkspaceMode.agent
? (agentWidth ?? (width * .25).clamp(260.0, 320.0))
.clamp(220.0, math.max(220.0, width - navigationSpace - 1))
.toDouble()
: 0.0;
final remaining = width - navigationSpace - requestedAgentWidth - 1;
final hidden =
mode == WorkspaceMode.agent &&
(width - navigationSpace - 1 < 220 + editorCollapseWidth ||
(editorCollapsedByAgent && remaining < editorRestoreWidth) ||
remaining <= editorCollapseWidth - editorCollapseDragBuffer);
return DesktopWorkspaceGeometry(
sidebarWidth: navigationWidth,
agentWidth: hidden
? width - navigationSpace
: mode == WorkspaceMode.agent
? requestedAgentWidth
.clamp(220.0, width - navigationSpace - editorCollapseWidth - 1)
.toDouble()
: 0,
editorHidden: hidden,
);
}
}