showCaptchaDialog method

void showCaptchaDialog(
  1. List<String> captchaImages,
  2. dynamic onConfirm(
    1. bool
    ), {
  3. String slideBarText = '滑动拼图到正确的位置',
  4. double? width,
})

Implementation

void showCaptchaDialog(
  List<String> captchaImages,
  Function(bool) onConfirm, {
  String slideBarText = '滑动拼图到正确的位置',
  double? width,
}) {
  if (captchaImages.isEmpty) {
    return;
  }
  final random = Random();
  int randomInt = random.nextInt(captchaImages.length);
  String image = captchaImages[randomInt];
  Get.dialog(
    _buildCaptchaView(
      image,
      width,
      slideBarText,
      onConfirm,
    ),
  );
}