LCOV - code coverage report
Current view: top level - lib/design/form - list_budget_selector.dart Coverage Total Hit
Test: lcov.info Lines: 36.8 % 19 7
Test Date: 2026-11-14 15:04:37 Functions: - 0 0

            Line data    Source code
       1              : // Copyright 2023 The terCAD team. All rights reserved.
       2              : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
       3              : 
       4              : import 'package:app_finance/_classes/structure/budget_app_data.dart';
       5              : import 'package:app_finance/_classes/storage/app_data.dart';
       6              : import 'package:app_finance/_configs/theme_helper.dart';
       7              : import 'package:app_finance/design/form/list_selector.dart';
       8              : import 'package:app_finance/pages/budget/widgets/budget_line_widget.dart';
       9              : import 'package:app_finance/design/form/list_account_selector.dart';
      10              : import 'package:material_ui/material_ui.dart';
      11              : 
      12              : class ListBudgetSelectorItem extends ListAccountSelectorItem {
      13            0 :   @override
      14            0 :   Widget suggest(context) => LayoutBuilder(builder: (_, constraints) {
      15            0 :         return BudgetLineWidget(
      16            0 :           uuid: item.uuid ?? '',
      17            0 :           title: item.title ?? '',
      18            0 :           description: item.description ?? '',
      19            0 :           details: item.detailsFormatted ?? '',
      20            0 :           amount: item.amount.toString(),
      21              :           progress: 1.0,
      22            0 :           color: item.color ?? Colors.transparent,
      23            0 :           icon: item.icon ?? Icons.radio_button_unchecked_sharp,
      24            0 :           hidden: item.hidden ?? false,
      25            0 :           width: constraints.maxWidth - ThemeHelper.getIndent(),
      26              :           showDivider: false,
      27              :         );
      28              :       });
      29              : 
      30            1 :   ListBudgetSelectorItem({
      31              :     required BudgetAppData? super.item,
      32              :   });
      33              : }
      34              : 
      35              : class ListBudgetSelector extends ListAccountSelector<ListBudgetSelectorItem> {
      36            4 :   const ListBudgetSelector({
      37              :     super.key,
      38              :     required super.state,
      39              :     required super.setState,
      40              :     required super.width,
      41              :     required super.hintText,
      42              :     super.value,
      43              :     super.tooltip,
      44              :     super.withLabel,
      45            4 :   }) : super();
      46              : 
      47            1 :   @override
      48              :   List<ListBudgetSelectorItem> get options =>
      49            6 :       state.getList(AppDataType.budgets).map((item) => ListBudgetSelectorItem(item: item)).toList();
      50              : 
      51            4 :   @override
      52            4 :   ListSelectorState createState() => ListSelectorState<ListBudgetSelector, ListBudgetSelectorItem>();
      53              : }
        

Generated by: LCOV version 2.0-1