VideoEditorController.file constructor

VideoEditorController.file(
  1. File file, {
  2. Duration? maxDuration,
  3. TrimSliderStyle? trimStyle,
  4. CoverSelectionStyle? coverStyle,
  5. CropGridStyle? cropStyle,
})

Constructs a VideoEditorController that edits a video from a file.

The file argument must not be null.

Implementation

VideoEditorController.file(
  this.file, {
  Duration? maxDuration,
  TrimSliderStyle? trimStyle,
  CoverSelectionStyle? coverStyle,
  CropGridStyle? cropStyle,
})  : _video = VideoPlayerController.file(File(
        // https://github.com/flutter/flutter/issues/40429#issuecomment-549746165
        Platform.isIOS ? Uri.encodeFull(file.path) : file.path,
      )),
      _maxDuration = maxDuration ?? Duration.zero,
      cropStyle = cropStyle ?? CropGridStyle(),
      coverStyle = coverStyle ?? CoverSelectionStyle(),
      trimStyle = trimStyle ?? TrimSliderStyle();