flutterflutter-layoutflutter-assetimage

How to manage/add multiple image resolution/size in flutter for responsive UI


I have bitmap images from an array of different dpis, how can I properly arrange them on flutter? - Just like placing them on mipmaps folders on Android.

Dpi list:


Solution

  • What you need to do is arrange your image assets following this flutter pattern

    So, if you set your image path on pubspec.yaml to something like:

    flutter:
      assets:
        - images/
    

    You'd simple need to arrange your files as follow:

    And when you use Image.asset("images/my_icon.png") flutter will automatically assign the correct asset.