diff --git a/lib/src/controls/flick_video_with_controls.dart b/lib/src/controls/flick_video_with_controls.dart index c8d38ec..eb0970b 100644 --- a/lib/src/controls/flick_video_with_controls.dart +++ b/lib/src/controls/flick_video_with_controls.dart @@ -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( @@ -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. @@ -114,7 +122,15 @@ class _FlickVideoWithControlsState extends State { 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(