fix recurrent spendings

This commit is contained in:
davmar
2026-09-10 09:23:40 +02:00
parent 5b22fc8694
commit 200ff72e2e
6 changed files with 116 additions and 150 deletions
+1 -16
View File
@@ -61,7 +61,6 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
var _showCalendar = false;
var _flowFilter = TxFlowFilter.all;
var _amountRange = const TxAmountRange();
var _recurringOnly = false;
/// Query actually used for filtering (Enter, or live once ≥3 chars).
String _activeQuery = '';
@@ -97,13 +96,11 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
bool get _hasListFilters =>
_labelFilters.isNotEmpty ||
_flowFilter != TxFlowFilter.all ||
_amountRange.isActive ||
_recurringOnly;
_amountRange.isActive;
bool _matchesExtraFilters(BankTransaction tx, TxMetaController meta) {
if (!txMatchesFlow(tx, _flowFilter)) return false;
if (!txMatchesAmountRange(tx, _amountRange)) return false;
if (_recurringOnly && !meta.metaFor(tx).recurring) return false;
return true;
}
@@ -172,7 +169,6 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
amountRange: _amountRange,
query: _activeQuery,
monthOnly: _searchInMonthOnly,
recurringOnly: _recurringOnly,
),
);
if (result == null || !mounted) return;
@@ -184,7 +180,6 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
_flowFilter = result.flow;
_amountRange = result.amountRange;
_searchInMonthOnly = result.monthOnly;
_recurringOnly = result.recurringOnly;
if (!_searchInMonthOnly) {
_showCalendar = false;
_selectedDay = null;
@@ -682,15 +677,6 @@ class _TransactionsScreenState extends State<TransactionsScreen> {
);
},
),
if (_recurringOnly)
InputChip(
visualDensity: VisualDensity.compact,
avatar: const Icon(Icons.event_repeat, size: 14),
label: const Text('Recurring'),
onDeleted: () {
setState(() => _recurringOnly = false);
},
),
for (final id in _labelFilters)
if (id == kUncategorizedFilterId)
InputChip(
@@ -968,7 +954,6 @@ class _CompactTransactionTile extends StatelessWidget {
formatIsoDate(tx.date),
if (labels.isNotEmpty)
labels.map((l) => l.name).join(', '),
if (meta.recurring) 'Recurring',
if (meta.internalTransfer) 'Transfer',
if (meta.hasNotes) 'Note',
if (tx.pending) 'Pending',