Migrating from iconify_flutter
This guide helps you migrate your project from the legacy (and now archived) iconify_flutter package to the modern iconify_sdk.
Key Differences
Section titled “Key Differences”| Feature | iconify_flutter | iconify_sdk |
|---|---|---|
| Rendering | Direct SVG | Hybrid (SVG + Raster fallback for Impeller) |
| Offline | Manual download of large classes | Automatic bundling of only used icons |
| Performance | Basic | Optimized with LRU caching & pure Dart core |
| CLI | None | Full suite for syncing and auditing |
Migration Steps
Section titled “Migration Steps”1. Update Dependencies
Section titled “1. Update Dependencies”Remove the old package and add the new one:
dependencies: # iconify_flutter: ^0.1.0 <-- Remove iconify_sdk: ^0.2.02. Add the App Wrapper
Section titled “2. Add the App Wrapper”Wrap your root widget in IconifyApp. This replaces the need for any manual initialization.
void main() { runApp(const IconifyApp(child: MyApp()));}3. Update Widget Names
Section titled “3. Update Widget Names”Rename Iconify(...) widgets to IconifyIcon(...). The parameters are mostly compatible.
// OLDIconify(Mdi.home, color: Colors.blue)
// NEW (Dynamic string)IconifyIcon('mdi:home', color: Colors.blue)
// NEW (Type-safe bundled)IconifyIcon.name(IconsMdi.home, color: Colors.blue)4. Adopt the CLI Workflow
Section titled “4. Adopt the CLI Workflow”Instead of manually maintaining massive icon data classes, use the new bundling workflow:
- Run
dart run iconify_sdk_cli:iconify init - Run
dart run iconify_sdk_cli:iconify sync - Add
iconify_sdk_buildertodev_dependencies - Run
dart run build_runner build
This will generate a tiny, optimized lib/icons.g.dart file containing only the icons your app actually uses.