Ver Fonte

чыыч

ub3lal há 1 mês atrás
pai
commit
5b191ce69f
1 ficheiros alterados com 7 adições e 2 exclusões
  1. 7 2
      lib/src/http_request.dart

+ 7 - 2
lib/src/http_request.dart

@@ -1,3 +1,4 @@
+import 'dart:convert';
 import 'dart:isolate';
 import 'dart:typed_data';
 import 'package:http/http.dart' as http;
@@ -69,8 +70,12 @@ class HttpGetImage {
         if (response.statusCode == 200) {
           try {
             if (response.body.isNotEmpty) {
-              sendPort.send(null);
-              break;
+              final data = jsonDecode(response.body);
+
+              if (data is Map) {
+                sendPort.send(null);
+                break;
+              }
             }
           } catch (e) {}