i want to deploy program with .png files, in my local server(vscode hot reload) images are show clearly but i build flutter and deploy it to netlify, images are not shown. there is no problem without image so i think problem is not about netlify configuration or settings
in main.dart, i use .png file
Image.asset(
'images/value_test.png',
fit: BoxFit.fill,
),
in pubspec.yaml
flutter:
uses-material-design: true
assets:
- images/expectation.png
- images/result.png
- images/ai_consultation.png
- images/value_test.png
- images/mbti.png
i wrote code like above and enter image description here
my directory make up like screenshot
developer mode in firefox browser, enter image description here i think .png files were treated like html i don’t know this is right
i tried to change my directory composition, but it didn’t work i changed pubspec.yaml to
flutter:
uses-material-design: true
assets:
– assets/images/expectation.png
– assets/images/result.png
– assets/images/ai_consultation.png
– assets/images/value_test.png
– assets/images/mbti.png
but this works great in local but not good at netlify(builded version)
it’s my first time in programming so i don’t know how to fix this error i search web, ask to gpt and do everything i can but i don’t know how to do it
user26652324 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.