From 24313ab3b80869b3fc5c5f965e2bc36fa36c3c30 Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Tue, 7 May 2024 20:16:03 +0800 Subject: [PATCH] feat: fix debug crash --- lib/ui/splash_ui.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ui/splash_ui.dart b/lib/ui/splash_ui.dart index c669f2b..2d60548 100644 --- a/lib/ui/splash_ui.dart +++ b/lib/ui/splash_ui.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:fluent_ui/fluent_ui.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:go_router/go_router.dart'; import 'package:hive/hive.dart'; @@ -75,7 +76,8 @@ class SplashUI extends HookConsumerWidget { await _showAlert(context, appConf); } try { - await URLConf.checkHost(); + // crash on debug mode, why? + if (!kDebugMode) await URLConf.checkHost(); } catch (e) { dPrint("checkHost Error:$e"); }