showSingleChoiceSurvey method

Future<void> showSingleChoiceSurvey({
  1. required String videoAsset,
  2. required String userName,
  3. required String companyTitle,
  4. String? avatarUrl,
  5. required String question,
  6. required List<Choice> choices,
  7. required OnTapChoice onTapChoice,
  8. required Function onVideoEndAction,
  9. Function? onExpand,
  10. Function? onClose,
  11. Function? onSkip,
})

Implementation

Future<void> showSingleChoiceSurvey({
  required String videoAsset,
  required String userName,
  required String companyTitle,
  String? avatarUrl,
  required String question,
  required List<Choice> choices,
  required OnTapChoice onTapChoice,
  required Function onVideoEndAction,
  Function? onExpand,
  Function? onClose,
  Function? onSkip,
}) async {
  return showVideoAsset(
    videoAsset: videoAsset,
    userName: userName,
    companyTitle: companyTitle,
    avatarUrl: avatarUrl,
    onVideoEndAction: onVideoEndAction,
    onSkip: onSkip,
    onClose: onClose,
    onExpand: onExpand,
    animateOnVideoEnd: false,
    child: SingleChoiceForm(
      question: question,
      choices: choices,
      onTap: (ctx, choice) {
        onTapChoice(choice);
        Actions.maybeInvoke(ctx, const CloseVideoIntent());
        Future.delayed(const Duration(milliseconds: 500), () {
          _overlayHelper.popHelper();
        });
      },
    ),
  );
}