Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
latest_transfers_view.dart
Go to the documentation of this file.
1import 'package:connect/core/localization/app_localizations.dart';
2
3import '/core/ui/widgets/custom_card.dart';
4import '/features/collections/domain/entities/collection_entity.dart';
5import '/features/wallet/presentation/screens/wallet_screen/widgets/wallet_card.dart';
6import 'package:flutter/material.dart';
7import 'package:flutter_screenutil/flutter_screenutil.dart';
8import 'package:hugeicons/hugeicons.dart';
9
10import '../../../../../../core/utils/collections_utils.dart';
11import '../../../../../collections/presentation/screens/transaction_history_screen/views/competed_transactions_view/views/transactions_summary_view/widgets/transaction_card.dart';
12
14
15class TransfersView extends StatefulWidget {
16 const TransfersView({
17 super.key,
18 required this.collections,
19 });
20
21 final List<CollectionEntity> collections;
22
23 @override
24 State<TransfersView> createState() => _TransfersViewState();
25}
26
27class _TransfersViewState extends State<TransfersView> {
29 List<CollectionEntity> mslcollections = [];
30
32 status = mystatus;
33 if (widget.collections.length >= 3) {
35 status == FlsStatus.latest && widget.collections.length <= 3
36 ? widget.collections.sublist(0, 2)
37 : widget.collections;
38 } else {
39 mslcollections = widget.collections;
40 }
41 setState(() {});
42 }
43
44 @override
45 void initState() {
47 super.initState();
48 }
49
50 @override
51 Widget build(BuildContext context) {
52 return widget.collections.isEmpty
53 ? Center(
54 child: Text(
55 AppLocalizations.of(context)
56 .translate('Nothing to show here right now'),
57 style: Theme.of(context).textTheme.bodySmall,
58 ),
59 )
60 : ListView(
61 padding: EdgeInsets.symmetric(
62 horizontal: 15.sp,
63 vertical: 15.sp,
64 ),
65 children: [
66 WalletCard(
67 totalCollectionsQuantity:
68 calculateCollectionsTotalQuantity(widget.collections),
69 ),
70 SizedBox(height: 5.sp),
71 Row(
72 children: [
73 Visibility(
74 visible: status == FlsStatus.recent,
75 child: ElevatedButton(
76 style: ElevatedButton.styleFrom(
77 backgroundColor: Colors.transparent,
78 padding: EdgeInsets.symmetric(
79 horizontal: 10.sp,
80 vertical: 10.sp,
81 ),
82 ),
83 onPressed: () {
84 filterCollectionbls(FlsStatus.latest);
85 },
86 child: Row(
87 mainAxisSize: MainAxisSize.min,
88 children: [
89 Icon(
90 HugeIcons.strokeRoundedArrowLeft02,
91 size: 15.sp,
92 color: Theme.of(context).colorScheme.primary,
93 ),
94 SizedBox(width: 5.sp),
95 Text(
96 AppLocalizations.of(context)
97 .translate('Latest Transfers'),
98 style: Theme.of(context)
99 .textTheme
100 .bodySmall
101 ?.copyWith(
102 color: Theme.of(context).colorScheme.primary,
103 ),
104 ),
105 ],
106 ),
107 ),
108 ),
109 const Spacer(),
110 Visibility(
111 visible: status == FlsStatus.latest,
112 child: ElevatedButton(
113 style: ElevatedButton.styleFrom(
114 backgroundColor: Colors.transparent,
115 padding: EdgeInsets.symmetric(
116 horizontal: 10.sp,
117 vertical: 10.sp,
118 ),
119 ),
120 onPressed: () {
121 filterCollectionbls(FlsStatus.recent);
122 },
123 child: Row(
124 mainAxisSize: MainAxisSize.min,
125 children: [
126 Text(
127 AppLocalizations.of(context)
128 .translate('Recent Transfers'),
129 style: Theme.of(context)
130 .textTheme
131 .bodySmall
132 ?.copyWith(
133 color: Theme.of(context).colorScheme.primary,
134 ),
135 ),
136 SizedBox(width: 5.sp),
137 Icon(
138 HugeIcons.strokeRoundedArrowRight02,
139 size: 15.sp,
140 color: Theme.of(context).colorScheme.primary,
141 ),
142 ],
143 ),
144 ),
145 ),
146 ],
147 ),
148 SizedBox(height: 5.sp),
150 padding: EdgeInsets.zero,
151 child: ListView.separated(
152 shrinkWrap: true,
153 padding: EdgeInsets.zero,
154 physics: const NeverScrollableScrollPhysics(),
155 itemCount: mslcollections.length,
156 separatorBuilder: (context, index) => Divider(
157 height: 0.sp,
158 endIndent: 10,
159 indent: 10,
160 ),
161 itemBuilder: (context, index) {
162 return TransactionCard(
164 showToBePaidLabel: true,
165 );
166 },
167 ),
168 ),
169 ],
170 );
171 }
172}
class CalenderTransactionsSummaryVeiw extends StatefulWidget collection
String translate(String key)
static AppLocalizations of(BuildContext context)
override Widget build(BuildContext context)
List< CollectionEntity > mslcollections
filterCollectionbls(FlsStatus mystatus)
override State< NavBarWrapper > createState()
num calculateCollectionsTotalQuantity(List< CollectionEntity > collections)
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
final EdgeInsets padding
final Color backgroundColor
final Color color
Definition failures.dart:1
enum FlsStatus TransfersView({ super.key, required this.collections, })
final List< CollectionEntity > collections