This commit is contained in:
2026-03-25 00:44:22 +03:00
parent f04cb29444
commit 782c9047f9
3 changed files with 10 additions and 9 deletions
+2 -1
View File
@@ -10,7 +10,8 @@ class AppStrings {
String get appTitle => _ru ? 'Мои финансы' : 'My Finances'; String get appTitle => _ru ? 'Мои финансы' : 'My Finances';
String get totalBalance => _ru ? 'ОБЩИЙ БАЛАНС' : 'TOTAL BALANCE'; String get totalBalance => _ru ? 'ОБЩИЙ БАЛАНС' : 'TOTAL BALANCE';
String get tapAndHoldToEdit => _ru ? 'удерживайте для редактирования' : 'tap and hold to edit'; 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 transactions => _ru ? 'Транзакции' : 'Transactions';
String get searchHint => _ru ? 'Поиск транзакций...' : 'Search transactions...'; String get searchHint => _ru ? 'Поиск транзакций...' : 'Search transactions...';
String get filterAll => _ru ? 'Все' : 'All'; String get filterAll => _ru ? 'Все' : 'All';
+7 -7
View File
@@ -160,7 +160,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
HapticService.medium(); HapticService.medium();
if (isAddingAccount) { if (isAddingAccount) {
// Create new account (the id: 0 is a placeholder, SQLite ignores it on insert)
final newAccount = Account( final newAccount = Account(
id: 0, id: 0,
name: tempAccountName.trim(), name: tempAccountName.trim(),
@@ -170,13 +169,14 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
createdAt: DateTime.now(), createdAt: DateTime.now(),
); );
// Get the ACTUAL generated ID directly from the database insert
final newId = await ref.read(accountRepositoryProvider).add(newAccount); final newId = await ref.read(accountRepositoryProvider).add(newAccount);
// Save colors securely using the exact database ID await CardColorService.save(
await ref tempPrimary,
.read(accountCardColorsProvider(newId).notifier) tempSecondary,
.save(tempPrimary, tempSecondary, tempGradientType); tempGradientType,
accountId: newId,
);
} else if (editingAccount != null) { } else if (editingAccount != null) {
// Existing edit logic // Existing edit logic
// Save colors // Save colors
@@ -315,7 +315,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
backgroundColor: const Color(0xFF7C6DED), backgroundColor: const Color(0xFF7C6DED),
foregroundColor: Colors.white, foregroundColor: Colors.white,
icon: const Icon(Icons.add), 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, floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
body: SafeArea( body: SafeArea(
@@ -973,7 +973,7 @@ class _AccountEditorOverlayState extends State<AccountEditorOverlay> {
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12)),
), ),
child: Text( child: Text(
dash.isAddingAccount ? s.add : s.apply, dash.isAddingAccount ? s.addAccount : s.apply,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.w700, fontSize: 14)), fontWeight: FontWeight.w700, fontSize: 14)),
), ),