show static method
Future<void>
show(
- BuildContext context, {
- required String source,
- bool autoPlay = false,
- bool muted = false,
- bool showControls = true,
- WPVideoPlayerConfig? config,
- Color barrierColor = const Color(0xA604181F),
- double aspectRatio = 16 / 9,
Implementation
static Future<void> show(
BuildContext context, {
required String source,
bool autoPlay = false,
bool muted = false,
bool showControls = true,
WPVideoPlayerConfig? config,
Color barrierColor = const Color(0xA604181F),
double aspectRatio = 16 / 9,
}) async {
return showDialog(
context: context,
barrierColor: barrierColor,
builder: (_) {
return Center(
child: ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: 800,
),
child: AspectRatio(
aspectRatio: aspectRatio,
child: VideoPlayer(
source: source,
autoPlay: autoPlay,
muted: muted,
showControls: showControls,
config: config ?? context.wpWidgetsConfig.videoPlayer,
aspectRatio: aspectRatio,
),
),
),
);
},
);
}