showVideoAsset method

Future<void> showVideoAsset({
  1. required BuildContext context,
  2. required String videoAsset,
  3. required String userName,
  4. required String companyTitle,
  5. required Function onVideoEndAction,
  6. required bool animateOnVideoEnd,
  7. Function? onClose,
  8. Function? onExpand,
  9. String? avatarUrl,
  10. Widget? child,
  11. Function? onSkip,
})

Implementation

Future<void> showVideoAsset({
  required BuildContext context,
  required String videoAsset,
  required String userName,
  required String companyTitle,
  required Function onVideoEndAction,
  required bool animateOnVideoEnd,
  Function? onClose,
  Function? onExpand,
  String? avatarUrl,
  Widget? child,
  Function? onSkip,
}) async {
  _overlayHelper.showHelper(
    context,
    (ctx) => Material(
      color: Colors.transparent,
      type: MaterialType.transparency,
      child: SafeArea(
        child: Align(
          alignment: Alignment.bottomLeft,
          child: Padding(
            padding: const EdgeInsets.only(left: 32.0),
            child: BouncingCircleBg(
              radius: 40,
              child: VideoMiniature(
                videoAsset: videoAsset,
                radius: 80,
                onTap: () {
                  if (onExpand != null) {
                    onExpand();
                  }
                  _overlayHelper.popHelper();
                  showExpandedVideoAsset(
                    context: ctx,
                    videoAsset: videoAsset,
                    userName: userName,
                    companyTitle: companyTitle,
                    animateOnVideoEnd: animateOnVideoEnd,
                    child: child,
                    onVideoEndAction: onVideoEndAction,
                    close: () {
                      _overlayHelper.popHelper();
                      if (onClose != null) {
                        onClose();
                      }
                    },
                    onSkip: () {
                      _overlayHelper.popHelper();
                      if (onSkip != null) {
                        onSkip();
                      }
                    },
                  );
                },
              ),
            ),
          ),
        ),
      ),
    ),
  );
}