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:
commit
27e77fff39
718 files changed
+183958
No files matched your search
@@ -0,0 +1 @@
|
||||
enum AppAppearance { system, penLight, penDark }
|
||||
@@ -0,0 +1,14 @@
|
||||
enum AppLanguage {
|
||||
system,
|
||||
english,
|
||||
simplifiedChinese,
|
||||
traditionalChinese,
|
||||
japanese,
|
||||
korean,
|
||||
french,
|
||||
german,
|
||||
spanish,
|
||||
portuguese,
|
||||
italian,
|
||||
russian,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'mcp_settings_value.freezed.dart';
|
||||
|
||||
@Freezed(toStringOverride: false)
|
||||
abstract class McpSettingsValue with _$McpSettingsValue {
|
||||
const McpSettingsValue._();
|
||||
|
||||
const factory McpSettingsValue({
|
||||
required bool enabled,
|
||||
required int port,
|
||||
required String token,
|
||||
}) = _McpSettingsValue;
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'mcp_settings_value.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$McpSettingsValue {
|
||||
bool get enabled;
|
||||
int get port;
|
||||
String get token;
|
||||
|
||||
/// Create a copy of McpSettingsValue
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$McpSettingsValueCopyWith<McpSettingsValue> get copyWith =>
|
||||
_$McpSettingsValueCopyWithImpl<McpSettingsValue>(
|
||||
this as McpSettingsValue,
|
||||
_$identity,
|
||||
);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
final _this = this as McpSettingsValue;
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is McpSettingsValue &&
|
||||
(identical(other.enabled, _this.enabled) ||
|
||||
other.enabled == _this.enabled) &&
|
||||
(identical(other.port, _this.port) || other.port == _this.port) &&
|
||||
(identical(other.token, _this.token) ||
|
||||
other.token == _this.token));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final _this = this as McpSettingsValue;
|
||||
return Object.hash(runtimeType, _this.enabled, _this.port, _this.token);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $McpSettingsValueCopyWith<$Res> {
|
||||
factory $McpSettingsValueCopyWith(
|
||||
McpSettingsValue value,
|
||||
$Res Function(McpSettingsValue) _then,
|
||||
) = _$McpSettingsValueCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({bool enabled, int port, String token});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$McpSettingsValueCopyWithImpl<$Res>
|
||||
implements $McpSettingsValueCopyWith<$Res> {
|
||||
_$McpSettingsValueCopyWithImpl(this._self, this._then);
|
||||
|
||||
final McpSettingsValue _self;
|
||||
final $Res Function(McpSettingsValue) _then;
|
||||
|
||||
/// Create a copy of McpSettingsValue
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? enabled = null,
|
||||
Object? port = null,
|
||||
Object? token = null,
|
||||
}) {
|
||||
return _then(
|
||||
McpSettingsValue(
|
||||
enabled: null == enabled
|
||||
? _self.enabled
|
||||
: enabled // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
port: null == port
|
||||
? _self.port
|
||||
: port // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
token: null == token
|
||||
? _self.token
|
||||
: token // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [McpSettingsValue].
|
||||
extension McpSettingsValuePatterns on McpSettingsValue {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_McpSettingsValue value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _McpSettingsValue() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_McpSettingsValue value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _McpSettingsValue():
|
||||
return $default(_that);
|
||||
case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_McpSettingsValue value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _McpSettingsValue() when $default != null:
|
||||
return $default(_that);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function(bool enabled, int port, String token)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _McpSettingsValue() when $default != null:
|
||||
return $default(_that.enabled, _that.port, _that.token);
|
||||
case _:
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function(bool enabled, int port, String token) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _McpSettingsValue():
|
||||
return $default(_that.enabled, _that.port, _that.token);
|
||||
case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
}
|
||||
}
|
||||
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function(bool enabled, int port, String token)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _McpSettingsValue() when $default != null:
|
||||
return $default(_that.enabled, _that.port, _that.token);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _McpSettingsValue extends McpSettingsValue {
|
||||
const _McpSettingsValue({
|
||||
required this.enabled,
|
||||
required this.port,
|
||||
required this.token,
|
||||
}) : super._();
|
||||
|
||||
@override
|
||||
final bool enabled;
|
||||
@override
|
||||
final int port;
|
||||
@override
|
||||
final String token;
|
||||
|
||||
/// Create a copy of McpSettingsValue
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$McpSettingsValueCopyWith<_McpSettingsValue> get copyWith =>
|
||||
__$McpSettingsValueCopyWithImpl<_McpSettingsValue>(this, _$identity);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _McpSettingsValue &&
|
||||
(identical(other.enabled, enabled) || other.enabled == enabled) &&
|
||||
(identical(other.port, port) || other.port == port) &&
|
||||
(identical(other.token, token) || other.token == token));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return Object.hash(runtimeType, enabled, port, token);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$McpSettingsValueCopyWith<$Res>
|
||||
implements $McpSettingsValueCopyWith<$Res> {
|
||||
factory _$McpSettingsValueCopyWith(
|
||||
_McpSettingsValue value,
|
||||
$Res Function(_McpSettingsValue) _then,
|
||||
) = __$McpSettingsValueCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({bool enabled, int port, String token});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$McpSettingsValueCopyWithImpl<$Res>
|
||||
implements _$McpSettingsValueCopyWith<$Res> {
|
||||
__$McpSettingsValueCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _McpSettingsValue _self;
|
||||
final $Res Function(_McpSettingsValue) _then;
|
||||
|
||||
/// Create a copy of McpSettingsValue
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? enabled = null,
|
||||
Object? port = null,
|
||||
Object? token = null,
|
||||
}) {
|
||||
return _then(
|
||||
_McpSettingsValue(
|
||||
enabled: null == enabled
|
||||
? _self.enabled
|
||||
: enabled // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
port: null == port
|
||||
? _self.port
|
||||
: port // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
token: null == token
|
||||
? _self.token
|
||||
: token // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import '../diagnostics/app_diagnostics.dart';
|
||||
|
||||
part 'settings_operation.g.dart';
|
||||
|
||||
/// Tracks an operation independently of the configuration currently in effect.
|
||||
@riverpod
|
||||
class SettingsOperation extends _$SettingsOperation {
|
||||
@override
|
||||
AsyncValue<void> build(String operation) => const AsyncData(null);
|
||||
|
||||
Future<bool> run(Future<void> Function() action) async {
|
||||
if (state.isLoading) return false;
|
||||
final lease = ref.keepAlive();
|
||||
state = const AsyncLoading();
|
||||
try {
|
||||
await action();
|
||||
if (ref.mounted) state = const AsyncData(null);
|
||||
return true;
|
||||
} catch (error, stack) {
|
||||
AppDiagnostics.failure('settings', operation, error, stack);
|
||||
if (ref.mounted) state = AsyncError(error, stack);
|
||||
return false;
|
||||
} finally {
|
||||
lease.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'settings_operation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
/// Tracks an operation independently of the configuration currently in effect.
|
||||
|
||||
@ProviderFor(SettingsOperation)
|
||||
final settingsOperationProvider = SettingsOperationFamily._();
|
||||
|
||||
/// Tracks an operation independently of the configuration currently in effect.
|
||||
final class SettingsOperationProvider
|
||||
extends $NotifierProvider<SettingsOperation, AsyncValue<void>> {
|
||||
/// Tracks an operation independently of the configuration currently in effect.
|
||||
SettingsOperationProvider._({
|
||||
required SettingsOperationFamily super.from,
|
||||
required String super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'settingsOperationProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$settingsOperationHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'settingsOperationProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
SettingsOperation create() => SettingsOperation();
|
||||
|
||||
/// {@macro riverpod.override_with_value}
|
||||
Override overrideWithValue(AsyncValue<void> value) {
|
||||
return $ProviderOverride(
|
||||
origin: this,
|
||||
providerOverride: $SyncValueProvider<AsyncValue<void>>(value),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is SettingsOperationProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
String _$settingsOperationHash() => r'af6f16d1729e3729b0f6707862eeb5c8d5654fa2';
|
||||
|
||||
/// Tracks an operation independently of the configuration currently in effect.
|
||||
|
||||
final class SettingsOperationFamily extends $Family
|
||||
with
|
||||
$ClassFamilyOverride<
|
||||
SettingsOperation,
|
||||
AsyncValue<void>,
|
||||
AsyncValue<void>,
|
||||
AsyncValue<void>,
|
||||
String
|
||||
> {
|
||||
SettingsOperationFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'settingsOperationProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
/// Tracks an operation independently of the configuration currently in effect.
|
||||
|
||||
SettingsOperationProvider call(String operation) =>
|
||||
SettingsOperationProvider._(argument: operation, from: this);
|
||||
|
||||
@override
|
||||
String toString() => r'settingsOperationProvider';
|
||||
}
|
||||
|
||||
/// Tracks an operation independently of the configuration currently in effect.
|
||||
|
||||
abstract class _$SettingsOperation extends $Notifier<AsyncValue<void>> {
|
||||
late final _$args = ref.$arg as String;
|
||||
String get operation => _$args;
|
||||
|
||||
AsyncValue<void> build(String operation);
|
||||
@$mustCallSuper
|
||||
@override
|
||||
WhenComplete runBuild() {
|
||||
final ref = this.ref as $Ref<AsyncValue<void>, AsyncValue<void>>;
|
||||
final element =
|
||||
ref.element
|
||||
as $ClassProviderElement<
|
||||
AnyNotifier<AsyncValue<void>, AsyncValue<void>>,
|
||||
AsyncValue<void>,
|
||||
Object?,
|
||||
Object?
|
||||
>;
|
||||
return element.handleCreate(ref, () => build(_$args));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/// Runs settings writes in order and allows later writes after a failure.
|
||||
class SettingsWriteQueue {
|
||||
Future<void> _tail = Future.value();
|
||||
|
||||
Future<void> run(Future<void> Function() write) {
|
||||
final result = _tail.then((_) => write());
|
||||
_tail = result.then<void>((_) {}, onError: (Object _, StackTrace _) {});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user