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
+21 -9
View File
@@ -11,6 +11,7 @@ import '../providers/tx_meta_provider.dart';
import '../utils/app_theme.dart';
import '../utils/helpers.dart';
import '../widgets/label_parent_picker.dart';
import '../widgets/recurring_template_sheet.dart';
import '../widgets/responsive_body.dart';
import '../widgets/similar_match_dialog.dart';
@@ -409,17 +410,28 @@ class _TransactionDetailScreenState extends State<TransactionDetailScreen> {
),
),
const SizedBox(height: 8),
SwitchListTile(
ListTile(
contentPadding: EdgeInsets.zero,
secondary: const Icon(Icons.autorenew),
title: const Text('Recurring'),
subtitle: const Text('Salary, mortgage, subscriptions…'),
value: meta.recurring,
onChanged: _busy
leading: Icon(
Icons.event_repeat,
color: colors.primary,
),
title: const Text('Create recurring spending'),
subtitle: Text(
metaController.hasRecurringSpendingForTx(tx.id)
? 'Already on Look ahead — tap to add another'
: 'Add this transaction to Look ahead',
style: theme.textTheme.bodySmall?.copyWith(
color: colors.onSurfaceVariant,
),
),
trailing: const Icon(Icons.chevron_right),
onTap: _busy
? null
: (value) {
context.read<TxMetaController>().setRecurring(tx, value);
},
: () => showCreateRecurringTemplateSheet(
context,
initialTx: tx,
),
),
SwitchListTile(
contentPadding: EdgeInsets.zero,