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.
80 lines
2.0 KiB
Dart
80 lines
2.0 KiB
Dart
import 'package:cutdex/persistence/app_settings_repositories.dart';
|
|
import 'package:cutdex/workspace/project_state.dart';
|
|
import 'package:cutdex/workspace/persistence/recent_projects.dart';
|
|
|
|
class MemoryProjectLocationSettingsRepository
|
|
implements ProjectLocationSettingsRepository {
|
|
MemoryProjectLocationSettingsRepository([this.value]);
|
|
|
|
String? value;
|
|
|
|
@override
|
|
Future<String?> load() async => value;
|
|
|
|
@override
|
|
Future<void> save(String directory) async => value = directory;
|
|
}
|
|
|
|
class MemoryResourceLocationSettingsRepository
|
|
implements ResourceLocationSettingsRepository {
|
|
MemoryResourceLocationSettingsRepository(this.value);
|
|
|
|
String? value;
|
|
|
|
@override
|
|
Future<String?> load() async => value;
|
|
|
|
@override
|
|
Future<void> save(String directory) async => value = directory;
|
|
}
|
|
|
|
class MemoryMcpSettingsRepository implements McpSettingsRepository {
|
|
McpSettingsValue? value;
|
|
bool failWrites = false;
|
|
|
|
@override
|
|
Future<McpSettingsValue?> load() async => value;
|
|
|
|
@override
|
|
Future<void> save(McpSettingsValue configuration) async {
|
|
if (failWrites) throw StateError('write failed');
|
|
value = configuration;
|
|
}
|
|
}
|
|
|
|
class MemoryAppearanceSettingsRepository
|
|
implements AppearanceSettingsRepository {
|
|
AppAppearance value = AppAppearance.system;
|
|
bool failWrites = false;
|
|
|
|
@override
|
|
Future<AppAppearance> load() async => value;
|
|
|
|
@override
|
|
Future<void> save(AppAppearance mode) async {
|
|
if (failWrites) throw StateError('write failed');
|
|
value = mode;
|
|
}
|
|
}
|
|
|
|
class MemoryRecentProjectsRepository implements RecentProjectsRepository {
|
|
List<RecentProject> recent = [];
|
|
final projects = <String, String>{};
|
|
|
|
@override
|
|
Future<List<RecentProject>> load() async => List.of(recent);
|
|
|
|
@override
|
|
Future<void> save(List<RecentProject> projects) async {
|
|
recent = List.of(projects);
|
|
}
|
|
|
|
@override
|
|
Future<String?> lastTimeline(String projectId) async => projects[projectId];
|
|
|
|
@override
|
|
Future<void> rememberTimeline(String projectId, String timelineId) async {
|
|
projects[projectId] = timelineId;
|
|
}
|
|
}
|