diff --git a/lib/features/add_transaction/screen.dart b/lib/features/add_transaction/screen.dart index 7c0170c..e6098cd 100644 --- a/lib/features/add_transaction/screen.dart +++ b/lib/features/add_transaction/screen.dart @@ -104,6 +104,7 @@ class _AddTransactionScreenState extends ConsumerState { final state = ref.watch(addTransactionProvider(widget.initial)); final categories = ref.watch(availableCategoriesProvider(widget.initial)); final currencyInfo = ref.watch(currencyProvider); + final isDark = Theme.of(context).brightness == Brightness.dark; return Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -245,7 +246,7 @@ class _AddTransactionScreenState extends ConsumerState { decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(12), - border: Border.all(color: Theme.of(context).dividerColor), + border: isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1), ), child: Row( children: [ @@ -323,11 +324,12 @@ class _TypeToggle extends StatelessWidget { @override Widget build(BuildContext context) { + final isDark = Theme.of(context).brightness == Brightness.dark; return Container( decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(14), - border: Border.all(color: Theme.of(context).dividerColor), + border: isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1), ), child: Row( children: [ @@ -409,6 +411,7 @@ class _CategoryPicker extends StatelessWidget { @override Widget build(BuildContext context) { + final isDark = Theme.of(context).brightness == Brightness.dark; return Wrap( spacing: 8, runSpacing: 8, @@ -424,10 +427,9 @@ class _CategoryPicker extends StatelessWidget { decoration: BoxDecoration( color: isSelected ? color.withOpacity(0.2) : Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(12), - border: Border.all( - color: isSelected ? color : Theme.of(context).dividerColor, - width: isSelected ? 1.5 : 1, - ), + border: isSelected + ? Border.all(color: color, width: 1.5) + : (isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1)), ), child: Row( mainAxisSize: MainAxisSize.min, diff --git a/lib/features/dashboard/screen.dart b/lib/features/dashboard/screen.dart index d7e1f86..6188ced 100644 --- a/lib/features/dashboard/screen.dart +++ b/lib/features/dashboard/screen.dart @@ -38,6 +38,7 @@ class _DashboardScreenState extends ConsumerState { final recent = ref.watch(recentTransactionsProvider); final filter = ref.watch(transactionFilterProvider); final currencyInfo = ref.watch(currencyProvider); + final isDark = Theme.of(context).brightness == Brightness.dark; final budgetExceeded = budget != null && monthExpense > budget; @@ -218,6 +219,7 @@ class _FilterChip extends StatelessWidget { @override Widget build(BuildContext context) { final chipColor = color ?? AppColors.accent; + final isDark = Theme.of(context).brightness == Brightness.dark; return GestureDetector( onTap: onTap, child: AnimatedContainer( @@ -226,10 +228,9 @@ class _FilterChip extends StatelessWidget { decoration: BoxDecoration( color: isSelected ? chipColor.withOpacity(0.2) : Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(20), - border: Border.all( - color: isSelected ? chipColor : Theme.of(context).dividerColor, - width: isSelected ? 1.5 : 1, - ), + border: isSelected + ? Border.all(color: chipColor, width: 1.5) + : (isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1)), ), child: Text( label, @@ -334,12 +335,13 @@ class _BudgetWarning extends StatelessWidget { @override Widget build(BuildContext context) { final over = spent - budget; + final isDark = Theme.of(context).brightness == Brightness.dark; return Container( padding: const EdgeInsets.all(14), decoration: BoxDecoration( color: AppColors.expense.withOpacity(0.1), borderRadius: BorderRadius.circular(12), - border: Border.all(color: AppColors.expense.withOpacity(0.3)), + border: isDark ? null : Border.all(color: AppColors.expense.withOpacity(0.3), width: 1), ), child: Row( children: [ diff --git a/lib/features/settings/screen.dart b/lib/features/settings/screen.dart index 15832fe..9aa1ab9 100644 --- a/lib/features/settings/screen.dart +++ b/lib/features/settings/screen.dart @@ -54,6 +54,7 @@ class _SettingsScreenState extends ConsumerState { final themeMode = ref.watch(themeProvider); final isDarkMode = themeMode == ThemeMode.dark; final currencyInfo = ref.watch(currencyProvider); + final isDark = Theme.of(context).brightness == Brightness.dark; // Update currency format when it changes _currencyFmt = NumberFormat.currency(symbol: currencyInfo.symbol, decimalDigits: 2); @@ -100,7 +101,7 @@ class _SettingsScreenState extends ConsumerState { decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(16), - border: Border.all(color: Theme.of(context).dividerColor), + border: isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1), ), child: Row( children: [ @@ -155,7 +156,7 @@ class _SettingsScreenState extends ConsumerState { decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(16), - border: Border.all(color: Theme.of(context).dividerColor), + border: isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -208,10 +209,9 @@ class _SettingsScreenState extends ConsumerState { ? AppColors.accent.withOpacity(0.2) : Theme.of(context).scaffoldBackgroundColor, borderRadius: BorderRadius.circular(12), - border: Border.all( - color: isSelected ? AppColors.accent : Theme.of(context).dividerColor, - width: isSelected ? 1.5 : 1, - ), + border: isSelected + ? Border.all(color: AppColors.accent, width: 1.5) + : (isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1)), ), child: Column( children: [ @@ -249,7 +249,7 @@ class _SettingsScreenState extends ConsumerState { decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(16), - border: Border.all(color: Theme.of(context).dividerColor), + border: isDark ? null : Border.all(color: const Color(0xFFDDDDEE), width: 1), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -355,29 +355,6 @@ class _SettingsScreenState extends ConsumerState { ], ), ), - const SizedBox(height: 24), - Container( - padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - color: AppColors.accent.withOpacity(0.1), - borderRadius: BorderRadius.circular(12), - border: Border.all(color: AppColors.accent.withOpacity(0.3)), - ), - child: Row( - children: [ - const Icon(Icons.info_outline_rounded, color: AppColors.accent, size: 20), - const SizedBox(width: 12), - Expanded( - child: Text( - 'Budget tracking shows on the Dashboard with a progress bar and warning when exceeded.', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Theme.of(context).colorScheme.onSurface, - ), - ), - ), - ], - ), - ), ], ), ),