show static method

Future<void> show(
  1. BuildContext context, {
  2. required String source,
  3. bool autoPlay = false,
  4. bool muted = false,
  5. WPVideoPlayerConfig? config,
  6. Color barrierColor = const Color(0xA604181F),
  7. double aspectRatio = 16 / 9,
})

Implementation

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