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']));
CodePudding user response:
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,