lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

`lh assets:resize`

Open maxzod opened this issue 4 years ago • 0 comments

the goal

  • add images in the beast quality and use the best resolution based on the screen size for better performance

How it will works

  • add your assets in 3x folder assets/images/3x
  • the LH will look into these folder resize images to other lower resolutions
  • you will use your assets normally and flutter will do the rest 💙 docs

example

  • assets/images/3x/foo.png
  • use the lh command
  • lh will resize it to smaller resolutions
  • use it like this
return Image.asset('assets/images/foo.png');
  • flutter will load the best resolution based on the screen size either form 1x or 2x or 3x

Notes

  • the command will delete the 2x and 1x folder then create them from scratch
  • support nested folders not just 1 level deep
  • support all platforms

maxzod avatar Nov 25 '21 23:11 maxzod