这是我的代码:
import 'package:Flutter/material.dart';import 'package:test/news.dart';voID main() => runApp(new Main());class Main extends StatelessWidget { @overrIDe Widget build(BuildContext context) { return new MaterialApp( Title: 'Test',home: new Scaffold( body: new Image.network('www.Google.de/images/branding/Googlelogo/2x/Googlelogo_color_272x92dp.png'),appbar: new Appbar( Title: new Text("Test"),actions: <Widget>[ new Iconbutton(icon: new Icon(Icons.menu),onpressed: null),],),); }}解决方法 出于某种原因,Image.network似乎将URL解释为文件路径.
尝试明确地设置协议:
body: new Image.network('http://www.Google.de/images/branding/Googlelogo/2x/Googlelogo_color_272x92dp.png'),总结
以上是内存溢出为你收集整理的java – Flutter无法从url加载图像全部内容,希望文章能够帮你解决java – Flutter无法从url加载图像所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)