diff --git a/CHANGELOG.md b/CHANGELOG.md index 486f820..f8644d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog -## Unreleased -- Improvement package CI/CD +## 3.0.0-beta.4 +- Add new support `Dark` and `Tinted` icons for iOS 18 - Add new command for generating all flavors at once: `--flavors` +- Improvement package CI/CD ## 3.0.0-beta.3 - Fixed iOS Icon generator diff --git a/README.md b/README.md index 00cb80b..0cd47cc 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,8 @@ Shown below is the full list of attributes which you can specify within your Ico | -------------- | ------- | ------- | ------------------------------- | | `enable` | Boolean | `false` | Use for enable iOS platform | | `image_path` | String | `null` | The image file path | +| `dark_path` | String | `null` | The dark image file path | +| `tinted_path` | String | `null` | The tinted image file path | | Web Option | Type | Default | Description | | -------------- | ------- | ------- | ------------------------------- | @@ -182,7 +184,7 @@ Shown below is the full list of attributes which you can specify within your Ico Create a Icons Launcher configuration file for your flavor. The config file is called `icons_launcher-.yaml` by replacing `` by the name of your desired flavor. -Example: `icons_launcher-dev.yaml`, `icons_launcher-uat.yaml`, `icons_launcher-prod.yaml` +Example: `icons_launcher-dev.yaml` and `icons_launcher-prod.yaml` Run with flavor: @@ -191,9 +193,6 @@ flutter pub get # create for dev flavor dart run icons_launcher:create --flavor dev -# create for uat flavor -dart run icons_launcher:create --flavor uat - # create for prod flavor dart run icons_launcher:create --flavor prod ``` @@ -201,7 +200,7 @@ dart run icons_launcher:create --flavor prod Alternatively, you can run multiple flavors at the same time with the following command: ```bash -dart run icons_launcher:create --flavors dev,uat,prod +dart run icons_launcher:create --flavors dev,prod ``` The configuration file format is the same. @@ -226,6 +225,9 @@ icons_launcher: ios: enable: true image_path: "assets/ic_logo_rectangle.png" + # For iOS 18+ (support dark and tinted) + # dark_path: "assets/ic_logo_rectangle_dark.png" + # tinted_path: "assets/ic_logo_rectangle_tinted.png" web: enable: true image_path: "assets/ic_logo_radius.png" @@ -240,3 +242,8 @@ icons_launcher: enable: false image_path: "assets/ic_logo_radius.png" ``` +--- + +## Activities + +![Alt](https://repobeats.axiom.co/api/embed/5309e2f5c1da2066439a06cc4ef66881a13947c5.svg "analytics") diff --git a/example/.DS_Store b/example/.DS_Store new file mode 100644 index 0000000..58b33a1 Binary files /dev/null and b/example/.DS_Store differ diff --git a/example/flavor_app/assets/ic_logo_rectangle_dark.png b/example/flavor_app/assets/ic_logo_rectangle_dark.png new file mode 100644 index 0000000..43a789e Binary files /dev/null and b/example/flavor_app/assets/ic_logo_rectangle_dark.png differ diff --git a/example/flavor_app/assets/ic_logo_rectangle_tinted.png b/example/flavor_app/assets/ic_logo_rectangle_tinted.png new file mode 100644 index 0000000..94cc2f9 Binary files /dev/null and b/example/flavor_app/assets/ic_logo_rectangle_tinted.png differ diff --git a/example/flavor_app/icons_launcher-dev.yaml b/example/flavor_app/icons_launcher-dev.yaml index 852712c..1f4a1cb 100644 --- a/example/flavor_app/icons_launcher-dev.yaml +++ b/example/flavor_app/icons_launcher-dev.yaml @@ -14,6 +14,9 @@ icons_launcher: ios: enable: true image_path: "assets/ic_logo_rectangle.png" + # For iOS 18+ (support dark and tinted) + # dark_path: "assets/ic_logo_rectangle_dark.png" + # tinted_path: "assets/ic_logo_rectangle_tinted.png" web: enable: true image_path: "assets/ic_logo_radius.png" diff --git a/example/flavor_app/icons_launcher-prod.yaml b/example/flavor_app/icons_launcher-prod.yaml index 106a274..dcaa272 100644 --- a/example/flavor_app/icons_launcher-prod.yaml +++ b/example/flavor_app/icons_launcher-prod.yaml @@ -14,6 +14,9 @@ icons_launcher: ios: enable: true image_path: "assets/ic_logo_rectangle.png" + # For iOS 18+ (support dark and tinted) + # dark_path: "assets/ic_logo_rectangle_dark.png" + # tinted_path: "assets/ic_logo_rectangle_tinted.png" web: enable: true image_path: "assets/ic_logo_radius.png" diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Contents.json b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Contents.json index 397b582..b73c483 100644 --- a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Contents.json +++ b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Contents.json @@ -1,142 +1,117 @@ { "images": [ - { - "filename": "Icon-App-20x20@1x.png", - "platform": "ios", - "idiom": "universal", - "scale": "1x", - "size": "20x20" - }, { "filename": "Icon-App-20x20@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "20x20" }, { "filename": "Icon-App-20x20@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "20x20" }, + { + "filename": "Icon-App-20x20@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "20x20" + }, + { + "filename": "Icon-App-20x20@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "20x20" + }, { "filename": "Icon-App-29x29@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "1x", "size": "29x29" }, { "filename": "Icon-App-29x29@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "29x29" }, { "filename": "Icon-App-29x29@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "29x29" }, { - "filename": "Icon-App-38x38@2x.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-29x29@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "29x29" + }, + { + "filename": "Icon-App-29x29@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "29x29" + }, + { + "filename": "Icon-App-40x40@2x.png", + "idiom": "iphone", "scale": "2x", - "size": "38x38" + "size": "40x40" }, { - "filename": "Icon-App-38x38@3x.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-40x40@3x.png", + "idiom": "iphone", "scale": "3x", - "size": "38x38" + "size": "40x40" }, { "filename": "Icon-App-40x40@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "1x", "size": "40x40" }, { "filename": "Icon-App-40x40@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "40x40" }, - { - "filename": "Icon-App-40x40@3x.png", - "platform": "ios", - "idiom": "universal", - "scale": "3x", - "size": "40x40" - }, { "filename": "Icon-App-60x60@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "60x60" }, { "filename": "Icon-App-60x60@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "60x60" }, - { - "filename": "Icon-App-64x64@2x.png", - "platform": "ios", - "idiom": "universal", - "scale": "2x", - "size": "64x64" - }, - { - "filename": "Icon-App-64x64@3x.png", - "platform": "ios", - "idiom": "universal", - "scale": "3x", - "size": "64x64" - }, - { - "filename": "Icon-App-68x68@2x.png", - "platform": "ios", - "idiom": "universal", - "scale": "2x", - "size": "68x68" - }, { "filename": "Icon-App-76x76@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "1x", "size": "76x76" }, { "filename": "Icon-App-76x76@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "76x76" }, { "filename": "Icon-App-83.5x83.5@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "83.5x83.5" }, { - "filename": "Icon-App-1024x1024.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-1024x1024@1x.png", + "idiom": "ios-marketing", + "scale": "1x", "size": "1024x1024" } ], diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-1024x1024.png b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-1024x1024.png rename to example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-38x38@2x.png b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-38x38@2x.png deleted file mode 100644 index b6b0450..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-38x38@2x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-38x38@3x.png b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-38x38@3x.png deleted file mode 100644 index 7d8fc49..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-38x38@3x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-64x64@2x.png b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-64x64@2x.png deleted file mode 100644 index 1bb4b02..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-64x64@2x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-64x64@3x.png b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-64x64@3x.png deleted file mode 100644 index 1b35fe7..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-64x64@3x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-68x68@2x.png b/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-68x68@2x.png deleted file mode 100644 index 41b013b..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/devAppIcon.appiconset/Icon-App-68x68@2x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Contents.json b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Contents.json index 397b582..b73c483 100644 --- a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Contents.json +++ b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Contents.json @@ -1,142 +1,117 @@ { "images": [ - { - "filename": "Icon-App-20x20@1x.png", - "platform": "ios", - "idiom": "universal", - "scale": "1x", - "size": "20x20" - }, { "filename": "Icon-App-20x20@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "20x20" }, { "filename": "Icon-App-20x20@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "20x20" }, + { + "filename": "Icon-App-20x20@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "20x20" + }, + { + "filename": "Icon-App-20x20@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "20x20" + }, { "filename": "Icon-App-29x29@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "1x", "size": "29x29" }, { "filename": "Icon-App-29x29@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "29x29" }, { "filename": "Icon-App-29x29@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "29x29" }, { - "filename": "Icon-App-38x38@2x.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-29x29@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "29x29" + }, + { + "filename": "Icon-App-29x29@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "29x29" + }, + { + "filename": "Icon-App-40x40@2x.png", + "idiom": "iphone", "scale": "2x", - "size": "38x38" + "size": "40x40" }, { - "filename": "Icon-App-38x38@3x.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-40x40@3x.png", + "idiom": "iphone", "scale": "3x", - "size": "38x38" + "size": "40x40" }, { "filename": "Icon-App-40x40@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "1x", "size": "40x40" }, { "filename": "Icon-App-40x40@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "40x40" }, - { - "filename": "Icon-App-40x40@3x.png", - "platform": "ios", - "idiom": "universal", - "scale": "3x", - "size": "40x40" - }, { "filename": "Icon-App-60x60@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "60x60" }, { "filename": "Icon-App-60x60@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "60x60" }, - { - "filename": "Icon-App-64x64@2x.png", - "platform": "ios", - "idiom": "universal", - "scale": "2x", - "size": "64x64" - }, - { - "filename": "Icon-App-64x64@3x.png", - "platform": "ios", - "idiom": "universal", - "scale": "3x", - "size": "64x64" - }, - { - "filename": "Icon-App-68x68@2x.png", - "platform": "ios", - "idiom": "universal", - "scale": "2x", - "size": "68x68" - }, { "filename": "Icon-App-76x76@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "1x", "size": "76x76" }, { "filename": "Icon-App-76x76@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "76x76" }, { "filename": "Icon-App-83.5x83.5@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "83.5x83.5" }, { - "filename": "Icon-App-1024x1024.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-1024x1024@1x.png", + "idiom": "ios-marketing", + "scale": "1x", "size": "1024x1024" } ], diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-1024x1024.png b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-1024x1024.png rename to example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-38x38@2x.png b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-38x38@2x.png deleted file mode 100644 index b6b0450..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-38x38@2x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-38x38@3x.png b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-38x38@3x.png deleted file mode 100644 index 7d8fc49..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-38x38@3x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-64x64@2x.png b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-64x64@2x.png deleted file mode 100644 index 1bb4b02..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-64x64@2x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-64x64@3x.png b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-64x64@3x.png deleted file mode 100644 index 1b35fe7..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-64x64@3x.png and /dev/null differ diff --git a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-68x68@2x.png b/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-68x68@2x.png deleted file mode 100644 index 41b013b..0000000 Binary files a/example/flavor_app/ios/Runner/Assets.xcassets/prodAppIcon.appiconset/Icon-App-68x68@2x.png and /dev/null differ diff --git a/example/simple_app/assets/ic_logo_rectangle_dark.png b/example/simple_app/assets/ic_logo_rectangle_dark.png new file mode 100644 index 0000000..43a789e Binary files /dev/null and b/example/simple_app/assets/ic_logo_rectangle_dark.png differ diff --git a/example/simple_app/assets/ic_logo_rectangle_tinted.png b/example/simple_app/assets/ic_logo_rectangle_tinted.png new file mode 100644 index 0000000..94cc2f9 Binary files /dev/null and b/example/simple_app/assets/ic_logo_rectangle_tinted.png differ diff --git a/example/simple_app/icons_launcher.yaml b/example/simple_app/icons_launcher.yaml index fb8e7d7..6145f80 100644 --- a/example/simple_app/icons_launcher.yaml +++ b/example/simple_app/icons_launcher.yaml @@ -14,6 +14,9 @@ icons_launcher: ios: enable: true image_path: "assets/ic_logo_rectangle.png" + # For iOS 18+ (support dark and tinted) + # dark_path: "assets/ic_logo_rectangle_dark.png" + # tinted_path: "assets/ic_logo_rectangle_tinted.png" web: enable: true image_path: "assets/ic_logo_radius.png" diff --git a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index 397b582..b73c483 100644 --- a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,142 +1,117 @@ { "images": [ - { - "filename": "Icon-App-20x20@1x.png", - "platform": "ios", - "idiom": "universal", - "scale": "1x", - "size": "20x20" - }, { "filename": "Icon-App-20x20@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "20x20" }, { "filename": "Icon-App-20x20@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "20x20" }, + { + "filename": "Icon-App-20x20@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "20x20" + }, + { + "filename": "Icon-App-20x20@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "20x20" + }, { "filename": "Icon-App-29x29@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "1x", "size": "29x29" }, { "filename": "Icon-App-29x29@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "29x29" }, { "filename": "Icon-App-29x29@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "29x29" }, { - "filename": "Icon-App-38x38@2x.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-29x29@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "29x29" + }, + { + "filename": "Icon-App-29x29@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "29x29" + }, + { + "filename": "Icon-App-40x40@2x.png", + "idiom": "iphone", "scale": "2x", - "size": "38x38" + "size": "40x40" }, { - "filename": "Icon-App-38x38@3x.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-40x40@3x.png", + "idiom": "iphone", "scale": "3x", - "size": "38x38" + "size": "40x40" }, { "filename": "Icon-App-40x40@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "1x", "size": "40x40" }, { "filename": "Icon-App-40x40@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "40x40" }, - { - "filename": "Icon-App-40x40@3x.png", - "platform": "ios", - "idiom": "universal", - "scale": "3x", - "size": "40x40" - }, { "filename": "Icon-App-60x60@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "2x", "size": "60x60" }, { "filename": "Icon-App-60x60@3x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "iphone", "scale": "3x", "size": "60x60" }, - { - "filename": "Icon-App-64x64@2x.png", - "platform": "ios", - "idiom": "universal", - "scale": "2x", - "size": "64x64" - }, - { - "filename": "Icon-App-64x64@3x.png", - "platform": "ios", - "idiom": "universal", - "scale": "3x", - "size": "64x64" - }, - { - "filename": "Icon-App-68x68@2x.png", - "platform": "ios", - "idiom": "universal", - "scale": "2x", - "size": "68x68" - }, { "filename": "Icon-App-76x76@1x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "1x", "size": "76x76" }, { "filename": "Icon-App-76x76@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "76x76" }, { "filename": "Icon-App-83.5x83.5@2x.png", - "platform": "ios", - "idiom": "universal", + "idiom": "ipad", "scale": "2x", "size": "83.5x83.5" }, { - "filename": "Icon-App-1024x1024.png", - "platform": "ios", - "idiom": "universal", + "filename": "Icon-App-1024x1024@1x.png", + "idiom": "ios-marketing", + "scale": "1x", "size": "1024x1024" } ], diff --git a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024.png b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024.png rename to example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-38x38@2x.png b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-38x38@2x.png deleted file mode 100644 index b6b0450..0000000 Binary files a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-38x38@2x.png and /dev/null differ diff --git a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-38x38@3x.png b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-38x38@3x.png deleted file mode 100644 index 7d8fc49..0000000 Binary files a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-38x38@3x.png and /dev/null differ diff --git a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-64x64@2x.png b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-64x64@2x.png deleted file mode 100644 index 1bb4b02..0000000 Binary files a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-64x64@2x.png and /dev/null differ diff --git a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-64x64@3x.png b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-64x64@3x.png deleted file mode 100644 index 1b35fe7..0000000 Binary files a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-64x64@3x.png and /dev/null differ diff --git a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-68x68@2x.png b/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-68x68@2x.png deleted file mode 100644 index 41b013b..0000000 Binary files a/example/simple_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-68x68@2x.png and /dev/null differ diff --git a/example/simple_app/ios/Runner/Base.lproj/Main.storyboard b/example/simple_app/ios/Runner/Base.lproj/Main.storyboard index f3c2851..c5eb0e1 100644 --- a/example/simple_app/ios/Runner/Base.lproj/Main.storyboard +++ b/example/simple_app/ios/Runner/Base.lproj/Main.storyboard @@ -1,8 +1,10 @@ - - + + + - + + @@ -14,13 +16,14 @@ - + - + + diff --git a/lib/cli_commands.dart b/lib/cli_commands.dart index a17554d..a8c5ac1 100644 --- a/lib/cli_commands.dart +++ b/lib/cli_commands.dart @@ -207,6 +207,8 @@ void _createIconsByConfig(Map config) { } var imagePathIos = imagePath; + String? imagePathIosDark; + String? imagePathIosTinted; if (isNeedingNewIosIcon(platforms)) { final newImagePath = _checkImageExists( config: platforms['ios'] as Map, @@ -219,6 +221,16 @@ void _createIconsByConfig(Map config) { CliLogger.error('Could not find image path for iOS'); exit(1); } + + imagePathIosDark = _checkImageExists( + config: platforms['ios'] as Map, + parameter: 'dark_path', + ); + + imagePathIosTinted = _checkImageExists( + config: platforms['ios'] as Map, + parameter: 'tinted_path', + ); } var imagePathMacos = imagePath; @@ -396,7 +408,11 @@ void _createIconsByConfig(Map config) { //! iOS if (isNeedingNewIosIcon(platforms) && imagePathIos != null) { - createIosIcons(imagePath: imagePathIos); + createIosIcons( + imagePath: imagePathIos, + darkPath: imagePathIosDark, + tintedPath: imagePathIosTinted, + ); } //! macOS diff --git a/lib/src/ios.dart b/lib/src/ios.dart index 9d51355..aa17ee4 100644 --- a/lib/src/ios.dart +++ b/lib/src/ios.dart @@ -7,12 +7,17 @@ part of '../cli_commands.dart'; /// where \ is the rounded [size] value. /// [scales] are the different size multiples for which we will generate images. /// [idiom] is the device family name to use within the Asset Catalog's +/// [platform] is the platform name to use within the +/// [appearances] are the different appearances /// description of each icon generated. default: universal -List _createIosTemplates( - {required double size, - String? sizeName, - required List scales, - String? idiom}) { +List _createIosTemplates({ + required double size, + String? sizeName, + required List scales, + String? idiom, + String? platform, + List? appearances, +}) { final templates = []; sizeName ??= '${size.round()}x${size.round()}'; for (var scale in scales) { @@ -23,6 +28,8 @@ List _createIosTemplates( scaledSize: scaledSize, scale: scale, idiom: idiom ?? 'universal', + platform: platform, + appearances: appearances, )); } @@ -30,7 +37,11 @@ List _createIosTemplates( } /// Start create ios icons -void createIosIcons({required String imagePath}) { +void createIosIcons({ + required String imagePath, + final String? darkPath, + final String? tintedPath, +}) { CliLogger.info('Creating iOS icons...'); final image = Icon.loadFile(imagePath); @@ -50,26 +61,174 @@ void createIosIcons({required String imagePath}) { level: CliLoggerLevel.two); } + Icon? darkImage; + if (darkPath != null) { + darkImage = Icon.loadFile(darkPath); + if (darkImage == null) { + CliLogger.error('The file $darkPath could not be read.', + level: CliLoggerLevel.two); + exit(1); + } + } + + Icon? tintedImage; + if (tintedPath != null) { + tintedImage = Icon.loadFile(tintedPath); + if (tintedImage == null) { + CliLogger.error('The file $tintedPath could not be read.', + level: CliLoggerLevel.two); + exit(1); + } + } + // https://developer.apple.com/design/human-interface-guidelines/app-icons final iosIcons = [ // Notifications on iPhone, iPad Pro, iPad, iPad mini (20, 29) - ..._createIosTemplates(size: 20, scales: [1, 2, 3]), + ..._createIosTemplates(size: 20, idiom: 'iphone', scales: [2, 3]), + ..._createIosTemplates(size: 20, idiom: 'ipad', scales: [1, 2]), // Settings on iPhone, iPad Pro, iPad, iPad mini (58, 87) - ..._createIosTemplates(size: 29, scales: [1, 2, 3]), - // Notifications on iPhone, iPad Pro, iPad, iPad mini (76, 114) - ..._createIosTemplates(size: 38, scales: [2, 3]), + ..._createIosTemplates(size: 29, idiom: 'iphone', scales: [1, 2, 3]), + ..._createIosTemplates(size: 29, idiom: 'ipad', scales: [1, 2]), // Spotlight on iPhone, iPad Pro, iPad, iPad mini (80, 120) - ..._createIosTemplates(size: 40, scales: [1, 2, 3]), + ..._createIosTemplates(size: 40, idiom: 'iphone', scales: [2, 3]), + ..._createIosTemplates(size: 40, idiom: 'ipad', scales: [1, 2]), // Home Screen on iPhone (120, 180) - ..._createIosTemplates(size: 60, scales: [2, 3]), - ..._createIosTemplates(size: 64, scales: [2, 3]), - ..._createIosTemplates(size: 68, scales: [2]), + ..._createIosTemplates(size: 60, idiom: 'iphone', scales: [2, 3]), // Home Screen on iPad, iPad mini (152) - ..._createIosTemplates(size: 76, scales: [1, 2]), + ..._createIosTemplates(size: 76, idiom: 'ipad', scales: [1, 2]), // Home Screen on iPad Pro (167) - ..._createIosTemplates(size: 83.5, sizeName: '83.5x83.5', scales: [2]), + ..._createIosTemplates( + size: 83.5, idiom: 'ipad', sizeName: '83.5x83.5', scales: [2]), // App Store - ..._createIosTemplates(size: 1024, scales: [0]), + ..._createIosTemplates(size: 1024, idiom: 'ios-marketing', scales: [1]), + ]; + + final iosDarkIcons = [ + // Notifications on iPhone, iPad Pro, iPad, iPad mini (20, 29) + ..._createIosTemplates( + size: 20, + idiom: 'iphone', + scales: [2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + ..._createIosTemplates( + size: 20, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + // Settings on iPhone, iPad Pro, iPad, iPad mini (58, 87) + ..._createIosTemplates( + size: 29, + idiom: 'iphone', + scales: [1, 2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + ..._createIosTemplates( + size: 29, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + // Spotlight on iPhone, iPad Pro, iPad, iPad mini (80, 120) + ..._createIosTemplates( + size: 40, + idiom: 'iphone', + scales: [2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + ..._createIosTemplates( + size: 40, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + // Home Screen on iPhone (120, 180) + ..._createIosTemplates( + size: 60, + idiom: 'iphone', + scales: [2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + // Home Screen on iPad, iPad mini (152) + ..._createIosTemplates( + size: 76, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + // Home Screen on iPad Pro (167) + ..._createIosTemplates( + size: 83.5, + idiom: 'ipad', + sizeName: '83.5x83.5', + scales: [2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'dark')], + ), + ]; + + final iosTintedIcons = [ + // Notifications on iPhone, iPad Pro, iPad, iPad mini (20, 29) + ..._createIosTemplates( + size: 20, + idiom: 'iphone', + scales: [2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + ..._createIosTemplates( + size: 20, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + // Settings on iPhone, iPad Pro, iPad, iPad mini (58, 87) + ..._createIosTemplates( + size: 29, + idiom: 'iphone', + scales: [1, 2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + ..._createIosTemplates( + size: 29, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + // Spotlight on iPhone, iPad Pro, iPad, iPad mini (80, 120) + ..._createIosTemplates( + size: 40, + idiom: 'iphone', + scales: [2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + ..._createIosTemplates( + size: 40, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + // Home Screen on iPhone (120, 180) + ..._createIosTemplates( + size: 60, + idiom: 'iphone', + scales: [2, 3], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + // Home Screen on iPad, iPad mini (152) + ..._createIosTemplates( + size: 76, + idiom: 'ipad', + scales: [1, 2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), + // Home Screen on iPad Pro (167) + ..._createIosTemplates( + size: 83.5, + idiom: 'ipad', + sizeName: '83.5x83.5', + scales: [2], + appearances: [IconAppearance(appearance: 'luminosity', value: 'tinted')], + ), ]; final filenames = {}; @@ -82,8 +241,40 @@ void createIosIcons({required String imagePath}) { } } CliLogger.success('Generated app icon images', level: CliLoggerLevel.two); + + // https://github.com/fluttercommunity/flutter_launcher_icons/pull/569/files + if (darkImage != null) { + final darkFilenames = {}; + for (final template in iosDarkIcons) { + // Multiple icon variants can use the same file, so check if we already + // created it. + if (darkFilenames.contains(template.filename) == false) { + darkFilenames.add(template.filename); + _saveImageIos(template, darkImage); + } + } + + CliLogger.success('Generated app dark icons', level: CliLoggerLevel.two); + } + + if (tintedImage != null) { + final tintedFilenames = {}; + for (final template in iosTintedIcons) { + // Multiple icon variants can use the same file, so check if we already + // created it. + if (tintedFilenames.contains(template.filename) == false) { + tintedFilenames.add(template.filename); + _saveImageIos(template, tintedImage); + } + } + + CliLogger.success('Generated app tinted icons', level: CliLoggerLevel.two); + } + AppleAppIconType( images: iosIcons, + darkImages: darkImage != null ? iosDarkIcons : null, + tintedImages: tintedImage != null ? iosTintedIcons : null, assetPath: _flavorHelper.iOSAssetsAppIconFolder, ).saveContentsJson(); } diff --git a/lib/utils/template.dart b/lib/utils/template.dart index f24a853..11cacdb 100644 --- a/lib/utils/template.dart +++ b/lib/utils/template.dart @@ -27,6 +27,8 @@ abstract class AppleIconTemplate { required this.scaledSize, required this.scale, required this.idiom, + this.platform, + this.appearances, }); /// Icon size @@ -45,33 +47,87 @@ abstract class AppleIconTemplate { /// Icon file name String get filename; + /// Icon platform + final String? platform; + + /// Icon appearances + final List? appearances; + /// Used to encode the attributes for this asset file in a corresponding /// Asset's Contents.json file. Map toJson(); } +class IconAppearance { + IconAppearance({ + required this.appearance, + required this.value, + }); + + final String appearance; + final String value; + + Map toJson() { + return { + 'appearance': appearance, + 'value': value, + }; + } + + IconAppearance fromJson(Map json) { + return IconAppearance( + appearance: json['appearance'] as String, + value: json['value'] as String, + ); + } +} + /// iOS template class IosIconTemplate extends AppleIconTemplate { /// Constructor - IosIconTemplate( - {required super.sizeName, - required super.scaledSize, - required super.scale, - required super.idiom}); + IosIconTemplate({ + required super.sizeName, + required super.scaledSize, + required super.scale, + required super.idiom, + super.platform, + super.appearances, + }); @override - String get filename => scale == 0 - ? '$IOS_DEFAULT_ICON_NAME-$sizeName.png' - : '$IOS_DEFAULT_ICON_NAME-$sizeName@${scale}x.png'; + String get filename { + var isDarkAppearance = appearances != null && + appearances! + .any((e) => e.appearance == 'luminosity' && e.value == 'dark'); + + var isTintedAppearance = appearances != null && + appearances! + .any((e) => e.appearance == 'luminosity' && e.value == 'tinted'); + + var defaultName = IOS_DEFAULT_ICON_NAME; + if (isDarkAppearance) { + defaultName = '$defaultName-Dark'; + } else if (isTintedAppearance) { + defaultName = '$defaultName-Tinted'; + } + + if (scale == 0) { + return '$defaultName-$sizeName.png'; + } else { + return '$defaultName-$sizeName@${scale}x.png'; + } + } @override Map toJson() { - var json = { + var json = { 'filename': filename, - 'platform': 'ios', 'idiom': idiom, 'scale': '${scale}x', - 'size': sizeName + 'size': sizeName, + if (platform != null) 'platform': platform, + if (appearances != null) + 'appearances': appearances!.map((e) => e.toJson()).toList(), }; if (scale == 0) { @@ -146,22 +202,42 @@ class LinuxIconTemplate { class AppleAppIconType { /// Provide a list of [images] to be created in your Asset set, whose /// Contents.json file can be written out to [assetPath]. - const AppleAppIconType({required this.images, required this.assetPath}); + const AppleAppIconType({ + required this.images, + required this.assetPath, + this.darkImages, + this.tintedImages, + }); /// The meta data for each asset file to create. final List images; + final List? darkImages; + final List? tintedImages; /// Where to write out the Contents.json file. final String assetPath; /// For use with a [JsonEncoder] to generate this Asset's Contents.json file. - Map toJson() => { - 'images': images.map((image) => image.toJson()).toList(), - 'info': { - 'author': 'icons_launcher', - 'version': 1, - } - }; + Map toJson() { + final imagesMap = >[]; + imagesMap.addAll(images.map((e) => e.toJson())); + + if (darkImages != null) { + imagesMap.addAll(darkImages!.map((e) => e.toJson())); + } + + if (tintedImages != null) { + imagesMap.addAll(tintedImages!.map((e) => e.toJson())); + } + + return { + 'images': imagesMap, + 'info': { + 'author': 'icons_launcher', + 'version': 1, + } + }; + } /// Writes out the Contents.json file. void saveContentsJson() {