This commit is contained in:
2026-03-29 15:23:20 +03:00
parent 0d22e66475
commit 567a85486b
3 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -481,7 +481,7 @@ class _AddTransactionScreenState extends ConsumerState<AddTransactionScreen>
final activeAccount = ref.watch(activeAccountProvider);
final isTransfer = state.type == TransactionType.transfer;
final isEditingTransfer = isEditing && isTransfer;
final isFromAccountLocked = activeAccount != null || isTransfer;
final isFromAccountLocked = activeAccount != null || isEditingTransfer;
final isToAccountLocked = isEditingTransfer;
return Scaffold(
@@ -274,10 +274,16 @@ class _TransferAccountRow extends ConsumerWidget {
createdAt: DateTime.now(),
),
);
} else {
// If no account is explicitly selected and we're on Total Balance
// creating a new transfer — show empty, force user to choose
if (activeAccount == null && initial == null) {
fromAccount = null;
} else {
fromAccount =
activeAccount ?? (accounts.isNotEmpty ? accounts.first : null);
}
}
final Account? toAccount = toAccountId != null && accounts.isNotEmpty
? accounts.firstWhere(
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../../../core/constants.dart';
import '../../../shared/models/transaction.dart';
class SubmitButton extends StatelessWidget {
@@ -21,7 +22,9 @@ class SubmitButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final typeColor = type == TransactionType.income
final typeColor = type == TransactionType.transfer
? AppColors.accent
: type == TransactionType.income
? const Color(0xFF4CAF8C)
: const Color(0xFFE05C6B);