fix recurrent spendings
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user