adaptive_app_icon 0.1.0 copy "adaptive_app_icon: ^0.1.0" to clipboard
adaptive_app_icon: ^0.1.0 copied to clipboard

Switch your app's home-screen icon at runtime between pre-bundled variants, with a config-driven codegen system and a drop-in icon gallery widget.

0.1.0 #

Declare one source image per icon; the codegen produces every platform asset and bundles it. No hand-cut densities, and no Xcode Copy Bundle Resources step.

Breaking

  • The ios_asset: key is gone — iOS app-icon sets are now named after the icon itself, so the name is derived. Codegen errors with a migration hint if the key is still present. android_asset: is now optional too, defaulting to ic_launcher for the primary icon and ic_launcher_<name> for alternates.
  • Icon name must be lower_snake_case: it becomes an iOS app-icon set name and an Android component name.
  • iOS alternate icons move from loose PNGs in ios/Runner/ to app-icon sets in Assets.xcassets. Delete the old AppIcon-*@2x.png / @3x.png files in Xcode (codegen warns while any remain); the CFBundleIcons block that referenced them is stripped from ios/Runner/Info.plist automatically. See the migration steps in the README.

Added

  • image: renders the Android density PNGs (mdpi→xxxhdpi, alpha preserved) and the iOS app-icon sets (flattened, since iOS renders an alpha channel as a black square) from a single square master.
  • Config can live in pubspec.yaml under adaptive_app_icon:; a standalone adaptive_app_icon.yaml still works as a fallback.
  • Xcode asset-catalog build settings are set on every build configuration, so alternates are bundled without editing Copy Bundle Resources — the silent blank-icon failure that layout allowed is gone.
  • background: (per icon or top level) sets what iOS icons are flattened onto.
  • preview: defaults to image:, so the gallery needs no extra file.
  • --no-images wires up existing assets without re-rendering.
  • Codegen warns when a preview isn't declared under flutter: assets:, which otherwise shows a placeholder at runtime with no error.

Fixed

  • The manifest emitted android:icon="@mipmap/…" even when validation had accepted a drawable-*/ resource, producing a reference that failed to resolve. The container is now detected and the matching prefix emitted.

0.0.1 #

Initial release.

  • Runtime app-icon switching on iOS (setAlternateIconName) and Android (activity-alias toggling). On Android every icon is its own alias and the main activity is never toggled, so switching never disables the running component. androidApplyMode chooses when the change lands: whenBackgrounded (default, no visible close) or immediately (app closes; the user reopens). IconGallery.confirmChange lets you gate a switch behind a dialog.
  • Config-driven codegen (dart run adaptive_app_icon:generate_icon_config) that reads adaptive_app_icon.yaml and updates Info.plist, AndroidManifest.xml, and a typed app_icons.g.dart, with asset validation and an icon-count warning.
  • Type-safe native bridge generated with Pigeon.
  • DynamicAppIcon API with shared_preferences-backed selection caching.
  • Drop-in IconGallery widget with optimistic selection and rollback.
2
likes
150
points
89
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Switch your app's home-screen icon at runtime between pre-bundled variants, with a config-driven codegen system and a drop-in icon gallery widget.

Repository (GitHub)
View/report issues

Topics

#icons #app-icon #launcher #ios #android

License

MIT (license)

Dependencies

flutter, image, path, shared_preferences, xml, yaml

More

Packages that depend on adaptive_app_icon

Packages that implement adaptive_app_icon