修正上架時 Google Play 檢查出的 issue
This commit is contained in:
+5
-2
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/foundation.dart'; // 必須引入這個才能使用 kReleaseMode
|
||||
import 'News/news_manager.dart';
|
||||
import './placeholder_screens.dart';
|
||||
import './login_page.dart'; // 確保引入登入頁面
|
||||
import 'historys/login_page.dart'; // 確保引入登入頁面
|
||||
import './auth_manager.dart';
|
||||
|
||||
/*
|
||||
您的 Dart HTTP 客戶端可能無法完成與伺服器的 SSL/TLS 握手。這需要將您的整個 App 結構調整為使用 io.HttpClient
|
||||
警告: 這是一個臨時且不安全的解決方案。 它會強制 Dart 客戶端信任所有憑證。只建議在無法控制伺服器憑證或開發環境中臨時使用。
|
||||
@@ -30,7 +32,8 @@ class MyHttpOverrides extends HttpOverrides {
|
||||
HttpClient createHttpClient(SecurityContext? context) {
|
||||
return super.createHttpClient(context)
|
||||
..badCertificateCallback =
|
||||
(X509Certificate cert, String host, int port) => true; // 總是回傳 true (忽略 SSL 錯誤)
|
||||
(cert, host, port) => !kReleaseMode;
|
||||
// (X509Certificate cert, String host, int port) => true; // 總是回傳 true (忽略 SSL 錯誤)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user