This commit is contained in:
2026-03-27 14:49:30 +03:00
parent ce324a0a5e
commit 2fc1d3e200
4 changed files with 252 additions and 255 deletions
+92 -110
View File
@@ -433,33 +433,16 @@ class _AddTransactionScreenState extends ConsumerState<AddTransactionScreen>
ListView(
padding: const EdgeInsets.all(20),
children: [
Stack(
children: [
IgnorePointer(
ignoring: isEditing,
child: TypeToggle(
selected: state.type,
onChanged: (type) => ref
.read(
addTransactionProvider(widget.initial).notifier,
)
.setType(type),
isDark: isDark,
),
),
if (isEditing)
Positioned(
top: 8,
right: 8,
child: Icon(
Icons.lock_outline,
size: 16,
color: Theme.of(
context,
).colorScheme.onSurface.withOpacity(0.4),
),
),
],
IgnorePointer(
ignoring: isEditing,
child: TypeToggle(
selected: state.type,
onChanged: (type) => ref
.read(addTransactionProvider(widget.initial).notifier)
.setType(type),
isDark: isDark,
isEditing: isEditing,
),
),
const SizedBox(height: 16),
@@ -796,7 +779,6 @@ class _ToAccountDropdownOverlay extends ConsumerWidget {
// Calculate position from trigger key
double top = 340;
double left = 20;
double? width;
if (triggerKey?.currentContext != null) {
final renderBox =
@@ -805,98 +787,98 @@ class _ToAccountDropdownOverlay extends ConsumerWidget {
final size = renderBox.size;
top = offset.dy + size.height + 4;
left = offset.dx;
width = size.width;
}
return Positioned(
top: top,
left: left,
width: width,
child: Material(
elevation: 8,
borderRadius: BorderRadius.circular(12),
color: Colors.transparent,
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: const Color(0xFF7C6DED).withOpacity(0.3),
width: 1.5,
),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
blurRadius: 16,
offset: const Offset(0, 4),
child: IntrinsicWidth(
child: Material(
elevation: 8,
borderRadius: BorderRadius.circular(12),
color: Colors.transparent,
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: const Color(0xFF7C6DED).withOpacity(0.3),
width: 1.5,
),
],
),
child: accountsAsync.when(
data: (accounts) {
final filteredAccounts = accounts
.where((a) => a.id != selectedAccountId)
.toList();
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
blurRadius: 16,
offset: const Offset(0, 4),
),
],
),
child: accountsAsync.when(
data: (accounts) {
final filteredAccounts = accounts
.where((a) => a.id != selectedAccountId)
.toList();
return Column(
mainAxisSize: MainAxisSize.min,
children: filteredAccounts.map((account) {
final isSelected = account.id == toAccountId;
return InkWell(
borderRadius: BorderRadius.circular(12),
onTap: () {
ref
.read(addTransactionProvider(initial).notifier)
.setToAccountId(account.id);
onClose();
HapticService.light();
},
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 14,
vertical: 12,
),
child: Row(
children: [
Icon(
Icons.account_balance_wallet_rounded,
size: 16,
color: isSelected
? const Color(0xFF7C6DED)
: Theme.of(
context,
).colorScheme.onSurface.withOpacity(0.5),
),
const SizedBox(width: 10),
Expanded(
child: Text(
account.name,
style: TextStyle(
fontSize: 14,
fontWeight: isSelected
? FontWeight.w600
: FontWeight.w400,
color: isSelected
? const Color(0xFF7C6DED)
: Theme.of(context).colorScheme.onSurface,
return Column(
mainAxisSize: MainAxisSize.min,
children: filteredAccounts.map((account) {
final isSelected = account.id == toAccountId;
return InkWell(
borderRadius: BorderRadius.circular(12),
onTap: () {
ref
.read(addTransactionProvider(initial).notifier)
.setToAccountId(account.id);
onClose();
HapticService.light();
},
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 14,
vertical: 12,
),
child: Row(
children: [
Icon(
Icons.account_balance_wallet_rounded,
size: 16,
color: isSelected
? const Color(0xFF7C6DED)
: Theme.of(
context,
).colorScheme.onSurface.withOpacity(0.5),
),
const SizedBox(width: 10),
Expanded(
child: Text(
account.name,
style: TextStyle(
fontSize: 14,
fontWeight: isSelected
? FontWeight.w600
: FontWeight.w400,
color: isSelected
? const Color(0xFF7C6DED)
: Theme.of(context).colorScheme.onSurface,
),
),
),
),
if (isSelected)
const Icon(
Icons.check_rounded,
size: 16,
color: Color(0xFF7C6DED),
),
],
if (isSelected)
const Icon(
Icons.check_rounded,
size: 16,
color: Color(0xFF7C6DED),
),
],
),
),
),
);
}).toList(),
);
},
loading: () => const SizedBox.shrink(),
error: (_, __) => const SizedBox.shrink(),
);
}).toList(),
);
},
loading: () => const SizedBox.shrink(),
error: (_, __) => const SizedBox.shrink(),
),
),
),
),