The following ProgressEvent$
object was thrown resolving an image codec:
解析图像编解码器时引发了以下ProgressEvent$对象:
[object ProgressEvent]
When the exception was thrown, this was the stack:
抛出异常时,堆栈如下:
final picture=user['picture']['thumbnail'];
return ListTile(
title: Text(firstName+' '+lastName),
subtitle: Text(email),
leading: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(picture),
),
);
更多回答
Please provide enough code so others can better understand or reproduce the problem.
请提供足够的代码,以便其他人能够更好地理解或重现问题。
优秀答案推荐
Here's what you've been looking for in the minimum viable way.
这就是你一直在寻找的最低限度可行的方式。
Source code:
源代码:
import "package:flutter/material.dart";
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: NewHomePage(),
debugShowCheckedModeBanner: false,
);
}
}
class NewHomePage extends StatefulWidget {
const NewHomePage({super.key});
@override
State<NewHomePage> createState() => _NewHomePageState();
}
class _NewHomePageState extends State<NewHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: ListView.separated(
itemCount: 20,
itemBuilder: (BuildContext context, int index) {
return ListTile(
dense: true,
leading: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
"https://picsum.photos/${index * 50}",
height: 50,
width: 50,
fit: BoxFit.cover,
),
),
title: Text("Title: $index"),
subtitle: Text("Subtitle: $index"),
trailing: const Icon(Icons.arrow_forward_ios),
onTap: () {},
);
},
separatorBuilder: (BuildContext context, int index) {
return const Divider(height: 1, thickness: 1);
},
),
),
);
}
}
更多回答
我是一名优秀的程序员,十分优秀!