Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
transactions_summary_card.dart
Go to the documentation of this file.
1import 'package:connect/core/localization/app_localizations.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4import '../../../../../../../../../../core/utils/number_conversion.dart';
5
6class TransactionsSummaryCard extends StatelessWidget {
8 super.key,
9 required this.title,
10 required this.totalVolume,
11 required this.totalCollections,
12 });
13
14 final num totalVolume;
15 final String title;
17
18 @override
19 Widget build(BuildContext context) {
20 return Container(
21 padding: EdgeInsets.symmetric(
22 horizontal: 15.sp,
23 vertical: 15.sp,
24 ),
25 decoration: BoxDecoration(
26 borderRadius: BorderRadius.circular(10),
27 gradient: LinearGradient(
28 colors: [
29 Theme.of(context).colorScheme.primary,
30 Theme.of(context).colorScheme.secondary,
31 ],
32 ),
33 ),
34 child: Column(
35 crossAxisAlignment: CrossAxisAlignment.start,
36 children: [
37 Text(
38 title,
39 style: Theme.of(context)
40 .textTheme
41 .bodySmall
42 ?.copyWith(color: Theme.of(context).colorScheme.onPrimary),
43 ),
44 SizedBox(height: 10.sp),
45 Row(
46 mainAxisAlignment: MainAxisAlignment.spaceBetween,
47 children: [
48 Column(
49 crossAxisAlignment: CrossAxisAlignment.start,
50 children: [
51 Text(
52 AppLocalizations.of(context).translate('Collections'),
53 style: Theme.of(context).textTheme.bodySmall?.copyWith(
54 color: Theme.of(context)
55 .colorScheme
56 .onPrimary
57 .withOpacity(0.7),
58 ),
59 ),
60 SizedBox(height: 3.sp),
61 Text(
62 '$totalCollections',
63 style: Theme.of(context).textTheme.bodySmall?.copyWith(
64 fontSize: 22.sp,
65 color: Theme.of(context).colorScheme.onPrimary,
66 ),
67 ),
68 ],
69 ),
70 Column(
71 crossAxisAlignment: CrossAxisAlignment.end,
72 children: [
73 Text(
74 AppLocalizations.of(context).translate('Quantity'),
75 style: Theme.of(context).textTheme.bodySmall?.copyWith(
76 color: Theme.of(context)
77 .colorScheme
78 .onPrimary
79 .withOpacity(0.7),
80 ),
81 ),
82 SizedBox(height: 3.sp),
83 Text(
85 // '${NumberFormat.compact().format(totalVolume)} Kg',
86 style: Theme.of(context).textTheme.bodySmall?.copyWith(
87 fontSize: 22.sp,
88 color: Theme.of(context).colorScheme.onPrimary,
89 ),
90 ),
91 ],
92 ),
93 ],
94 ),
95 ],
96 ),
97 );
98 }
99}
String translate(String key)
static AppLocalizations of(BuildContext context)
static String convertAndFormatWeight(num? kg)
final String title
final Widget child
override Widget build(BuildContext context)
const TransactionsSummaryCard({ super.key, required this.title, required this.totalVolume, required this.totalCollections, })