Docs/ColorSetUp.md
This document explains how to customize colors in the Bagisto Flutter app.
The app uses a centralized color system defined in lib/core/theme/app_theme.dart. All colors are defined in the AppColors class and are used throughout the application.
Navigate to:
lib/core/theme/app_theme.dart
In the AppColors class, find and modify the primary colors:
class AppColors {
// Primary Colors - Modify these hex values to change the app's primary color
static const Color primary500 = Color(0xFFFF6900); // Main primary color
static const Color primary600 = Color(0xFFF54900); // Darker variant for pressed states
// ...
}
To change the primary color:
0xFFFF6900 with your desired color hex valueprimary600 to a slightly darker shade of your primary colorThe app defines several color categories:
| Category | Description |
|---|---|
| Primary | Main brand colors (primary500, primary600) |
| Neutral | Grayscale palette (neutral50-neutral900) for backgrounds, text, borders |
| Status | Success colors (green shades for success states) |
| Process | Info/blue colors (process600, process700) |
| Static | Basic colors (white, black) |
The colors are consumed in multiple ways:
Directly via AppColors class:
Container(
color: AppColors.primary500,
child: Text(
'Hello',
style: TextStyle(color: AppColors.neutral900),
),
)
Via ThemeData (Material 3):
ThemeData(
colorScheme: const ColorScheme.light(
primary: AppColors.primary500,
secondary: AppColors.primary600,
),
)
Via TextStyles:
TextStyle(
color: AppColors.primary500,
)
The app supports both light and dark themes. Colors automatically adjust based on the theme:
To toggle between light and dark themes programmatically:
context.read<ThemeCubit>().toggleTheme();
Or set a specific theme:
context.read<ThemeCubit>().setLight();
context.read<ThemeCubit>().setDark();
Flutter uses the format 0xFF followed by 6 hexadecimal digits:
0xFF = Alpha channel (fully opaque)Examples:
0xFFFFFFFF0xFF0000000xFFFF69000xFF155DFC