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.
42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'package:cutdex_native/cutdex_native.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
import '../../workspace/media_import.dart';
|
|
import 'native_file_drop_policy.dart';
|
|
|
|
/// Applies application media rules to a generic native file destination.
|
|
class NativeProjectDropRegion extends StatelessWidget {
|
|
const NativeProjectDropRegion({
|
|
super.key,
|
|
this.regionId = 'media-library',
|
|
this.policy = NativeFileDropPolicy.mediaLibrary,
|
|
required this.enabled,
|
|
required this.onEnter,
|
|
required this.onExit,
|
|
required this.onDrop,
|
|
required this.child,
|
|
});
|
|
final String regionId;
|
|
final NativeFileDropPolicy policy;
|
|
final bool enabled;
|
|
final ValueChanged<List<ExternalMediaFile>> onEnter;
|
|
final VoidCallback onExit;
|
|
final Future<void> Function(List<ExternalMediaFile>) onDrop;
|
|
final Widget child;
|
|
|
|
List<ExternalMediaFile> _files(List<String> paths) => [
|
|
for (final path in paths) ExternalMediaFile(path: path),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) => NativeFileDropRegion(
|
|
regionId: regionId,
|
|
configuration: policy.configuration,
|
|
enabled: enabled,
|
|
onEnter: (paths) => onEnter(_files(paths)),
|
|
onExit: onExit,
|
|
onDrop: (paths) => onDrop(_files(paths)),
|
|
child: child,
|
|
);
|
|
}
|