flutter_launcher_icons icon indicating copy to clipboard operation
flutter_launcher_icons copied to clipboard

New scheme for flutter_icons_config.yaml file

Open RatakondalaArun opened this issue 2 years ago • 1 comments

Hi @'MarkOSullivan94, @'bradintheusa

I am thinking about restructuring flutter_icons_config.yaml format

current config

flutter_icons:
  image_path: "assets/images/icon-128x128.png"
  image_path_android: "assets/images/icon-710x599-android.png"
  image_path_ios: "assets/images/icon-1024x1024.png"
  android: true # can specify file name here e.g. "ic_launcher"
  ios: true # can specify file name here e.g. "My-Launcher-Icon"
  adaptive_icon_background: "assets/images/christmas-background.png" # only available for Android 8.0 devices and above
  adaptive_icon_foreground: "assets/images/icon-foreground-432x432.png" # only available for Android 8.0 devices and above
  # if I add support for web
  web: true
  image_path_web: "path/to/web.png"
  background_color_web: "#hexcolor"
  theme_color_web: "#hexcolor"
  # if we add support for linux
  linux true
  image_path_linux: "path/to/image.png"
  #if we add support for windows
  windows: true
  image_path_windows: true
  # ... and so on with other platforms

My suggestion

image_path: "path/to/image.png" # fallback if not specified for platform
android:
  generate: true # specifies weather to generate icons for this platform or not
  image_path: "path/to/image.png"
  adaptive_icon_background: "path/to/image.png"
  adaptive_icon_foreground: "path/to/image.png"
ios:
  generate: true
  image_path: "path/to/image.png"
web:
  generate: true
  image_path: "path/to/image.png"
  background_color: "#hexcode"
  theme_color: "#hexcode"
linux:
  generate: true
  image_path: "path/to/image.png"
windows:
  generate: true
  image_path: "path/to/image.png"
macos:
 generate: true
 image_path: "path/to/image.png"

What this will bring to the table?

  • better organized configs
  • easy to maintain
  • we can also use checked_yaml to add static support

Let me know what you guys think

Originally posted by @RatakondalaArun in https://github.com/fluttercommunity/flutter_launcher_icons/issues/363#issuecomment-1173132953

RatakondalaArun avatar Jul 08 '22 16:07 RatakondalaArun

I think this should arrive once support for all the other platforms has been added and then we update the major version for flutter_launcher_icons to indicate a breaking change in the config

MarkOSullivan94 avatar Jul 26 '22 13:07 MarkOSullivan94