Blue Circle is displayed in CircleAvatar Asset image instead of real image in flutter
403
- First, make you have added image on
pubspec.yaml
. - while loading data from asset, do restart the app, not hot reload or restart.
- if it fails, do
flutter clean
and run again. - else, make sure about image path.
- also check this doc for supported image in flutter
Author by
Flutty dev
Updated on December 31, 2022Comments
-
Flutty dev over 1 year
I am trying to display the image in the Card widget in leading CircleAvatar below is my code
child: Card( child: ListTile( onTap: () {}, title: Text(locations[index].location.toString()), leading: CircleAvatar( radius: 18.0, backgroundImage: AssetImage('assets/${locations[index].flag}'),)
Instead of the real image, I want to show, Blue color is displayed in the circle as shown in below attachment
-
Peter Koltai over 2 yearsare these assets listed in your
pubspec.yaml
file underassets:
?
-
-
Flutty dev over 2 yearsRestarting the app work for me, Thank you