better UI
This commit is contained in:
@@ -10,6 +10,7 @@ import '../models/bank.dart';
|
||||
import '../models/transaction_meta.dart';
|
||||
import '../providers/bank_provider.dart';
|
||||
import '../providers/tx_meta_provider.dart';
|
||||
import '../utils/app_theme.dart';
|
||||
import '../utils/connect_bank.dart';
|
||||
import '../utils/helpers.dart';
|
||||
import '../utils/navigation.dart';
|
||||
@@ -451,8 +452,14 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
|
||||
),
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: _hasListFilters
|
||||
? colors.secondaryContainer
|
||||
: null,
|
||||
? colors.primary.withValues(alpha: 0.22)
|
||||
: colors.surfaceContainer,
|
||||
foregroundColor: _hasListFilters
|
||||
? colors.primary
|
||||
: colors.onSurfaceVariant,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
icon: Badge(
|
||||
isLabelVisible: _hasListFilters,
|
||||
@@ -476,8 +483,14 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
|
||||
},
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: _showCalendar && _searchInMonthOnly
|
||||
? colors.secondaryContainer
|
||||
: null,
|
||||
? colors.primary.withValues(alpha: 0.22)
|
||||
: colors.surfaceContainer,
|
||||
foregroundColor: _showCalendar && _searchInMonthOnly
|
||||
? colors.primary
|
||||
: colors.onSurfaceVariant,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
icon: Icon(
|
||||
_showCalendar && _searchInMonthOnly
|
||||
@@ -580,7 +593,7 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
|
||||
child: _TotalsCard(
|
||||
label: 'Money out',
|
||||
value: formatMoney(moneyOut, currency),
|
||||
color: colors.error,
|
||||
color: AppTheme.expense,
|
||||
icon: Icons.arrow_upward,
|
||||
),
|
||||
),
|
||||
@@ -589,7 +602,7 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
|
||||
child: _TotalsCard(
|
||||
label: 'Money in',
|
||||
value: formatMoney(moneyIn, currency),
|
||||
color: colors.primary,
|
||||
color: AppTheme.accent,
|
||||
icon: Icons.arrow_downward,
|
||||
),
|
||||
),
|
||||
@@ -842,28 +855,31 @@ class _TotalsCard extends StatelessWidget {
|
||||
final theme = Theme.of(context);
|
||||
final colors = theme.colorScheme;
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: colors.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(icon, size: 16, color: color),
|
||||
const SizedBox(width: 6),
|
||||
Text(label, style: theme.textTheme.labelMedium),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
value,
|
||||
style: theme.textTheme.titleMedium?.copyWith(color: color),
|
||||
),
|
||||
],
|
||||
return Material(
|
||||
color: colors.surfaceContainer,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(icon, size: 16, color: color),
|
||||
const SizedBox(width: 6),
|
||||
Text(label, style: theme.textTheme.labelMedium),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
value,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
color: color,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -884,7 +900,8 @@ class _CompactTransactionTile extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final colors = theme.colorScheme;
|
||||
final amountColor = tx.amount >= 0 ? colors.primary : colors.error;
|
||||
final amountColor =
|
||||
tx.amount >= 0 ? AppTheme.accent : AppTheme.expense;
|
||||
final primary = labels.isEmpty ? null : labels.first;
|
||||
final iconColor = primary?.color ?? colors.outline;
|
||||
final iconData = primary?.icon ?? Icons.receipt_long_outlined;
|
||||
|
||||
Reference in New Issue
Block a user