I get following error when using Circle Avatar:
The argument type 'Object' can't be assigned to the parameter type 'ImageProvider'
This is the code:
CircleAvatar(
backgroundImage: snapshot.data['imageUrl'] == ""
? AssetImage('assets/img.png')
: NetworkImage(snapshot.data['imageUrl']));
this is currently an open issue on GitHub with dart 2.12.
As a workaround you can cast the object
AssetImage('assets/img.png') as ImageProvider,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.