Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
transactions_history_screen.dart
Go to the documentation of this file.
1import 'package:easy_localization/easy_localization.dart';
2import 'package:flutter/material.dart';
3
4import '../../../../../core/ui/theme/color_palette.dart';
5import '../../../../../core/ui/widgets/custom_scaffold.dart';
6import '../../../../../core/ui/widgets/tab_selector.dart';
7import 'views/history_collections_view.dart';
8import 'views/pending_collections_view.dart';
9
10class TransactionsHistoryScreen extends StatefulWidget {
11 const TransactionsHistoryScreen({super.key});
12
13 @override
14 State<TransactionsHistoryScreen> createState() => _TransactionsHistoryScreenState();
15}
16
17class _TransactionsHistoryScreenState extends State<TransactionsHistoryScreen> {
18 PageController pageViewController = PageController();
19 bool isPendingSelected = true;
20 @override
21 Widget build(BuildContext context) {
22 return CustomScaffold(
23 backgroundColor: ColorPalette.antiFlashWhite,
24 title: 'transactions_history.title'.tr(),
25 body: Column(
26 children: [
27 TabSelector(
28 firstTabName: "common.pending".tr(),
29 secondTabName: "common.history".tr(),
30 onTabSelected: (value) {
31 setState(() {
32 isPendingSelected = value;
33 pageViewController.animateToPage(
34 isPendingSelected ? 0 : 1,
35 duration: const Duration(milliseconds: 250),
36 curve: Curves.ease,
37 );
38 });
39 },
40 initialSelection: isPendingSelected,
41 ),
42 Expanded(
43 child: PageView(
44 physics: const NeverScrollableScrollPhysics(),
45 controller: pageViewController,
46 children: const [
48 HistoryCollectionsView()
49 ],
50 ),
51 ),
52 ],
53 ),
54 );
55 }
56}
class App extends StatefulWidget build(BuildContext context)
Definition app.dart:31
static const antiFlashWhite
override State< TransactionsHistoryScreen > createState()
const TransactionsHistoryScreen({super.key})
final Widget child
const PendingCollectionsView({super.key})
final String title
class TransactionsHistoryScreen extends StatefulWidget pageViewController
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)