TrimmerWidget constructor

const TrimmerWidget({
  1. Key? key,
  2. required FlutterVideoTrimmer flutterVideoTrimmer,
  3. ViewerType type = ViewerType.auto,
  4. double viewerWidth = 400,
  5. double viewerHeight = 50,
  6. Duration maxVideoLength = const Duration(milliseconds: 0),
  7. double paddingFraction = 0.2,
  8. bool showDuration = true,
  9. TextStyle durationTextStyle = const TextStyle(color: Colors.white),
  10. DurationStyle durationStyle = DurationStyle.FORMAT_HH_MM_SS,
  11. TrimEditorProperties editorProperties = const TrimEditorProperties(),
  12. TrimmerShapeProps areaProperties = const TrimmerShapeProps(),
  13. dynamic onChangeStart(
    1. double startValue
    )?,
  14. dynamic onChangeEnd(
    1. double endValue
    )?,
  15. dynamic onChangePlaybackState(
    1. bool isPlaying
    )?,
  16. VoidCallback? onThumbnailLoadingComplete,
})

A widget to display and interact with a video timeline (thumbnails + scrubber).

Automatically selects between FixedTrimViewer and ScrollableTrimViewer based on the type and available video length.

Throws an error if type == ViewerType.scrollable and the video duration is shorter than maxVideoLength + padding.

Implementation

const TrimmerWidget({
  super.key,
  required this.flutterVideoTrimmer,
  this.type = ViewerType.auto,
  this.viewerWidth = 400,
  this.viewerHeight = 50,
  this.maxVideoLength = const Duration(milliseconds: 0),
  this.paddingFraction = 0.2,
  this.showDuration = true,
  this.durationTextStyle = const TextStyle(color: Colors.white),
  this.durationStyle = DurationStyle.FORMAT_HH_MM_SS,
  this.editorProperties = const TrimEditorProperties(),
  this.areaProperties = const TrimmerShapeProps(),
  this.onChangeStart,
  this.onChangeEnd,
  this.onChangePlaybackState,
  this.onThumbnailLoadingComplete,
});