Ошибка сборки Flutter: не найдено: 'dart: html' import 'dart: html' http-0.12.2 - PullRequest
0 голосов
/ 04 августа 2020

Не уверен, как попал в ошибку компиляции:

Compiler message:                                                       
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart:6:8: Error: Not found: 'dart:html'
import 'dart:html';                                                     
       ^                                                                
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart:34:18: Error: 'HttpRequest' isn't a type.
  final _xhrs = <HttpRequest>{};                                        
                 ^^^^^^^^^^^                                            
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart:58:34: Error: 'Blob' isn't a type.
      var blob = xhr.response as Blob ?? Blob([]);                      
                                 ^^^^                                   
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart:46:15: Error: The method 'HttpRequest' isn't defined for the class 'BrowserClient'.
 - 'BrowserClient' is from 'package:http/src/browser_client.dart' ('../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart').
Try correcting the name to the name of an existing method, or defining a method named 'HttpRequest'.
    var xhr = HttpRequest();                                            
              ^^^^^^^^^^^                                               
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart:58:42: Error: The method 'Blob' isn't defined for the class 'BrowserClient'.
 - 'BrowserClient' is from 'package:http/src/browser_client.dart' ('../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart').
Try correcting the name to the name of an existing method, or defining a method named 'Blob'.
      var blob = xhr.response as Blob ?? Blob([]);                      
                                         ^^^^                           
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart:59:20: Error: The method 'FileReader' isn't defined for the class 'BrowserClient'.
 - 'BrowserClient' is from 'package:http/src/browser_client.dart' ('../../development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/browser_client.dart').
Try correcting the name to the name of an existing method, or defining a method named 'FileReader'.
      var reader = FileReader();                                        
                   ^^^^^^^^^^   

1 Ответ

0 голосов
/ 04 августа 2020

Попробуйте очистить кеши пакетов.

pub cache repair

и

flutter clean 
...