LCOV - code coverage report
Current view: top level - lib/pages - sorting_page.dart Coverage Total Hit
Test: lcov.info Lines: 4.5 % 22 1
Test Date: 2026-11-14 15:08:11 Functions: - 0 0

            Line data    Source code
       1              : // Copyright 2026 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/herald/app_locale.dart';
       5              : import 'package:app_finance/_classes/herald/app_sorting.dart';
       6              : import 'package:app_finance/_configs/sorting_type.dart';
       7              : import 'package:app_finance/_configs/theme_helper.dart';
       8              : import 'package:app_finance/design/form/list_selector_item.dart';
       9              : import 'package:app_finance/design/form/list_selector_page.dart';
      10              : import 'package:app_finance/pages/_interfaces/abstract_page_state.dart';
      11              : import 'package:material_ui/material_ui.dart';
      12              : import 'package:provider/provider.dart';
      13              : 
      14              : class SortingPage extends StatefulWidget {
      15            1 :   const SortingPage({super.key});
      16              : 
      17            0 :   @override
      18            0 :   SortingPageState createState() => SortingPageState();
      19              : }
      20              : 
      21              : class SortingPageState extends AbstractPageState<SortingPage> {
      22            0 :   @override
      23            0 :   String getTitle() => AppLocale.labels.sortTooltip;
      24              : 
      25            0 :   @override
      26              :   String getButtonName() => '';
      27              : 
      28            0 :   @override
      29              :   Widget buildButton(BuildContext context, BoxConstraints constraints) => ThemeHelper.emptyBox;
      30              : 
      31            0 :   @override
      32            0 :   List<Widget> getBarActions(NavigatorState nav) => [ThemeHelper.emptyBox];
      33              : 
      34            0 :   @override
      35              :   Widget? buildNavigation() => null;
      36              : 
      37            0 :   @override
      38              :   Widget? getBarLeading(NavigatorState nav) => ThemeHelper.emptyBox;
      39              : 
      40            0 :   Future<void> onTap(ListSelectorItem? item, NavigatorState nav, AppSorting sorting) async {
      41            0 :     await sorting.set(item?.id);
      42            0 :     nav.pop();
      43              :   }
      44              : 
      45            0 :   @override
      46              :   Widget buildContent(BuildContext context, BoxConstraints constraints) {
      47            0 :     final nav = Navigator.of(context);
      48            0 :     final sorting = Provider.of<AppSorting>(context, listen: true);
      49            0 :     return ListSelectorPage<ListSelectorItem>(
      50            0 :       options: SortingType.getList(),
      51            0 :       result: SortingType.getItem(sorting.getKey(context)),
      52            0 :       tooltip: AppLocale.labels.sortTooltip,
      53            0 :       onTap: (item) => onTap(item, nav, sorting),
      54              :     );
      55              :   }
      56              : }
        

Generated by: LCOV version 2.0-1