Theming & Branding
DWallet is designed to be easily themed. You can change colors, switch between light/dark modes, and customize the appearance to match your brand identity.
Built-in Color Schemes
Section titled “Built-in Color Schemes”DWallet comes with 13 predefined color schemes:
- Rose
- Blue (default)
- Zinc
- Slate
- Orange
- Yellow
- Green
- Violet
- Gray
- Neutral
- Red
- Stone
- System (uses device accent color)
Changing the Color Scheme
Section titled “Changing the Color Scheme”- Open the app
- Go to Settings > Appearance
- Select your preferred color scheme
Or programmatically:
ref.read(themeServiceProvider.notifier).setColorScheme(AppColorScheme.rose);Theme Modes
Section titled “Theme Modes”DWallet supports three theme modes:
- Light: Always use light theme
- Dark: Always use dark theme
- System: Follow system preference (default)
To change programmatically:
ref.read(themeServiceProvider.notifier).setThemeMode(ThemeMode.dark);Dynamic Colors (Android)
Section titled “Dynamic Colors (Android)”On Android 12+, DWallet supports Material You dynamic colors:
// In main.dartDynamicColorBuilder( builder: (lightDynamic, darkDynamic) { return ShadApp.router( theme: DAppTheme.theme( dynamicScheme: lightDynamic, // Uses system colors ), // ... ); },);Customizing Colors
Section titled “Customizing Colors”To add a custom color scheme:
- Open
lib/app/core/theme/_app_theme.dart - Add your color to
AppColorSchemeenum:
enum AppColorScheme { rose, blue, // ... existing schemes custom, // Add this}- Add the color definition in the theme map:
static const Map<AppColorScheme, Color> _schemeColors = { AppColorScheme.rose: Color(0xFFE11D48), // ... existing colors AppColorScheme.custom: Color(0xFFYourHex), // Add this};Shadcn UI Components
Section titled “Shadcn UI Components”DWallet uses shadcn_ui for consistent, accessible components. All components automatically adapt to the current theme.
Using Theme Colors
Section titled “Using Theme Colors”final theme = ShadTheme.of(context);
// Primary colortheme.colorScheme.primary
// Backgroundtheme.colorScheme.background
// Text colorstheme.textTheme.p // Paragraphtheme.textTheme.h1 // Heading 1theme.textTheme.muted // Muted textTypography
Section titled “Typography”DWallet uses Inter font family throughout:
// In theme configurationtextTheme: ShadTextTheme( family: 'Inter', // ... other properties)To change the font:
- Add font files to
assets/fonts/ - Update pubspec.yaml
- Modify
DAppTheme.theme()in_app_theme.dart
Persisting Theme Settings
Section titled “Persisting Theme Settings”Theme settings are automatically persisted using SharedPreferences. The ThemeService handles:
- Theme mode (light/dark/system)
- Color scheme selection
- Loading saved preferences on app start
Best Practices
Section titled “Best Practices”- Use semantic colors:
theme.colorScheme.primaryinstead of hardcoded colors - Test both themes: Ensure UI works well in light and dark modes
- Respect system preference: Default to
ThemeMode.system - Consider contrast: Ensure text is readable on all background colors