我在使用flutter-image
. 我可以从我的设备渲染图像,但不能渲染来自互联网的图像!
我不得不提到,我将代码放在androidManifest文件中以获得互联网许可。
但它不起作用。这是我在颤振文档中的代码:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
var title = 'Web Images';
return MaterialApp(
title: title,
home: Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Image.network(
'https://picsum.photos/250?image=9',
),
),
);
}
}
我无法理解问题是什么!它不显示任何错误或抛出任何异常。图像根本不会出现在屏幕上。
我需要做些什么来获取从 Internet 或使用 url 呈现的图像吗?