Home > Software engineering >  I am having problem with displaying image in CircleAvatar from database . can u plz help me out?
I am having problem with displaying image in CircleAvatar from database . can u plz help me out?

Time:04-16

CircleAvatar( backgroundImage: snapshot.data['imageUrl']=="" ? AssetImage('assets/img.png'):NetworkImage(snapshot.data['imageUrl']), )

enter image description here

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,
  • Related