Your app's launcher icon is the first visual impression users have of your Flutter application. A well-designed, properly configured icon contributes significantly to app discoverability and brand recognition. This guide walks you through creating adaptive launcher icons for both iOS and Android using Flutter's standard tooling, ensuring your app looks professional across all devices and platform versions.
Understanding Flutter Launcher Icons
What Are Adaptive Icons?
Adaptive icons are a modern icon format introduced in Android 8.0 (API level 26) and supported on iOS since iOS 11. Unlike traditional static icons, adaptive icons consist of separate foreground and background layers that the operating system combines dynamically. This approach allows icons to adapt to different device themes, launcher shapes, and display contexts while maintaining visual consistency.
The key advantage of adaptive icons lies in their flexibility. Users can choose different icon shapes on their devices--circles, squares, squircles, or device-specific silhouettes--and your icon will automatically adapt without requiring multiple asset versions. This eliminates the need to design icons for every possible shape combination and ensures your branding remains intact regardless of user preferences.
Why flutter_launcher_icons?
The flutter_launcher_icons package has become the de facto standard for managing Flutter app icons. Created and maintained by the Flutter community, this command-line tool automates the complex process of generating correctly sized icon assets for both platforms. Without this tool, developers would need to manually create dozens of icon variants at different resolutions, each with specific naming conventions and directory placements.
The package handles several critical tasks: generating Android adaptive icons with foreground and background layers, creating iOS icon sets at all required sizes, supporting image-based and text-based icons, and integrating seamlessly with the Flutter build process. Its declarative YAML configuration approach means icon setup becomes part of your project's version-controlled configuration, making it easy to update or change icons as your app evolves.
Installing and Setting Up flutter_launcher_icons
Package Installation
To begin using flutter_launcher_icons, you first need to add it as a dev dependency in your pubspec.yaml file. Dev dependencies are packages that are only needed during development and are not included in the final application build, which is appropriate for icon generation tools. The installation process follows standard Flutter package addition procedures, ensuring the tool is available in your development environment.
dev_dependencies:
flutter_launcher_icons: ^0.14.1
After adding the dependency, you must run flutter pub get to download and configure the package. This makes the flutter_launcher_icons command available in your terminal, allowing you to generate icons at any time.
Creating the Configuration File
The flutter_launcher_icons package uses a declarative YAML configuration file to define how icons should be generated. This file, typically named flutter_launcher_icons.yaml, lives in your project's root directory alongside pubspec.yaml and contains all the specifications for your app's icon assets.
Configuring Your Icons
Basic Configuration Structure
The most straightforward flutter_launcher_icons configuration specifies a single image file as the source for your launcher icon. The basic configuration includes the image path, Android adaptive icon settings, and iOS icon specification.
flutter_launcher_icons:
android: true
ios: true
image_path: "assets/images/icon.png"
min_sdk_android: 21
Advanced Configuration for Adaptive Icons
Creating adaptive icons requires a more sophisticated configuration that separates your icon into foreground and background layers:
flutter_launcher_icons:
android: "adaptive"
ios: true
image_path: "assets/images/icon.png"
adaptive_icon_background: "#FFFFFF"
adaptive_icon_foreground: "assets/images/icon_foreground.png"
The adaptive icon configuration requires several additional parameters. You must specify the foreground image path, the background color or image path, and optionally configure the icon's safe zone to ensure critical content isn't obscured by device-specific masking.
iOS-Specific Configuration
iOS icons have their own set of requirements. The App Store, iPhone, iPad, and Apple Watch all require icon assets at specific sizes and formats. Flutter's flutter_launcher_icons handles these requirements automatically:
flutter_launcher_icons:
android: "adaptive"
ios: true
image_path_ios: "assets/images/icon_ios.png"
image_path: "assets/images/icon_android.png"
Preparing Your Icon Assets
Image Requirements and Best Practices
Successful icon generation starts with properly prepared source images. For adaptive icons, your foreground image should be a square PNG with transparency where needed, containing only the visual elements you want to appear on top of the background. The image should be high resolution--at least 1024x1024 pixels--to ensure quality across all device densities.
Key requirements:
- Foreground image: 1024x1024 pixels minimum, PNG format with transparency
- Background image: 108x108 pixels for adaptive icons
- Solid colors can be specified directly in YAML without image files
- All important elements should be within the safe zone (66% of icon diameter)
Design Considerations for Adaptive Icons
When designing for adaptive icons, you must account for the fact that different devices apply different masks to your icon. The safe zone--typically a circle of about 66% of the icon's diameter--ensures your foreground content remains visible regardless of the device's icon shape.
Multi-tone and gradient backgrounds can enhance your icon's visual appeal while maintaining brand consistency. Modern Android versions support themed icons that can use your app's primary color as a monochrome silhouette, which requires a white or single-color foreground design.
If you're exploring other Flutter UI components to complement your app icons, consider learning about FloatingActionButton implementation or creating interactive dialogs to build a cohesive user experience.
Generating and Applying Icons
Running the Icon Generator
Once your configuration file is prepared, generating your icons requires a single command:
flutter pub run flutter_launcher_icons
The flutter_launcher_icons package reads your YAML configuration, processes your source images, and outputs all required icon assets to the appropriate platform directories.
Verifying Platform Integration
After generating icons, verify your setup:
Android verification:
- Check
res/mipmap-anydpi-v26for adaptive icon XML files - Verify fallback icons in
mipmap-hdpi,mipmap-mdpidirectories - Run
flutter cleanand rebuild your Android app
iOS verification:
- Check
Assets.xcassets/AppIcon.appiconset - Verify all required sizes are present
- Clean and rebuild iOS app
Testing on actual devices is crucial because emulators may not accurately represent how icons appear in real-world conditions. For more Flutter development resources, explore our guides on creating list views or launching URLs from your app.
Troubleshooting Common Issues
Configuration and Path Problems
Configuration issues frequently cause icon generation failures:
| Issue | Solution |
|---|---|
| YAML parsing errors | Verify indentation and file format |
| Path not found | Ensure paths are relative to project root |
| Invalid image format | Save as standard PNG without extra metadata |
| Package version mismatch | Update to latest flutter_launcher_icons |
Visual and Display Problems
Icons appearing incorrectly often stem from design issues:
- Cropped elements: Reduce foreground size or adjust safe zone
- Themed icons not working: Use monochrome foreground design
- Caching issues: Uninstall/reinstall app, clear build cache
Platform-Specific Issues
Android: Ensure minSdk is 21 or higher for adaptive icons. Fallback icons must exist for older devices.
iOS: Verify Info.plist doesn't override icon settings. App Store icon requires separate 1024x1024 asset.
If you're encountering issues with Android activities, our guide on understanding the Android activity lifecycle provides additional context for platform-specific development.
Best Practices and Recommendations
Version Control and Reproducibility
- Include
flutter_launcher_icons.yamlin version control - Maintain source images in a dedicated directory (e.g.,
assets/images/) - Document icon requirements in your README
- Consider creating primary, secondary, and seasonal icon variants
Performance and Maintenance
- Source images of 1024x1024 pixels are sufficient
- Icon generation is a one-time operation during builds
- Keep flutter_launcher_icons package updated
- Establish a testing process for icon updates across devices
Quick Reference Commands
# Install/update icons
flutter pub run flutter_launcher_icons
# Clean build cache
flutter clean
# Rebuild Android
flutter build apk --debug
# Rebuild iOS
flutter build ios --debug
Frequently Asked Questions
Conclusion
Creating adaptive launcher icons for Flutter apps is straightforward with the flutter_launcher_icons package. By following the configuration patterns and best practices outlined in this guide, you can establish a reliable icon generation workflow that works across all your Flutter projects.
Remember that your launcher icon represents your app to potentially millions of users. Invest appropriate time in design and testing to ensure your icon communicates your brand effectively across the diverse Android and iOS ecosystems. With the tools and techniques covered here, you have everything needed to create professional-quality adaptive icons for your Flutter applications.
For teams building cross-platform applications, our guide on building cross-platform mobile applications using Lynx offers additional insights into mobile development approaches.
Sources
-
LogRocket: Create adaptive icons in Flutter with flutter_launcher_icons - Comprehensive tutorial covering the flutter_launcher_icons package, YAML configuration, and execution steps for generating icons.
-
Code Hub Journal: How to Set Flutter App Icons (iOS & Android) - Step-by-step guide covering adaptive icons configuration, platform-specific requirements, and troubleshooting.
-
Droidcon: Ultimate Guide For Creating Multi-tone Themed App Icons & Adaptive App Icons for Android - Advanced guide on multi-tone themed icons, design principles, and Material Design considerations.