VideoEditorController.file constructor

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

Constructs a VideoEditorController that edits a video from a file.

The file argument must not be null.

Implementation

VideoEditorController.file(
  this.file, {
  this.maxDuration = Duration.zero,
  this.minDuration = Duration.zero,
  this.coverStyle = const CoverSelectionStyle(),
  this.cropStyle = const CropGridStyle(),
  TrimSliderStyle? trimStyle,
})  : _video = VideoPlayerController.file(File(
        // https://github.com/flutter/flutter/issues/40429#issuecomment-549746165
        Platform.isIOS ? Uri.encodeFull(file.path) : file.path,
      )),
      trimStyle = trimStyle ?? TrimSliderStyle(),
      assert(maxDuration > minDuration,
          'The maximum duration must be bigger than the minimum duration');