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/herald/app_design.dart';
5 : import 'package:app_finance/_classes/herald/app_locale.dart';
6 : import 'package:app_finance/_classes/structure/bill_app_data.dart';
7 : import 'package:app_finance/_ext/build_context_ext.dart';
8 : import 'package:app_finance/_configs/custom_text_theme.dart';
9 : import 'package:app_finance/_ext/date_time_ext.dart';
10 : import 'package:app_finance/design/wrapper/number_wrapper.dart';
11 : import 'package:app_finance/design/wrapper/row_widget.dart';
12 : import 'package:app_finance/_configs/theme_helper.dart';
13 : import 'package:app_finance/design/wrapper/text_wrapper.dart';
14 : import 'package:material_ui/material_ui.dart';
15 :
16 : class BillHeaderWidget extends StatelessWidget {
17 : final BillAppData item;
18 : final double width;
19 :
20 0 : const BillHeaderWidget({
21 : super.key,
22 : required this.item,
23 : required this.width,
24 : });
25 :
26 0 : @override
27 : Widget build(BuildContext context) {
28 0 : final textTheme = context.textTheme;
29 0 : final indent = ThemeHelper.getIndent();
30 0 : return Column(
31 0 : children: [
32 0 : RowWidget(
33 : indent: indent,
34 0 : alignment: AppDesign.getAlignment<MainAxisAlignment>(),
35 0 : maxWidth: width,
36 : chunk: const [null, null],
37 0 : children: [
38 0 : [
39 0 : Row(
40 0 : children: [
41 0 : Icon(item.icon, color: item.color, size: 20),
42 : ThemeHelper.wIndent,
43 0 : Expanded(
44 0 : child: TextWrapper(
45 0 : item.title,
46 0 : style: textTheme.headlineMedium,
47 : ),
48 : ),
49 : ],
50 : ),
51 0 : TextWrapper(
52 0 : '${AppLocale.labels.accountFrom}: ${item.accountNamed}',
53 0 : style: textTheme.bodySmall,
54 : ),
55 : ],
56 0 : [
57 0 : Align(
58 : alignment: Alignment.centerRight,
59 0 : child: NumberWidget(
60 0 : item.detailsFormatted,
61 0 : colorScheme: context.colorScheme,
62 0 : style: textTheme.numberMedium,
63 : ),
64 : ),
65 0 : Align(
66 : alignment: Alignment.centerRight,
67 0 : child: TextWrapper(
68 0 : item.createdAt.dateTime(),
69 0 : style: textTheme.numberSmall,
70 : ),
71 : ),
72 : ],
73 : ],
74 : ),
75 : ],
76 : );
77 : }
78 : }
|