From ff934d0f08664aa16e28052ffd624609741da860 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 23 Nov 2025 11:39:52 +0800 Subject: [PATCH] :lipstick: Update the captcha style --- lib/screens/auth/captcha.native.dart | 11 ++++++----- lib/screens/auth/captcha.web.dart | 15 ++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/screens/auth/captcha.native.dart b/lib/screens/auth/captcha.native.dart index 2ef1f5c7..44591200 100644 --- a/lib/screens/auth/captcha.native.dart +++ b/lib/screens/auth/captcha.native.dart @@ -6,11 +6,12 @@ import 'package:island/widgets/content/sheet.dart'; class CaptchaScreen extends ConsumerWidget { static Future show(BuildContext context) { - return showModalBottomSheet( - context: context, - isScrollControlled: true, - isDismissible: false, - builder: (context) => const CaptchaScreen(), + return Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const CaptchaScreen(), + fullscreenDialog: true, + ), ); } diff --git a/lib/screens/auth/captcha.web.dart b/lib/screens/auth/captcha.web.dart index fe80717e..69c938b5 100644 --- a/lib/screens/auth/captcha.web.dart +++ b/lib/screens/auth/captcha.web.dart @@ -1,5 +1,3 @@ -// ignore_for_file: invalid_runtime_check_with_js_interop_types - import 'dart:ui_web' as ui; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:island/pods/config.dart'; @@ -10,11 +8,12 @@ import 'package:flutter/material.dart'; class CaptchaScreen extends ConsumerStatefulWidget { static Future show(BuildContext context) { - return showModalBottomSheet( - context: context, - isDismissible: false, - isScrollControlled: true, - builder: (context) => const CaptchaScreen(), + return Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const CaptchaScreen(), + fullscreenDialog: true, + ), ); } @@ -29,7 +28,9 @@ class _CaptchaScreenState extends ConsumerState { void _setupWebListener(String serverUrl) async { web.window.onMessage.listen((event) { + // ignore: invalid_runtime_check_with_js_interop_types if (event.data != null && event.data is String) { + // ignore: invalid_runtime_check_with_js_interop_types final message = event.data as String; if (message.startsWith("captcha_tk=")) { String token = message.replaceFirst("captcha_tk=", "");