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,90 @@
import 'dart:async';
import 'dart:io';
import 'package:cutdex/features/settings/language_settings.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(
'creation waits for saved language and later changes only new names',
() async {
final root = await Directory.systemTemp.createTemp(
'cutdex-creation-locale-',
);
final repository = _DelayedLanguageRepository();
final container = ProviderContainer(
overrides: [
languageSettingsRepositoryProvider.overrideWithValue(repository),
recentProjectsProvider.overrideWithValue(
MemoryRecentProjectsRepository(),
),
resourceLocationSettingsRepositoryProvider.overrideWithValue(
MemoryResourceLocationSettingsRepository(root.path),
),
],
);
final projects = container.read(projectsProvider.notifier);
addTearDown(() async {
await projects.prepareToQuit();
container.dispose();
await root.delete(recursive: true);
});
final opening = projects.open('${root.path}/My.cutdex', name: 'My name');
await repository.loadStarted.future;
expect(await Directory('${root.path}/My.cutdex').exists(), isFalse);
repository.loaded.complete(AppLanguage.traditionalChinese);
expect(await opening, isTrue);
final initial = container.read(projectsProvider).requireValue;
expect(initial.activeProject!.name, 'My name');
expect(initial.timeline!.name, '時間軸 1');
expect(initial.timeline!.sequences.single.name, '主序列');
expect(initial.timeline!.sequences.single.storylines.single.name, '主線');
await container
.read(languageSettingsProvider.notifier)
.setLanguage(AppLanguage.english);
expect(await projects.createTimeline(name: 'User title'), isTrue);
final added = container.read(projectsProvider).requireValue;
expect(added.timeline!.name, 'User title');
expect(added.timeline!.sequences.single.name, 'Main sequence');
expect(
added.timeline!.sequences.single.storylines.single.name,
'Main storyline',
);
expect(
await projects.openTimeline(
initial.activeProject!.id,
initial.timeline!.id,
),
isTrue,
);
final retained = container.read(projectsProvider).requireValue;
expect(retained.activeProject!.name, 'My name');
expect(retained.timeline!.name, '時間軸 1');
expect(retained.timeline!.sequences.single.name, '主序列');
},
);
}
class _DelayedLanguageRepository implements LanguageSettingsRepository {
final loaded = Completer<AppLanguage>();
final loadStarted = Completer<void>();
@override
Future<AppLanguage> load() {
loadStarted.complete();
return loaded.future;
}
@override
Future<void> save(AppLanguage language) async {}
}