Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion lib/src/controls/flick_video_with_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class FlickVideoWithControls extends StatefulWidget {
color: Colors.white,
fontSize: 12,
),
this.backgroundImage,
this.backgroundImageFit = BoxFit.cover,
this.aspectRatioWhenLoading = 16 / 9,
this.willVideoPlayerControllerChange = true,
this.closedCaptionTextStyle = const TextStyle(
Expand All @@ -55,6 +57,12 @@ class FlickVideoWithControls extends StatefulWidget {
final BoxFit videoFit;
final Color backgroundColor;

/// Used in [FlickVideoPlayer] background image decoration.
final Image? backgroundImage;

/// The fit for video the background image.
final BoxFit backgroundImageFit;

/// Used in [DefaultTextStyle]
///
/// Use this property if you require to override the text style provided by the default Flick widgets.
Expand Down Expand Up @@ -114,7 +122,15 @@ class _FlickVideoWithControlsState extends State<FlickVideoWithControls> {
data: widget.iconThemeData,
child: LayoutBuilder(builder: (context, size) {
return Container(
color: widget.backgroundColor,
decoration: BoxDecoration(
color: widget.backgroundColor,
image: widget.backgroundImage == null
? null
: DecorationImage(
image: widget.backgroundImage!.image,
fit: widget.backgroundImageFit,
),
),
child: DefaultTextStyle(
style: widget.textStyle,
child: Stack(
Expand Down