Asset Images not showing up in FLutter Web when doing flutter run -- release

Viewed 759

When I was trying to execute my flutter project as

flutter run

The screenshot is the display

this is how it displays with flutter run

All the assets display as intended.

But when I use

flutter run --release

The screenshot is the display

this is how it displays with flutter run -- release

No asset displays and blank stuff is displayed instead

I have tried most fixes already available but nothing worked so far. I have put changed the image's location to be outside the assets folder but still no luck.


Pubspec.yaml

name: portfolio
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  animated_text_kit: ^4.1.1
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
flutter:

  uses-material-design: true
  assets:
    - assets/
    - safar.png
    - Geoshare.png
    - sahulat.png
    - swish.png

  fonts:
    - family: Mont
      fonts:
        - asset: assets/MontserratAlternates-Light.ttf
          weight: 300
    - family: Agustina
      fonts:
        - asset: assets/Agustina.ttf

Flutter Doctor

Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
    • Flutter version 2.2.0 at C:\src\flutter
    • Framework revision b22742018b (13 days ago), 2021-05-14 19:12:57 -0700
    • Engine revision a9d88a4d18
    • Dart version 2.13.0

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\hamas\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.56.2)
    • VS Code at C:\Users\hamas\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.22.0

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 
0 Answers
Related