I have a problem that, when trying to show an AssetImage, it will not show when the app opens. It does show, however, after performing a hot reload.
The problem only appears on iOS, and was tested on both a physical device and the simulator.
Flutter doctor gives no problems.
Here's my pubspec.yaml
:
flutter:
assets:
- assets/images/
In images I have appIcon.png
that shows, and 1.png
that does not show. appIcon.png
is inside my main, while 1.png
is called from a StatelessWidget that calls a StatefulWidget containing the image.
I'm trying to show the image here:
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/1.png"),
colorFilter: ColorFilter.mode(
Colors.black.withOpacity(saturation),
BlendMode.dstIn
)
),
),
...
),
I don't know what else to include for debugging purposes, or where to look for solutions.
I have tried indentation problems in the pubspec.yaml as proposed here: AssetImage is not not displaying image in flutter app
But with no luck.