4.4 KiB
Dark Mode Implementation Summary
This document summarizes all the hardcoded colors that have been replaced with theme-aware colors to support dark mode throughout the LBA app.
Files Updated
1. Widgets
-
lib/widgets/country_popup.dart✅Colors.white→AppColors.surfaceColors.black→AppColors.textPrimaryColors.black.withOpacity(0.3)→AppColors.shadowColor
-
lib/widgets/time_selection_bottom_sheet.dart✅Colors.white→AppColors.surfaceColors.grey[300]→AppColors.greyBorderColors.grey.shade300→AppColors.dividerColors.grey.shade600→AppColors.textSecondaryLightAppColors.offerTimer→AppColors.offerTimerLightAppColors.fillOrder→AppColors.fillOrderColors.black→AppColors.textPrimary
-
lib/widgets/similar_business_card.dart✅Colors.black.withOpacity(0.15)→AppColors.shadowColorColors.black→AppColors.textPrimaryColors.white→AppColors.surface
-
lib/widgets/gpsPopup.dart✅Colors.black.withOpacity(0.4)→AppColors.shadowColorLightAppColors.confirmPopup→AppColors.confirmPopupColors.black→AppColors.textPrimaryLightAppColors.inputBorder→AppColors.inputBorderColors.white→AppColors.surface
-
lib/widgets/logout_popup.dart✅Colors.black→AppColors.textPrimary
-
lib/widgets/search_bar.dart✅Colors.grey→AppColors.textSecondaryColor.fromARGB(255, 248, 248, 248)→AppColors.profileFieldColor.fromARGB(255, 14, 63, 102)→AppColors.borderPrimary
-
lib/widgets/reviews.dart✅LightAppColors.confirmButton→AppColors.confirmButtonLightAppColors.hint→AppColors.hint
-
lib/widgets/reserve_bottom_sheet.dart✅Colors.white→AppColors.surfaceColors.grey[300]→AppColors.greyBorderColor.fromARGB(255, 234, 247, 238)→AppColors.deliverySelectedButtonColors.grey.shade300→AppColors.dividerColors.grey.shade700→AppColors.textSecondaryColors.black87→AppColors.textPrimaryColors.grey→AppColors.textSecondaryColors.black→AppColors.textPrimaryColors.red→AppColors.errorColorColors.orangeAccent→AppColors.offerTimerColors.grey.shade800→AppColors.textSecondary
-
lib/widgets/recording_indicator.dart✅Colors.red→AppColors.errorColor(all instances)
-
lib/widgets/recorded_audio_preview.dart✅Colors.white→AppColors.surfaceColors.grey[700]→AppColors.textSecondaryColors.grey[300]→AppColors.greyBorderColors.grey[600]→AppColors.textSecondaryColors.red→AppColors.errorColor
2. Screens
-
lib/screens/qr_scanner/qr_scanner_page.dart✅Colors.red→AppColors.errorColorColors.black→AppColors.scaffoldBackgroundColors.black87→AppColors.scaffoldBackgroundColors.white54→AppColors.textSecondaryColors.white→AppColors.textPrimaryColors.grey[100]→AppColors.cardBackground
-
lib/screens/mains/profile/transactions_wallets_page.dart✅Colors.white→AppColors.scaffoldBackground
3. Features/Auth
lib/features/auth/presentation/pages/otp_verification_page.dart✅Colors.red→AppColors.errorColor
Colors System Already in Place
The app already has a comprehensive color system with:
LightAppColorsclass with all light theme colorsDarkAppColorsclass with all dark theme colorsAppColorsclass with dynamic getters that switch based on_isDarkModeflag
Remaining Files That May Need Attention
Some files still contain hardcoded colors that should be reviewed:
-
lib/widgets/optionSelector.dartColors.blue,Colors.grey,Colors.black
-
lib/widgets/legal_and_policies_page.dartColors.black87
-
lib/widgets/dividerTitle.dartColors.grey
-
lib/widgets/custom_switch_tile.dartColors.white
-
lib/widgets/customBottomSheet.dartColors.white,Colors.grey[400]
How to Use
To toggle dark mode, call:
AppColors.setDarkMode(true); // Enable dark mode
AppColors.setDarkMode(false); // Enable light mode
Next Steps
- Fix remaining files with hardcoded colors
- Test the dark mode implementation thoroughly
- Consider adding system theme detection
- Update any theme-related documentation