Docs/PlaceholderSetup.md
This guide explains how to set up splash screens, logos, icons, and placeholders in the Bagisto Flutter app.
The app's assets are stored in the assets/ folder:
assets/
├── images/
│ ├── splash.png # Splash screen image
│ ├── bagisto_logo.svg # Bagisto logo (SVG)
│ ├── apple_icon.svg # Apple sign-in icon
│ ├── facebook_icon.svg # Facebook sign-in icon
│ └── google_icon.svg # Google sign-in icon
└── ml/
└── (ML model files)
File: assets/images/splash.png
The splash screen is configured in:
File: lib/features/splash/presentation/splash_screen.dart
SplashScreen(
backgroundColor: Colors.white,
child: Image.asset(
'assets/images/splash.png',
width: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
),
)
assets/images/splash.png with your custom imageFile: android/app/src/main/res/drawable/launch_background.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
</layer-list>
File: ios/Runner/Base.lproj/LaunchScreen.storyboard
Modify the storyboard to customize the iOS launch screen.
Location: android/app/src/main/res/
The Android adaptive icons are stored in various mipmap directories:
mipmap-mdpi/mipmap-hdpi/mipmap-xhdpi/mipmap-xxhdpi/mipmap-xxxhdpi/To change the app icon:
app → New → Image AssetFile: ios/Runner/Assets.xcassets/AppIcon.appiconset/
To change the app icon:
The app includes SVG logos for branding and social login:
| Icon | File Path |
|---|---|
| Bagisto Logo | assets/images/bagisto_logo.svg |
| Apple Icon | assets/images/apple_icon.svg |
| Facebook Icon | assets/images/facebook_icon.svg |
| Google Icon | assets/images/google_icon.svg |
assets/images/pubspec.yaml to include the new assets:flutter:
assets:
- assets/images/
- assets/ml/
Image.asset('assets/images/your-logo.png')
// or for SVG
SvgPicture.asset('assets/images/your-logo.svg')
This app uses code-based placeholders rather than placeholder images. When images are loading, the app displays colored containers as placeholders.
Placeholders use theme-aware colors defined in lib/core/theme/app_theme.dart:
// Light mode placeholder
AppColors.neutral100 // Light gray background
// Dark mode placeholder
AppColors.neutral800 // Dark gray background
The app uses the cached_network_image package which provides a placeholder callback:
CachedNetworkImage(
imageUrl: 'https://example.com/image.jpg',
placeholder: (context, url) => Container(
color: isDark ? AppColors.neutral800 : AppColors.neutral100,
),
errorWidget: (context, url, error) => Icon(Icons.error),
)
The following widgets implement placeholder support:
product_card_large.dart, product_card_small.dart)category_banner.dart)category_chip_row.dart, sub_category_section.dart)product_image_carousel.dart, product_related_section.dart)cart_page.dart)static_content_widget.dart, category_carousel.dart)If you want to use custom placeholder images instead of code-based placeholders:
Add placeholder images to assets/images/:
assets/images/placeholder.png
Use them in your widgets:
CachedNetworkImage(
imageUrl: 'https://example.com/image.jpg',
placeholder: (context, url) => Image.asset(
'assets/images/placeholder.png',
fit: BoxFit.cover,
),
)
| Asset Type | Location |
|---|---|
| Splash Screen | assets/images/splash.png |
| App Logo | assets/images/bagisto_logo.svg |
| Social Icons | assets/images/{apple,facebook,google}_icon.svg |
| Android Icons | android/app/src/main/res/mipmap-*/ |
| iOS Icons | ios/Runner/Assets.xcassets/AppIcon.appiconset/ |
| Placeholders | Code-based (Container widgets) |