From c143bf8e25075f09c4a773292fc4fff02172e5c1 Mon Sep 17 00:00:00 2001 From: yuluo Date: Wed, 24 Apr 2024 01:07:45 +0800 Subject: [PATCH] fix: web platforms --- flutter/lib/utils/http_service.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flutter/lib/utils/http_service.dart b/flutter/lib/utils/http_service.dart index bca5c032a..df6b50c3a 100644 --- a/flutter/lib/utils/http_service.dart +++ b/flutter/lib/utils/http_service.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; import '../models/platform_model.dart'; export 'package:http/http.dart' show Response; @@ -13,6 +14,10 @@ class HttpService { dynamic body, }) async { headers ??= {'Content-Type': 'application/json'}; + // For web platforms + if (kIsWeb) { + return await _pollFultterHttp(url, method, headers: headers, body: body); + } // Determine if there is currently a proxy setting, and if so, use FFI to call the Rust HTTP method. final isProxy = await bind.mainGetProxyStatus();