TrimEditor constructor
- Key? key,
- required Trimmer trimmer,
- double viewerWidth = 50.0 * 8,
- double viewerHeight = 50,
- BoxFit fit = BoxFit.fitHeight,
- Duration maxVideoLength = const Duration(milliseconds: 0),
- double circleSize = 5.0,
- double borderWidth = 3,
- double scrubberWidth = 4,
- double circleSizeOnDrag = 8.0,
- Color circlePaintColor = Colors.white,
- Color borderPaintColor = Colors.orange,
- Color scrubberPaintColor = Colors.orange,
- int thumbnailQuality = 75,
- bool showDuration = true,
- int sideTapSize = 24,
- TextStyle durationTextStyle = const TextStyle(color: Colors.white),
- dynamic onChangeStart(
- double startValue
- dynamic onChangeEnd(
- double endValue
- dynamic onChangePlaybackState(
- bool isPlaying
Widget for displaying the video trimmer.
This has frame wise preview of the video with a slider for selecting the part of the video to be trimmed.
The required parameters are viewerWidth
& viewerHeight
-
viewerWidth
to define the total trimmer area width. -
viewerHeight
to define the total trimmer area height.
The optional parameters are:
-
fit
for specifying the image fit type of each thumbnail image. By default it is set toBoxFit.fitHeight
. -
maxVideoLength
for specifying the maximum length of the output video. -
circleSize
for specifying a size to the holder at the two ends of the video trimmer area, while it isidle
. By default it is set to5.0
. -
circleSizeOnDrag
for specifying a size to the holder at the two ends of the video trimmer area, while it is beingdragged
. By default it is set to8.0
. -
circlePaintColor
for specifying a color to the circle. By default it is set toColors.white
. -
borderPaintColor
for specifying a color to the border of the trim area. By default it is set toColors.white
. -
scrubberPaintColor
for specifying a color to the video scrubber inside the trim area. By default it is set toColors.white
. -
thumbnailQuality
for specifying the quality of each generated image thumbnail, to be displayed in the trimmer area. -
showDuration
for showing the start and the end point of the video on top of the trimmer area. By default it is set totrue
. -
durationTextStyle
is for providing aTextStyle
to the duration text. By default it is set toTextStyle(color: Colors.white)
-
onChangeStart
is a callback to the video start position. -
onChangeEnd
is a callback to the video end position. -
onChangePlaybackState
is a callback to the video playback state to know whether it is currently playing or paused.
Implementation
TrimEditor({
Key? key,
required this.trimmer,
this.viewerWidth = 50.0 * 8,
this.viewerHeight = 50,
this.fit = BoxFit.fitHeight,
this.maxVideoLength = const Duration(milliseconds: 0),
this.circleSize = 5.0,
this.borderWidth = 3,
this.scrubberWidth = 4,
this.circleSizeOnDrag = 8.0,
this.circlePaintColor = Colors.white,
this.borderPaintColor = Colors.orange,
this.scrubberPaintColor = Colors.orange,
this.thumbnailQuality = 75,
this.showDuration = true,
this.sideTapSize = 24,
this.durationTextStyle = const TextStyle(color: Colors.white),
this.onChangeStart,
this.onChangeEnd,
this.onChangePlaybackState,
}) : super(key: key);