💄 Update the captcha style
This commit is contained in:
@@ -6,11 +6,12 @@ import 'package:island/widgets/content/sheet.dart';
|
|||||||
|
|
||||||
class CaptchaScreen extends ConsumerWidget {
|
class CaptchaScreen extends ConsumerWidget {
|
||||||
static Future<String?> show(BuildContext context) {
|
static Future<String?> show(BuildContext context) {
|
||||||
return showModalBottomSheet<String>(
|
return Navigator.push<String>(
|
||||||
context: context,
|
context,
|
||||||
isScrollControlled: true,
|
MaterialPageRoute(
|
||||||
isDismissible: false,
|
builder: (context) => const CaptchaScreen(),
|
||||||
builder: (context) => const CaptchaScreen(),
|
fullscreenDialog: true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// ignore_for_file: invalid_runtime_check_with_js_interop_types
|
|
||||||
|
|
||||||
import 'dart:ui_web' as ui;
|
import 'dart:ui_web' as ui;
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/pods/config.dart';
|
import 'package:island/pods/config.dart';
|
||||||
@@ -10,11 +8,12 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class CaptchaScreen extends ConsumerStatefulWidget {
|
class CaptchaScreen extends ConsumerStatefulWidget {
|
||||||
static Future<String?> show(BuildContext context) {
|
static Future<String?> show(BuildContext context) {
|
||||||
return showModalBottomSheet<String>(
|
return Navigator.push<String>(
|
||||||
context: context,
|
context,
|
||||||
isDismissible: false,
|
MaterialPageRoute(
|
||||||
isScrollControlled: true,
|
builder: (context) => const CaptchaScreen(),
|
||||||
builder: (context) => const CaptchaScreen(),
|
fullscreenDialog: true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +28,9 @@ class _CaptchaScreenState extends ConsumerState<CaptchaScreen> {
|
|||||||
|
|
||||||
void _setupWebListener(String serverUrl) async {
|
void _setupWebListener(String serverUrl) async {
|
||||||
web.window.onMessage.listen((event) {
|
web.window.onMessage.listen((event) {
|
||||||
|
// ignore: invalid_runtime_check_with_js_interop_types
|
||||||
if (event.data != null && event.data is String) {
|
if (event.data != null && event.data is String) {
|
||||||
|
// ignore: invalid_runtime_check_with_js_interop_types
|
||||||
final message = event.data as String;
|
final message = event.data as String;
|
||||||
if (message.startsWith("captcha_tk=")) {
|
if (message.startsWith("captcha_tk=")) {
|
||||||
String token = message.replaceFirst("captcha_tk=", "");
|
String token = message.replaceFirst("captcha_tk=", "");
|
||||||
|
|||||||
Reference in New Issue
Block a user