pickVideo static method

Future<UFileData?> pickVideo({
  1. UImageSource source = UImageSource.gallery,
  2. UCameraOptions options = const UCameraOptions(),
  3. dynamic action(
    1. UFileData?
    )?,
})

Implementation

static Future<UFileData?> pickVideo({
  UImageSource source = UImageSource.gallery,
  UCameraOptions options = const UCameraOptions(),
  Function(UFileData?)? action,
}) async {
  if (source == UImageSource.camera) return recordVideo(options: options, action: action);
  final List<UFileData> files = await showFilePicker(fileType: FileType.video);
  final UFileData? file = files.isEmpty ? null : files.first;
  action?.call(file);
  return file;
}