AssetImage is not displaying image in flutter app

前端 未结 9 558
野趣味
野趣味 2021-01-13 00:33

image not displaying in flutter app. But I got some errors in debug console.

I/FlutterActivityDelegate(22603): onResume setting current activity to this
I/Fl         


        
相关标签:
9条回答
  • 2021-01-13 00:53

    Make sure your image folder is in project folder.

    0 讨论(0)
  • 2021-01-13 00:54

    Make sure the folder you are referring in Image.asset contains the file.

    For example:

    Image.asset(
    "./assets/images/loading.gif",
    height: 125.0,
    width: 125.0,
    )
    

    The folder should be:

    C:\your_app_folder\assets\images
    

    pubspec.yaml:

      assets:
        - assets/
        - assets/images/
    

    Run flutter clean to clean the intermediate files and refresh.

    0 讨论(0)
  • 2021-01-13 01:02

    my problem was indentation of assets section. I wrote it at the beginning of the line, whereas it should be indented with a Tab after flutter: section.

    Robie

    0 讨论(0)
提交回复
热议问题