Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
collection_progress_tracker.dart
Go to the documentation of this file.
1import 'package:aidra_drive/core/ui/theme/color_palette.dart';
2import 'package:easy_localization/easy_localization.dart';
3import 'package:flutter/material.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5
6import 'progress_step.dart';
7
8class CollectionProgressTracker extends StatelessWidget {
9 final int stepNumber;
10 const CollectionProgressTracker({super.key, required this.stepNumber});
11
12 @override
13 Widget build(BuildContext context) {
14 return Column(
15 crossAxisAlignment: CrossAxisAlignment.start,
16 children: [
17 Row(
18 crossAxisAlignment: CrossAxisAlignment.center,
19 mainAxisAlignment: MainAxisAlignment.spaceBetween,
20 children: [
22 label: 'information.on_going'.tr(),
23 isActive: stepNumber == 1 || stepNumber > 1,
25 step: 1,
26 ),
27 Expanded(
28 child: Container(
29 height: 2,
30 color: getStepColor(1, 2),
31 margin: EdgeInsets.symmetric(horizontal: 8.sp),
32 ),
33 ),
35 label: 'information.confirmed'.tr(),
36 isActive: stepNumber == 2 || stepNumber > 2,
38 step: 2,
39 ),
40 Expanded(
41 child: Container(
42 height: 2,
43 color: getStepColor(2, 3),
44 margin: EdgeInsets.symmetric(horizontal: 7.sp),
45 ),
46 ),
48 label: 'information.completed'.tr(),
49 isActive: stepNumber == 3 || stepNumber > 3,
51 step: 3,
52 ),
53 ],
54 ),
55 ],
56 );
57 }
58
59 Color getStepColor(int fromStep, int toStep) {
60 if (stepNumber > fromStep) {
62 }
63 else if (stepNumber == fromStep) {
65 }
66 return ColorPalette.grey;
67 }
68}
static const lightGreen
static const grey
final bool isActive
const ProgressStep({ super.key, required this.label, required this.isActive, required this.isCompleted, required this.step, })
final Widget child
override Widget build(BuildContext context)
Color getStepColor(int fromStep, int toStep)
const CollectionProgressTracker({super.key, required this.stepNumber})
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,),),),],)