From 6e70b52d72ef955d331aff4b59e9aeae997e5942 Mon Sep 17 00:00:00 2001 From: Viachaslau Lyskouski Date: Mon, 21 Oct 2024 08:31:29 +0200 Subject: [PATCH] [#510] [NF] Exclude Account from Summary. Add skip option --- lib/_classes/math/total_recalculation.dart | 2 +- lib/_classes/structure/abstract_app_data.dart | 4 ++ lib/_classes/structure/account_app_data.dart | 3 ++ lib/_classes/structure/budget_app_data.dart | 3 ++ .../structure/interface_app_data.dart | 1 + lib/components/widgets/account_widget.dart | 1 + lib/components/widgets/budget_widget.dart | 1 + lib/design/form/list_account_selector.dart | 2 + lib/design/generic/base_line_widget.dart | 6 ++- lib/design/generic/base_widget.dart | 1 + lib/l10n/app_ar.arb | 1 + lib/l10n/app_az.arb | 1 + lib/l10n/app_be.arb | 1 + lib/l10n/app_be_EU.arb | 1 + lib/l10n/app_de.arb | 1 + lib/l10n/app_en.arb | 1 + lib/l10n/app_es.arb | 1 + lib/l10n/app_fa.arb | 1 + lib/l10n/app_fr.arb | 1 + lib/l10n/app_hi.arb | 1 + lib/l10n/app_it.arb | 1 + lib/l10n/app_ja.arb | 1 + lib/l10n/app_ko.arb | 1 + lib/l10n/app_nl.arb | 1 + lib/l10n/app_pl.arb | 1 + lib/l10n/app_pt.arb | 1 + lib/l10n/app_pt_BR.arb | 1 + lib/l10n/app_tr.arb | 1 + lib/l10n/app_uk.arb | 1 + lib/l10n/app_uz.arb | 1 + lib/l10n/app_zh.arb | 1 + lib/l10n/app_zh_TW.arb | 1 + lib/pages/account/account_add_page.dart | 38 ++++++++++++++----- lib/pages/account/account_edit_page.dart | 10 ++--- lib/pages/account/account_view_page.dart | 1 + .../account/widgets/account_line_widget.dart | 14 ++++++- lib/pages/budget/budget_add_page.dart | 12 ++++++ lib/pages/budget/budget_edit_page.dart | 2 + lib/pages/budget/budget_page.dart | 1 + lib/pages/budget/budget_view_page.dart | 1 + .../budget/widgets/budget_line_widget.dart | 16 +++++++- lib/pages/goal/goal_view_page.dart | 1 + 42 files changed, 121 insertions(+), 21 deletions(-) diff --git a/lib/_classes/math/total_recalculation.dart b/lib/_classes/math/total_recalculation.dart index df5be54231..16e5773bd1 100644 --- a/lib/_classes/math/total_recalculation.dart +++ b/lib/_classes/math/total_recalculation.dart @@ -24,7 +24,7 @@ class TotalRecalculation extends AbstractRecalculation { double updateTotalMap(AppDataType type, String uuid, HashMap hashTable) { final item = hashTable[uuid]; - if (item == null || item.hidden) { + if (item == null || item.hidden || item.skip) { return 0.0; } double total = exchange.reform(item.details, item.currency, Exchange.defaultCurrency); diff --git a/lib/_classes/structure/abstract_app_data.dart b/lib/_classes/structure/abstract_app_data.dart index 5a662b61ba..3e49d7a772 100644 --- a/lib/_classes/structure/abstract_app_data.dart +++ b/lib/_classes/structure/abstract_app_data.dart @@ -19,6 +19,8 @@ abstract class AbstractAppData implements InterfaceAppData { double progress; @override bool hidden; + @override + bool skip; String? description; @override MaterialColor? color; @@ -40,6 +42,7 @@ abstract class AbstractAppData implements InterfaceAppData { details = 0.0, this.progress = 1.0, this.hidden = false, + this.skip = false, }) : _createdAt = createdAt ?? (createdAtFormatted != null ? DateTime.parse(createdAtFormatted) : DateTime.now()), _updatedAt = updatedAt ?? DateTime.now(), _amount = 0.0 + (details ?? 0.0); @@ -65,6 +68,7 @@ abstract class AbstractAppData implements InterfaceAppData { 'details': details, 'progress': progress, 'hidden': hidden, + 'skip': skip, }; Map> toFile() { diff --git a/lib/_classes/structure/account_app_data.dart b/lib/_classes/structure/account_app_data.dart index e1049277d0..0a3bf0bbb1 100644 --- a/lib/_classes/structure/account_app_data.dart +++ b/lib/_classes/structure/account_app_data.dart @@ -30,6 +30,7 @@ class AccountAppData extends AbstractAppData { DateTime? closedAt, String? closedAtFormatted, super.hidden, + super.skip, }) : _closedAt = closedAt ?? (closedAtFormatted != null ? DateTime.parse(closedAtFormatted) : DateTime.now()); @override @@ -53,6 +54,7 @@ class AccountAppData extends AbstractAppData { createdAt: super.createdAt, closedAt: closedAt, hidden: super.hidden, + skip: super.skip, ); } @@ -71,6 +73,7 @@ class AccountAppData extends AbstractAppData { updatedAt: DateTime.parse(json['updatedAt']), closedAt: DateTime.parse(json['closedAt']), hidden: json['hidden'], + skip: json['skip'] ?? false, ); } diff --git a/lib/_classes/structure/budget_app_data.dart b/lib/_classes/structure/budget_app_data.dart index c345693eab..e87d3c3388 100644 --- a/lib/_classes/structure/budget_app_data.dart +++ b/lib/_classes/structure/budget_app_data.dart @@ -37,6 +37,7 @@ class BudgetAppData extends AbstractAppData with StorageMixin { this.amount = 0.0, this.type = '', super.hidden, + super.skip, }) : super( details: amountLimit, ); @@ -62,6 +63,7 @@ class BudgetAppData extends AbstractAppData with StorageMixin { amountSet: amountSet, amount: amount, hidden: super.hidden, + skip: super.skip, ); } @@ -79,6 +81,7 @@ class BudgetAppData extends AbstractAppData with StorageMixin { amountLimit: 0.0 + json['amountLimit'], amountSet: json['amountSet'] != null ? json['amountSet'].toString().toMap() : {}, hidden: json['hidden'], + skip: json['skip'] ?? false, ); } diff --git a/lib/_classes/structure/interface_app_data.dart b/lib/_classes/structure/interface_app_data.dart index aa9b961234..be67740fe7 100644 --- a/lib/_classes/structure/interface_app_data.dart +++ b/lib/_classes/structure/interface_app_data.dart @@ -11,6 +11,7 @@ abstract interface class InterfaceAppData { IconData? icon; MaterialColor? color; bool hidden = false; + bool skip = false; String get title; diff --git a/lib/components/widgets/account_widget.dart b/lib/components/widgets/account_widget.dart index 2486a3209d..385ffd0a3e 100644 --- a/lib/components/widgets/account_widget.dart +++ b/lib/components/widgets/account_widget.dart @@ -120,6 +120,7 @@ class AccountWidget extends BaseWidget { color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden, + skip: item.skip, width: width, route: routeList, error: item.error, diff --git a/lib/components/widgets/budget_widget.dart b/lib/components/widgets/budget_widget.dart index e8c894041f..d6e848889b 100644 --- a/lib/components/widgets/budget_widget.dart +++ b/lib/components/widgets/budget_widget.dart @@ -72,6 +72,7 @@ class BudgetWidget extends AccountWidget { color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden, + skip: item.skip, width: width, route: routeList, ), diff --git a/lib/design/form/list_account_selector.dart b/lib/design/form/list_account_selector.dart index b37e9d038b..ecb9aadf35 100644 --- a/lib/design/form/list_account_selector.dart +++ b/lib/design/form/list_account_selector.dart @@ -21,6 +21,7 @@ class ListAccountSelectorItem extends ListSelectorItem { color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden ?? false, + skip: item.skip ?? false, width: constraints.maxWidth, showDivider: false, ); @@ -37,6 +38,7 @@ class ListAccountSelectorItem extends ListSelectorItem { color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden ?? false, + skip: item.skip ?? false, width: constraints.maxWidth, showDivider: false, ); diff --git a/lib/design/generic/base_line_widget.dart b/lib/design/generic/base_line_widget.dart index 2203ec069d..8921aee21f 100644 --- a/lib/design/generic/base_line_widget.dart +++ b/lib/design/generic/base_line_widget.dart @@ -24,6 +24,7 @@ class BaseLineWidget extends StatelessWidget { final double width; final String route; final bool hidden; + final bool skip; final bool showDivider; final Widget? error; @@ -38,6 +39,7 @@ class BaseLineWidget extends StatelessWidget { this.icon = Icons.question_mark, this.error, this.hidden = false, + this.skip = false, this.progress = 1, this.route = '', this.showDivider = true, @@ -82,7 +84,9 @@ class BaseLineWidget extends StatelessWidget { children: [ TextWrapper( title, - style: textTheme.headlineMedium, + style: textTheme.headlineMedium?.copyWith( + fontStyle: skip ? FontStyle.italic : FontStyle.normal, + ), ), TextWrapper( description, diff --git a/lib/design/generic/base_widget.dart b/lib/design/generic/base_widget.dart index e261f8e3d2..191af90618 100644 --- a/lib/design/generic/base_widget.dart +++ b/lib/design/generic/base_widget.dart @@ -57,6 +57,7 @@ class BaseWidget extends StatelessWidget { color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden, + skip: item.skip, width: width, route: routeList, ), diff --git a/lib/l10n/app_ar.arb b/lib/l10n/app_ar.arb index d55a45e031..25466575be 100644 --- a/lib/l10n/app_ar.arb +++ b/lib/l10n/app_ar.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "الأساسيات", "settingsHeadline": "الإعدادات", + "skipFromTotals": "الاستبعاد من المجاميع", "skipTooltip": "تخطي الخطوة (الخطوات)", "spent": "المستهلكة", "splitCancelTooltip": "إلغاء التقسيم في الشهر", diff --git a/lib/l10n/app_az.arb b/lib/l10n/app_az.arb index befd4daed8..9103f30802 100644 --- a/lib/l10n/app_az.arb +++ b/lib/l10n/app_az.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Əsaslar", "settingsHeadline": "Parametrlər", + "skipFromTotals": "Cəmilərdən xaric edin", "skipTooltip": "Addım(lar)ı atlayın", "spent": "sərf etdi", "splitCancelTooltip": "Ayda bölünməni ləğv edin", diff --git a/lib/l10n/app_be.arb b/lib/l10n/app_be.arb index aab04751a8..9242ffa60e 100644 --- a/lib/l10n/app_be.arb +++ b/lib/l10n/app_be.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Асновы", "settingsHeadline": "Налады", + "skipFromTotals": "Выключыць з агульных вынікаў", "skipTooltip": "Прапусьціць крок(і)", "spent": "патр.", "splitCancelTooltip": "Адмяніць падьзел па месяцы", diff --git a/lib/l10n/app_be_EU.arb b/lib/l10n/app_be_EU.arb index c5562ef1ea..62e01d0f16 100644 --- a/lib/l10n/app_be_EU.arb +++ b/lib/l10n/app_be_EU.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Asnovy", "settingsHeadline": "Nalady", + "skipFromTotals": "Vykliučyć z ahuĺnych vynikaŭ", "skipTooltip": "Prapuścić Krok(i)", "spent": "patr.", "splitCancelTooltip": "Admianić Pad́ziel pa Miesiacy", diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 6d4f607d56..f043d71bb3 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Grundlagen", "settingsHeadline": "Einstellungen", + "skipFromTotals": "Aus den Gesamtwerten ausschließen", "skipTooltip": "Schritt(e) überspringen", "spent": "ausgegeben", "splitCancelTooltip": "Aufteilung pro Monat aufheben", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 8257ca6d62..8e6a7e1ea8 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Basics", "settingsHeadline": "Settings", + "skipFromTotals": "Exclude from Totals", "skipTooltip": "Skip Step(s)", "spent": "spent", "splitCancelTooltip": "Cancel Split per Month", diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index b0441ba8ac..7f64129277 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Básico", "settingsHeadline": "Configuración", + "skipFromTotals": "Excluir de los totales", "skipTooltip": "Saltar Paso(s)", "spent": "gastado", "splitCancelTooltip": "Anular división por mes", diff --git a/lib/l10n/app_fa.arb b/lib/l10n/app_fa.arb index 8ad981127c..00af8ae8f3 100644 --- a/lib/l10n/app_fa.arb +++ b/lib/l10n/app_fa.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "مبانی", "settingsHeadline": "تنظیمات", + "skipFromTotals": "حذف از مجموع", "skipTooltip": "رد شدن از مرحله(های)", "spent": "صرف کرد", "splitCancelTooltip": "لغو تقسیم در ماه", diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index 673b11853a..6e0cc82ffc 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Principes de base", "settingsHeadline": "Paramètres", + "skipFromTotals": "Exclure des totaux", "skipTooltip": "Sauter étape(s)", "spent": "dépensé", "splitCancelTooltip": "Annuler le fractionnement par mois", diff --git a/lib/l10n/app_hi.arb b/lib/l10n/app_hi.arb index 2c1bdce7d6..9685c414c7 100644 --- a/lib/l10n/app_hi.arb +++ b/lib/l10n/app_hi.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "मूल बातें", "settingsHeadline": "समायोजन", + "skipFromTotals": "कुल से बाहर रखें", "skipTooltip": "चरण छोड़ें", "spent": "खर्च किया", "splitCancelTooltip": "प्रति माह विभाजन रद्द करें", diff --git a/lib/l10n/app_it.arb b/lib/l10n/app_it.arb index 97c2d5804e..40b2784cc1 100644 --- a/lib/l10n/app_it.arb +++ b/lib/l10n/app_it.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Nozioni di base", "settingsHeadline": "Impostazioni", + "skipFromTotals": "Escludere dai totali", "skipTooltip": "Salta i passi", "spent": "speso", "splitCancelTooltip": "Annullare la suddivisione per mese", diff --git a/lib/l10n/app_ja.arb b/lib/l10n/app_ja.arb index 453093d1c3..4ff289a735 100644 --- a/lib/l10n/app_ja.arb +++ b/lib/l10n/app_ja.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "基本設定", "settingsHeadline": "設定", + "skipFromTotals": "合計から除外する", "skipTooltip": "ステップをスキップする", "spent": "使用済み", "splitCancelTooltip": "月ごとの分割を取り消す", diff --git a/lib/l10n/app_ko.arb b/lib/l10n/app_ko.arb index 13ea824b34..b7bc1ac176 100644 --- a/lib/l10n/app_ko.arb +++ b/lib/l10n/app_ko.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "기본 사항", "settingsHeadline": "설정", + "skipFromTotals": "합계에서 제외", "skipTooltip": "단계 건너뛰기", "spent": "지출", "splitCancelTooltip": "월별 분할 취소", diff --git a/lib/l10n/app_nl.arb b/lib/l10n/app_nl.arb index c42b74c2b8..5e6c13af57 100644 --- a/lib/l10n/app_nl.arb +++ b/lib/l10n/app_nl.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Basis", "settingsHeadline": "Instellingen", + "skipFromTotals": "Niet opnemen in totalen", "skipTooltip": "Stap(pen) overslaan", "spent": "uitgegeven", "splitCancelTooltip": "Splitsen per maand annuleren", diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index 431d240990..777c5237fc 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Podstawy", "settingsHeadline": "Ustawienia", + "skipFromTotals": "Wyklucz z sumy", "skipTooltip": "Pomiń kroki", "spent": "zużyty", "splitCancelTooltip": "Anuluj podział na miesiąc", diff --git a/lib/l10n/app_pt.arb b/lib/l10n/app_pt.arb index 811c860474..3869bc77f1 100644 --- a/lib/l10n/app_pt.arb +++ b/lib/l10n/app_pt.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Noções básicas", "settingsHeadline": "Definições", + "skipFromTotals": "Excluir dos totais", "skipTooltip": "Saltar passo(s)", "spent": "gasto", "splitCancelTooltip": "Cancelar divisão por mês", diff --git a/lib/l10n/app_pt_BR.arb b/lib/l10n/app_pt_BR.arb index b3acd0d807..318a1dbe21 100644 --- a/lib/l10n/app_pt_BR.arb +++ b/lib/l10n/app_pt_BR.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Noções básicas", "settingsHeadline": "Configurações", + "skipFromTotals": "Excluir dos totais", "skipTooltip": "Pular etapa(s)", "spent": "gasto", "splitCancelTooltip": "Cancelar divisão por mês", diff --git a/lib/l10n/app_tr.arb b/lib/l10n/app_tr.arb index d0c6f454dd..8cd10618e6 100644 --- a/lib/l10n/app_tr.arb +++ b/lib/l10n/app_tr.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Temel Bilgiler", "settingsHeadline": "Ayarlar", + "skipFromTotals": "Toplamlardan hariç tut", "skipTooltip": "Adım(lar)ı Atla", "spent": "harcandı", "splitCancelTooltip": "Ay Başına Bölünmeyi İptal Et", diff --git a/lib/l10n/app_uk.arb b/lib/l10n/app_uk.arb index b7bbf10273..86a6546723 100644 --- a/lib/l10n/app_uk.arb +++ b/lib/l10n/app_uk.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Основи", "settingsHeadline": "Налаштування", + "skipFromTotals": "Виключити із загальної кількості", "skipTooltip": "Пропустити крок(і)", "spent": "патр.", "splitCancelTooltip": "Скасувати розподіл на місяць", diff --git a/lib/l10n/app_uz.arb b/lib/l10n/app_uz.arb index 020c285c9a..53e52742b3 100644 --- a/lib/l10n/app_uz.arb +++ b/lib/l10n/app_uz.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "Asoslar", "settingsHeadline": "Sozlamalar", + "skipFromTotals": "Jami hisobdan chiqarib tashlang", "skipTooltip": "Qadam(lar)ni o‘tkazib yuborish", "spent": "sarflangan", "splitCancelTooltip": "Oyiga Splitni bekor qilish", diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index aeeb0e201e..5259ae9c9a 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "基础知识", "settingsHeadline": "设置", + "skipFromTotals": "不计入总数", "skipTooltip": "跳过步骤", "spent": "已花费", "splitCancelTooltip": "取消每月拆分", diff --git a/lib/l10n/app_zh_TW.arb b/lib/l10n/app_zh_TW.arb index c2ea5ccba0..33b4e57c47 100644 --- a/lib/l10n/app_zh_TW.arb +++ b/lib/l10n/app_zh_TW.arb @@ -352,6 +352,7 @@ }, "settingsBaseHeadline": "基本知識", "settingsHeadline": "設定", + "skipFromTotals": "總計不包括", "skipTooltip": "跳過步驟", "spent": "花費", "splitCancelTooltip": "取消每月分割", diff --git a/lib/pages/account/account_add_page.dart b/lib/pages/account/account_add_page.dart index aff42a32c9..420ebac153 100644 --- a/lib/pages/account/account_add_page.dart +++ b/lib/pages/account/account_add_page.dart @@ -57,6 +57,7 @@ class AccountAddPageState extends AbstractAddPageState late TextEditingController balance; IconData? icon; MaterialColor? color; + bool skip = false; @override void initState() { @@ -108,6 +109,7 @@ class AccountAddPageState extends AbstractAddPageState icon: icon, closedAt: validTillDate, createdAt: balanceUpdateDate, + skip: skip, )); } @@ -207,17 +209,33 @@ class AccountAddPageState extends AbstractAddPageState SimpleInputFormatter.filterDouble, ], ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + RowWidget( + indent: indent, + maxWidth: width + indent, + chunk: const [20, null], children: [ - TextWrapper( - AppLocale.labels.balanceDate, - style: textTheme.bodyLarge, - ), - Tooltip( - message: AppLocale.labels.balanceDateTooltip, - child: const Icon(Icons.info_outline), - ), + [Checkbox(value: skip, onChanged: (value) => setState(() => skip = value!))], + [TextWrapper(AppLocale.labels.skipFromTotals)], + ], + ), + ThemeHelper.hIndent2x, + RowWidget( + indent: indent, + maxWidth: width + indent, + chunk: const [null, 20], + children: [ + [ + TextWrapper( + AppLocale.labels.balanceDate, + style: textTheme.bodyLarge, + ), + ], + [ + Tooltip( + message: AppLocale.labels.balanceDateTooltip, + child: const Icon(Icons.info_outline), + ), + ] ], ), DateTimeInput( diff --git a/lib/pages/account/account_edit_page.dart b/lib/pages/account/account_edit_page.dart index f23037b523..d73a02379c 100644 --- a/lib/pages/account/account_edit_page.dart +++ b/lib/pages/account/account_edit_page.dart @@ -44,15 +44,11 @@ class AccountEditPageState extends AccountAddPageState { currency = form.currency; icon = form.icon; validTillDate = form.closedAt; + skip = form.skip; balanceUpdateDate = DateTime.now(); }); } - @override - String getTitle() { - return AppLocale.labels.editAccountHeader; - } - @override void updateStorage() { super.state.update( @@ -67,12 +63,16 @@ class AccountEditPageState extends AccountAddPageState { color: color ?? Colors.red, currency: currency, hidden: false, + skip: skip, icon: icon, closedAt: validTillDate, createdAt: balanceUpdateDate, )); } + @override + String getTitle() => AppLocale.labels.editAccountHeader; + @override String getButtonName() => AppLocale.labels.updateAccountTooltip; diff --git a/lib/pages/account/account_view_page.dart b/lib/pages/account/account_view_page.dart index 30ef5346f8..1df56becb2 100644 --- a/lib/pages/account/account_view_page.dart +++ b/lib/pages/account/account_view_page.dart @@ -189,6 +189,7 @@ class AccountViewPageState extends AbstractPageState { color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden, + skip: item.skip, width: width, route: _getRoute(item), ); diff --git a/lib/pages/account/widgets/account_line_widget.dart b/lib/pages/account/widgets/account_line_widget.dart index ffc61c779a..b1b6e4f73a 100644 --- a/lib/pages/account/widgets/account_line_widget.dart +++ b/lib/pages/account/widgets/account_line_widget.dart @@ -47,7 +47,12 @@ class AccountLineWidget extends StatelessWidget { Icon(item.icon, color: item.color, size: 20), ], [ - TextWrapper(item.title, style: textTheme.headlineMedium), + TextWrapper( + item.title, + style: textTheme.headlineMedium?.copyWith( + fontStyle: item.skip ? FontStyle.italic : FontStyle.normal, + ), + ), ], [ NumberWidget(item.description ?? '', colorScheme: context.colorScheme, style: textTheme.headlineMedium), @@ -87,7 +92,12 @@ class AccountLineWidget extends StatelessWidget { Icon(item.icon, color: item.color, size: 20), ], [ - TextWrapper(item.title, style: textTheme.headlineMedium), + TextWrapper( + item.title, + style: textTheme.headlineMedium?.copyWith( + fontStyle: item.skip ? FontStyle.italic : FontStyle.normal, + ), + ), ], [ Align( diff --git a/lib/pages/budget/budget_add_page.dart b/lib/pages/budget/budget_add_page.dart index 6fa3e98f86..e2d98dc93e 100644 --- a/lib/pages/budget/budget_add_page.dart +++ b/lib/pages/budget/budget_add_page.dart @@ -55,6 +55,7 @@ class BudgetAddPageState extends AbstractAddPageState amountSet = {}; + bool skip = false; @override void initState() { @@ -101,6 +102,7 @@ class BudgetAddPageState extends AbstractAddPageState extends AbstractAddPageState setState(() => currency = value), ), + RowWidget( + indent: indent, + maxWidth: width + indent, + chunk: const [20, null], + children: [ + [Checkbox(value: skip, onChanged: (value) => setState(() => skip = value!))], + [TextWrapper(AppLocale.labels.skipFromTotals)], + ], + ), + ThemeHelper.hIndent2x, ], ), ), diff --git a/lib/pages/budget/budget_edit_page.dart b/lib/pages/budget/budget_edit_page.dart index ea42fed352..4406dd48d2 100644 --- a/lib/pages/budget/budget_edit_page.dart +++ b/lib/pages/budget/budget_edit_page.dart @@ -40,6 +40,7 @@ class BudgetEditPageState extends BudgetAddPageState { color = form.color; icon = form.icon; currency = form.currency; + skip = form.skip; }); } @@ -58,6 +59,7 @@ class BudgetEditPageState extends BudgetAddPageState { data.amountLimit = double.tryParse(budgetLimit.text) ?? 0.0; data.currency = currency; data.createdAt = DateTime.now(); + data.skip = skip; state.update(uuid, data); } diff --git a/lib/pages/budget/budget_page.dart b/lib/pages/budget/budget_page.dart index 2daf7585de..38f2bdfeda 100644 --- a/lib/pages/budget/budget_page.dart +++ b/lib/pages/budget/budget_page.dart @@ -119,6 +119,7 @@ class BudgetPageState extends AbstractPageState { description: item.description, color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.question_mark, + skip: item.skip, ), ), ), diff --git a/lib/pages/budget/budget_view_page.dart b/lib/pages/budget/budget_view_page.dart index 2f20157acc..514661309f 100644 --- a/lib/pages/budget/budget_view_page.dart +++ b/lib/pages/budget/budget_view_page.dart @@ -101,6 +101,7 @@ class BudgetViewPageState extends AbstractPageState with TickerP color: item.color ?? Colors.transparent, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden, + skip: item.skip, width: width, route: AppRoute.billViewRoute, ); diff --git a/lib/pages/budget/widgets/budget_line_widget.dart b/lib/pages/budget/widgets/budget_line_widget.dart index 31b5d46bf7..d491876175 100644 --- a/lib/pages/budget/widgets/budget_line_widget.dart +++ b/lib/pages/budget/widgets/budget_line_widget.dart @@ -28,6 +28,7 @@ class BudgetLineWidget extends StatelessWidget { final bool hidden; final bool showDivider; final int count; + final bool skip; const BudgetLineWidget({ super.key, @@ -41,6 +42,7 @@ class BudgetLineWidget extends StatelessWidget { required this.width, this.count = 1, this.hidden = false, + this.skip = false, this.progress = 1, this.route = '', this.showDivider = true, @@ -75,7 +77,12 @@ class BudgetLineWidget extends StatelessWidget { Icon(icon, color: color, size: iconSize), ], [ - TextWrapper(title, style: textTheme.headlineMedium), + TextWrapper( + title, + style: textTheme.headlineMedium?.copyWith( + fontStyle: skip ? FontStyle.italic : FontStyle.normal, + ), + ), ], [ Align( @@ -118,7 +125,12 @@ class BudgetLineWidget extends StatelessWidget { Column( crossAxisAlignment: AppDesign.getAlignment(), children: [ - TextWrapper(title, style: textTheme.headlineMedium), + TextWrapper( + title, + style: textTheme.headlineMedium?.copyWith( + fontStyle: skip ? FontStyle.italic : FontStyle.normal, + ), + ), TextWrapper(description, style: textTheme.numberSmall), ], ), diff --git a/lib/pages/goal/goal_view_page.dart b/lib/pages/goal/goal_view_page.dart index 8024b3447d..6b57cd9349 100644 --- a/lib/pages/goal/goal_view_page.dart +++ b/lib/pages/goal/goal_view_page.dart @@ -107,6 +107,7 @@ class GoalViewPageState extends AbstractPageState { color: item.color ?? Colors.green.shade700, icon: item.icon ?? Icons.radio_button_unchecked_sharp, hidden: item.hidden, + skip: item.skip, progress: item.progress, ) ],