LCOV - code coverage report
Current view: top level - lib/pages/manager/widgets - log_entry_widget.dart Coverage Total Hit
Test: lcov.info Lines: 0.0 % 32 0
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/_configs/theme_helper.dart';
       6              : import 'package:app_finance/_ext/build_context_ext.dart';
       7              : import 'package:app_finance/_ext/date_time_ext.dart';
       8              : import 'package:app_finance/design/wrapper/text_wrapper.dart';
       9              : import 'package:app_finance/pages/manager/widgets/log_entry.dart';
      10              : import 'package:material_ui/material_ui.dart';
      11              : 
      12              : class LogEntryWidget extends StatelessWidget {
      13              :   final LogEntry entry;
      14              :   final int position;
      15              :   final VoidCallback onToggle;
      16              :   final VoidCallback onDelete;
      17              : 
      18            0 :   const LogEntryWidget({
      19              :     super.key,
      20              :     required this.entry,
      21              :     required this.position,
      22              :     required this.onToggle,
      23              :     required this.onDelete,
      24              :   });
      25              : 
      26            0 :   @override
      27              :   Widget build(BuildContext context) {
      28            0 :     final textTheme = context.textTheme;
      29            0 :     return Padding(
      30            0 :       padding: EdgeInsets.symmetric(vertical: ThemeHelper.getIndent(0.5)),
      31            0 :       child: Column(
      32              :         crossAxisAlignment: CrossAxisAlignment.stretch,
      33            0 :         children: [
      34            0 :           Row(
      35            0 :             children: [
      36            0 :               ReorderableDragStartListener(
      37            0 :                 index: position,
      38            0 :                 child: Padding(
      39            0 :                   padding: EdgeInsets.all(ThemeHelper.getIndent()),
      40              :                   child: const Icon(Icons.drag_handle),
      41              :                 ),
      42              :               ),
      43            0 :               IconButton(
      44            0 :                 tooltip: entry.isExpanded ? AppLocale.labels.collapse : AppLocale.labels.expand,
      45            0 :                 icon: Icon(entry.isExpanded ? Icons.expand_less : Icons.expand_more),
      46            0 :                 onPressed: onToggle,
      47              :               ),
      48            0 :               Expanded(
      49            0 :                 child: Column(
      50              :                   crossAxisAlignment: CrossAxisAlignment.start,
      51            0 :                   children: [
      52            0 :                     TextWrapper(entry.type, style: textTheme.bodyLarge),
      53            0 :                     TextWrapper(entry.date?.dateTime() ?? '?', style: textTheme.bodySmall),
      54              :                   ],
      55              :                 ),
      56              :               ),
      57            0 :               IconButton(
      58            0 :                 tooltip: AppLocale.labels.deleteTooltip,
      59              :                 icon: const Icon(Icons.delete_outline),
      60            0 :                 onPressed: onDelete,
      61              :               ),
      62              :             ],
      63              :           ),
      64            0 :           if (entry.isExpanded)
      65            0 :             Container(
      66            0 :               padding: EdgeInsets.all(ThemeHelper.getIndent()),
      67            0 :               color: context.colorScheme.surfaceContainerHighest,
      68            0 :               child: SelectableText(
      69            0 :                 entry.formatted,
      70            0 :                 style: textTheme.bodySmall?.copyWith(fontFamily: 'monospace'),
      71              :               ),
      72              :             ),
      73              :         ],
      74              :       ),
      75              :     );
      76              :   }
      77              : }
        

Generated by: LCOV version 2.0-1