mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 18:35:28 +03:00
stableee
This commit is contained in:
@@ -481,7 +481,7 @@ class _AddTransactionScreenState extends ConsumerState<AddTransactionScreen>
|
|||||||
final activeAccount = ref.watch(activeAccountProvider);
|
final activeAccount = ref.watch(activeAccountProvider);
|
||||||
final isTransfer = state.type == TransactionType.transfer;
|
final isTransfer = state.type == TransactionType.transfer;
|
||||||
final isEditingTransfer = isEditing && isTransfer;
|
final isEditingTransfer = isEditing && isTransfer;
|
||||||
final isFromAccountLocked = activeAccount != null || isTransfer;
|
final isFromAccountLocked = activeAccount != null || isEditingTransfer;
|
||||||
final isToAccountLocked = isEditingTransfer;
|
final isToAccountLocked = isEditingTransfer;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|||||||
@@ -274,10 +274,16 @@ class _TransferAccountRow extends ConsumerWidget {
|
|||||||
createdAt: DateTime.now(),
|
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 {
|
} else {
|
||||||
fromAccount =
|
fromAccount =
|
||||||
activeAccount ?? (accounts.isNotEmpty ? accounts.first : null);
|
activeAccount ?? (accounts.isNotEmpty ? accounts.first : null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final Account? toAccount = toAccountId != null && accounts.isNotEmpty
|
final Account? toAccount = toAccountId != null && accounts.isNotEmpty
|
||||||
? accounts.firstWhere(
|
? accounts.firstWhere(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import '../../../core/constants.dart';
|
||||||
import '../../../shared/models/transaction.dart';
|
import '../../../shared/models/transaction.dart';
|
||||||
|
|
||||||
class SubmitButton extends StatelessWidget {
|
class SubmitButton extends StatelessWidget {
|
||||||
@@ -21,7 +22,9 @@ class SubmitButton extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final typeColor = type == TransactionType.income
|
final typeColor = type == TransactionType.transfer
|
||||||
|
? AppColors.accent
|
||||||
|
: type == TransactionType.income
|
||||||
? const Color(0xFF4CAF8C)
|
? const Color(0xFF4CAF8C)
|
||||||
: const Color(0xFFE05C6B);
|
: const Color(0xFFE05C6B);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user