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.
29 lines
928 B
Dart
29 lines
928 B
Dart
import 'package:cutdex_native/cutdex_native.dart';
|
|
|
|
import '../../workspace/media_file_extensions.dart';
|
|
import '../../workspace/media_import.dart';
|
|
|
|
/// File acceptance shared by Flutter and the native drop destinations.
|
|
enum NativeFileDropPolicy {
|
|
mediaLibrary,
|
|
timeline,
|
|
attachments;
|
|
|
|
List<String>? get allowedExtensions => switch (this) {
|
|
timeline => selectableTimelineFileExtensions,
|
|
// Library imports validate each file so mixed batches retain valid media.
|
|
mediaLibrary || attachments => null,
|
|
};
|
|
|
|
int? get maximumFileCount => this == timeline ? 1 : null;
|
|
|
|
bool accepts(List<ExternalMediaFile> files) =>
|
|
files.every((file) => file.localPath != null) &&
|
|
configuration.accepts([for (final file in files) file.localPath!]);
|
|
|
|
NativeDropConfiguration get configuration => NativeDropConfiguration(
|
|
allowedExtensions: allowedExtensions,
|
|
maximumFileCount: maximumFileCount,
|
|
);
|
|
}
|