记录Flutter开发中遇到的各种问题(持续更新)

174 阅读1分钟

在Chrome中调试Flutter程序,dio报错: The XMLHttpRequest onError callback was called


[flutter dio: The XMLHttpRequest onError callback was called]

解决:用'--disable-web-security'禁用CORS策略

1- Go to flutter\bin\cache and remove a file named: flutter_tools.stamp

2- Go to flutter\packages\flutter_tools\lib\src\web and open the file chrome.dart.

3- Find '--disable-extensions'

4- Add '--disable-web-security'