Flutter自动生成安卓和IOS图标

flutter_launcher_icons

  • 用这个库自动生成

  • 首先添加依赖

    dev_dependencies: 
      flutter_launcher_icons: 
    
    flutter_icons:
      android: "launcher_icon" 
      ios: true
      image_path: "assets/icon.png"
    
  • 然后添加一张1024*1024像素的图到assets目录下,命名为icon.png

  • 打开终端

    flutter packages get
    flutter packages pub run flutter_launcher_icons:main
    
    
  • 安卓图标目录是android\app\src\main\res

    image-20211105155956651

  • IOS目录为ios\Runner\Assets.xcassets\AppIcon.appiconset

    image-20211105160056654

  • 大功告成!

参考: https://www.cnblogs.com/hupo376787/p/10288199.html

posted @ 2021-11-05 16:02  R1cardo  阅读(233)  评论(0编辑  收藏  举报