diff --git a/lib/core/l10n/app_strings.dart b/lib/core/l10n/app_strings.dart index 59cb8da..c1ff21c 100644 --- a/lib/core/l10n/app_strings.dart +++ b/lib/core/l10n/app_strings.dart @@ -10,7 +10,8 @@ class AppStrings { String get appTitle => _ru ? 'Мои финансы' : 'My Finances'; String get totalBalance => _ru ? 'ОБЩИЙ БАЛАНС' : 'TOTAL BALANCE'; String get tapAndHoldToEdit => _ru ? 'удерживайте для редактирования' : 'tap and hold to edit'; - String get add => _ru ? 'Добавить счёт' : 'Add account'; + String get addAccount => _ru ? 'Добавить счёт' : 'Add account'; + String get addTransactionDashboard => _ru ? 'Добавить' : 'Add'; String get transactions => _ru ? 'Транзакции' : 'Transactions'; String get searchHint => _ru ? 'Поиск транзакций...' : 'Search transactions...'; String get filterAll => _ru ? 'Все' : 'All'; diff --git a/lib/features/dashboard/screen.dart b/lib/features/dashboard/screen.dart index aaa147b..6cfdcd2 100644 --- a/lib/features/dashboard/screen.dart +++ b/lib/features/dashboard/screen.dart @@ -160,7 +160,6 @@ class _DashboardScreenState extends ConsumerState { HapticService.medium(); if (isAddingAccount) { - // Create new account (the id: 0 is a placeholder, SQLite ignores it on insert) final newAccount = Account( id: 0, name: tempAccountName.trim(), @@ -170,13 +169,14 @@ class _DashboardScreenState extends ConsumerState { createdAt: DateTime.now(), ); - // Get the ACTUAL generated ID directly from the database insert final newId = await ref.read(accountRepositoryProvider).add(newAccount); - // Save colors securely using the exact database ID - await ref - .read(accountCardColorsProvider(newId).notifier) - .save(tempPrimary, tempSecondary, tempGradientType); + await CardColorService.save( + tempPrimary, + tempSecondary, + tempGradientType, + accountId: newId, + ); } else if (editingAccount != null) { // Existing edit logic // Save colors @@ -315,7 +315,7 @@ class _DashboardScreenState extends ConsumerState { backgroundColor: const Color(0xFF7C6DED), foregroundColor: Colors.white, icon: const Icon(Icons.add), - label: Text(s.add, style: const TextStyle(fontWeight: FontWeight.w600)), + label: Text(s.addTransactionDashboard, style: const TextStyle(fontWeight: FontWeight.w600)), ), floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, body: SafeArea( diff --git a/lib/features/dashboard/widgets/account_editor_overlay.dart b/lib/features/dashboard/widgets/account_editor_overlay.dart index abb7ee4..8c361b2 100644 --- a/lib/features/dashboard/widgets/account_editor_overlay.dart +++ b/lib/features/dashboard/widgets/account_editor_overlay.dart @@ -973,7 +973,7 @@ class _AccountEditorOverlayState extends State { borderRadius: BorderRadius.circular(12)), ), child: Text( - dash.isAddingAccount ? s.add : s.apply, + dash.isAddingAccount ? s.addAccount : s.apply, style: const TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ),