Icons & Assets
Icons & Assets
Section titled “Icons & Assets”This guide covers replacing all visual assets including app icons, colors, graphics, and other design elements to match your brand.
App Icon Requirements
Section titled “App Icon Requirements”Design Guidelines
Section titled “Design Guidelines”Android:
- Adaptive Icons: 108x108dp with 72x72dp safe area
- Legacy Icons: 48x48dp to 192x192dp
- Format: PNG (24-bit RGB + alpha)
- Style: Follow Material Design guidelines
iOS:
- Sizes: 1024x1024px master, multiple sizes generated
- Format: PNG without transparency
- Style: Follow iOS Human Interface Guidelines
- Corner Radius: System handles automatically
Icon Design Best Practices
Section titled “Icon Design Best Practices”- Simple and Recognizable: Clear at small sizes
- Avoid Text: Icons should work without words
- Platform Consistency: Follow each platform’s style
- Scalability: Should work from 16px to 1024px
- Brand Alignment: Reflect your app’s purpose
Step 1: Create Your App Icon
Section titled “Step 1: Create Your App Icon”Design Tools
Section titled “Design Tools”- Professional: Adobe Illustrator, Figma, Sketch
- Online: Canva, Figma (free tier)
- AI Tools: Midjourney, DALL-E with editing
Required Sizes
Section titled “Required Sizes”Create your master icon at 1024x1024px, then generate these sizes:
Android Sizes:
- mdpi: 48x48px
- hdpi: 72x72px
- xhdpi: 96x96px
- xxhdpi: 144x144px
- xxxhdpi: 192x192px
iOS Sizes:
- 20x20px (iPhone notification)
- 29x29px (Settings)
- 40x40px (Spotlight)
- 58x58px (Settings @2x)
- 60x60px (iPhone app)
- 76x76px (iPad app)
- 80x80px (Spotlight @2x)
- 87x87px (Settings @3x)
- 120x120px (iPhone app @2x)
- 152x152px (iPad app @2x)
- 167x167px (iPad Pro @2x)
- 180x180px (iPhone app @3x)
- 1024x1024px (App Store)
Step 2: Generate Icon Assets
Section titled “Step 2: Generate Icon Assets”Using Online Tools
Section titled “Using Online Tools”Recommended Tools:
- App Icon Generator - Free, all sizes
- Icon Kitchen - Android adaptive icons
- iOS App Icon Generator - iOS specific
Using Command Line (ImageMagick)
Section titled “Using Command Line (ImageMagick)”# Install ImageMagickbrew install imagemagick # macOSsudo apt install imagemagick # Linux
# Generate Android iconsconvert icon-master.png -resize 48x48 android/app/src/main/res/mipmap-mdpi/ic_launcher.pngconvert icon-master.png -resize 72x72 android/app/src/main/res/mipmap-hdpi/ic_launcher.pngconvert icon-master.png -resize 96x96 android/app/src/main/res/mipmap-xhdpi/ic_launcher.pngconvert icon-master.png -resize 144x144 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngconvert icon-master.png -resize 192x192 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.pngUsing Flutter Icons Launcher Plugin
Section titled “Using Flutter Icons Launcher Plugin”This project uses a separate configuration file for launcher icons:
Create or update icons_launcher.yaml:
icons_launcher: image_path: "assets/icon/app_icon.png" platforms: android: enable: true adaptive_icon_background: "#FFFFFF" adaptive_icon_foreground: "assets/icon/app_icon_foreground.png" ios: enable: trueRun the generator:
dart run icons_launcher:createStep 3: Replace App Icons
Section titled “Step 3: Replace App Icons”Android Icons
Section titled “Android Icons”Place icons in these directories:
android/app/src/main/res/├── mipmap-mdpi/│ └── ic_launcher.png (48x48)├── mipmap-hdpi/│ └── ic_launcher.png (72x72)├── mipmap-xhdpi/│ └── ic_launcher.png (96x96)├── mipmap-xxhdpi/│ └── ic_launcher.png (144x144)└── mipmap-xxxhdpi/ └── ic_launcher.png (192x192)iOS Icons
Section titled “iOS Icons”Replace icons in Xcode:
- Open
ios/Runner.xcodeproj - Navigate to
Runner > Assets.xcassets > AppIcon.appiconset - Drag and drop your icons to appropriate slots
- Ensure all required sizes are filled
Step 4: Update Color Scheme
Section titled “Step 4: Update Color Scheme”Understanding the Current Theme System
Section titled “Understanding the Current Theme System”This project uses Flex Color Scheme for theming. The current theme is defined in lib/core/theme/app_theme.dart and uses FlexScheme.shadGreen as the base color scheme.
Customizing Colors with Flex Color Scheme
Section titled “Customizing Colors with Flex Color Scheme”To change the color scheme, you can:
- Use a different FlexScheme preset:
static const _scheme = FlexScheme.materialBaseline; // Change this lineAvailable schemes include: material, materialHc, blue, indigo, hippieBlue, aquaBlue, brandBlue, deepBlue, sakura, mandyRed, red, redWine, purpleBrown, green, money, jungle, greyLaw, wasabi, gold, mango, amber, vesuviusBurn, deepPurple, ebonyClay, barossa, shark, bigStone, damask, bahamaBlue, mallardGreen, espresso, outerSpace, blueWhale, sanJuanBlue, rosewood, blumineBlue, and shadGreen (current).
- Define custom colors by modifying the existing structure:
static ThemeData get lightTheme => FlexThemeData.light( scheme: _scheme, // Add custom key colors if needed keyColors: const FlexKeyColors( useSecondary: true, useTertiary: true, ), // ... rest of configuration);Customizing OTP-Specific Colors
Section titled “Customizing OTP-Specific Colors”The app includes custom colors for OTP-specific UI elements. These can be modified in the existing theme file:
// lib/core/theme/app_theme.dart - Update these static color constantsstatic const Color otpCardBackground = Color(0xFFF8F9FA); // Light card backgroundstatic const Color otpCardBackgroundDark = Color(0xFF1E1E1E); // Dark card backgroundstatic const Color otpCodeText = Color(0xFF2E7D32); // OTP code text (light)static const Color otpCodeTextDark = Color(0xFF66BB6A); // OTP code text (dark)static const Color progressBackground = Color(0xFFE0E0E0); // Progress bar backgroundstatic const Color progressBackgroundDark = Color(0xFF424242); // Progress bar background (dark)static const Color progressForeground = Color(0xFF4CAF50); // Progress bar foregroundstatic const Color warningColor = Color(0xFFFF9800); // Warning statestatic const Color criticalColor = Color(0xFFF44336); // Critical stateTheme Usage Best Practices
Section titled “Theme Usage Best Practices”Use the theme’s color system consistently:
// Good - uses theme colorsContainer( color: Theme.of(context).colorScheme.primary,)
// Good - uses custom OTP colors with contextContainer( color: AppTheme.getOtpCardBackground(context),)
// Avoid - hardcoded colorsContainer( color: Colors.blue,)Step 5: Replace Visual Assets
Section titled “Step 5: Replace Visual Assets”Asset Directory Structure
Section titled “Asset Directory Structure”assets/├── icons/│ ├── ui/ # UI icons│ │ ├── add.svg│ │ ├── delete.svg│ │ └── settings.svg│ └── issuers/ # Service provider logos│ ├── google.png│ ├── microsoft.png│ └── github.png├── images/│ ├── logo.png # Your company logo│ ├── onboarding/ # Onboarding illustrations│ └── empty_states/ # Empty state graphics└── lottie/ ├── loading.json # Loading animations └── success.json # Success animationsUpdate pubspec.yaml
Section titled “Update pubspec.yaml”flutter: uses-material-design: true assets: - assets/icons/ - assets/icons/issuers/ - assets/images/ - assets/lottie/Replace Issuer Icons
Section titled “Replace Issuer Icons”Update service provider icons in assets/icons/issuers/:
- Use official brand assets when possible
- Maintain consistent sizing (e.g., 64x64px)
- Follow brand guidelines for each service
- Provide fallback for unknown services
class IssuerIcons { static const Map<String, String> icons = { 'google': 'assets/icons/issuers/google.png', 'microsoft': 'assets/icons/issuers/microsoft.png', 'github': 'assets/icons/issuers/github.png', 'discord': 'assets/icons/issuers/discord.png', // Add more as needed };
static String getIcon(String issuer) { final key = issuer.toLowerCase(); return icons[key] ?? 'assets/icons/issuers/default.png'; }}Step 6: Update Splash Screen
Section titled “Step 6: Update Splash Screen”Create Splash Screen Assets
Section titled “Create Splash Screen Assets”Design splash screen with:
- Your app icon/logo
- Brand colors
- Loading indicator (optional)
Configure Native Splash
Section titled “Configure Native Splash”This project uses a separate configuration file for the splash screen.
Create or update flutter_native_splash.yaml:
flutter_native_splash: color: "#FFFFFF" # Background color image: assets/images/splash_logo.png android_12: image: assets/images/splash_logo.png color: "#FFFFFF" ios: image: assets/images/splash_logo.png color: "#FFFFFF"Generate splash screens:
dart run flutter_native_splash:createStep 7: Font Customization (Optional)
Section titled “Step 7: Font Customization (Optional)”Add Custom Fonts
Section titled “Add Custom Fonts”- Add font files to
assets/fonts/ - Update
pubspec.yaml:
flutter: fonts: - family: YourCustomFont fonts: - asset: assets/fonts/YourFont-Regular.ttf - asset: assets/fonts/YourFont-Bold.ttf weight: 700- Update theme to use custom font:
// In app_theme.dartstatic ThemeData lightTheme = ThemeData( fontFamily: 'YourCustomFont', // ... rest of theme);Step 8: Verification
Section titled “Step 8: Verification”Build and Test
Section titled “Build and Test”# Clean and rebuildflutter cleanflutter pub get
# Build for testingflutter build apk --debugflutter build ios --debug # macOS onlyVisual Verification Checklist
Section titled “Visual Verification Checklist”- App icon displays correctly in launcher
- Splash screen shows your branding
- Color scheme is consistently applied
- All custom assets load properly
- Dark theme works correctly
- Icons are crisp at all sizes
Test on Multiple Devices
Section titled “Test on Multiple Devices”- Different screen densities (Android)
- Various iPhone models (iOS)
- Tablets/larger screens
- Different OS versions
Common Issues & Solutions
Section titled “Common Issues & Solutions”Icon Issues
Section titled “Icon Issues”Problem: Icons appear blurry
# Solution: Ensure proper density folders# Check that you have all required sizesProblem: iOS icon not updating
# Solution: Clean iOS buildcd iosrm -rf build/cd ..flutter cleanflutter build iosColor Issues
Section titled “Color Issues”Problem: Colors not applying consistently
// Solution: Use theme colors instead of hardcoded// BadContainer(color: Colors.blue)
// GoodContainer(color: Theme.of(context).primaryColor)Asset Loading Issues
Section titled “Asset Loading Issues”Problem: Assets not found
# Solution: Verify pubspec.yaml asset pathsflutter: assets: - assets/icons/ # Include trailing slash for directoriesDesign Resources
Section titled “Design Resources”Free Icon Sources
Section titled “Free Icon Sources”Color Palette Tools
Section titled “Color Palette Tools”Brand Asset Guidelines
Section titled “Brand Asset Guidelines”- Follow each platform’s branding guidelines
- Respect trademark and copyright
- Use official brand assets when available
- Maintain brand consistency
Next Steps
Section titled “Next Steps”With your visual identity complete:
- App Store Configuration - Prepare store listings
- Firebase Setup - Configure backend services
- Testing Guide - Ensure everything works
Your app now looks uniquely yours! 🎨