Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
transport_mode_view.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3
4import '../../../../../core/ui/widgets/custom_card.dart';
5import '../../../../../core/ui/widgets/custom_text_form_field.dart';
6import '../../operational_details_screen/views/operational_hours_view.dart';
7import '../../widgets/step_brogress_bar.dart';
8
9class TransportModeView extends StatefulWidget {
10 const TransportModeView({super.key});
11
12 @override
13 State<TransportModeView> createState() => _TransportModeViewState();
14}
15
16class _TransportModeViewState extends State<TransportModeView> {
17 final List<String> options = [
18 'Diesel truck',
19 'Petrol van',
20 'Electric vehicle',
21 'Other (specify)',
22 ];
23 final Set<String> selectedOptions = {};
24
25 void _onSelect(String option) {
26 setState(() {
27 if (selectedOptions.contains(option)) {
28 selectedOptions.remove(option);
29 } else {
30 selectedOptions.add(option);
31 }
32 });
33 }
34
35 @override
36 Widget build(BuildContext context) {
37 return SingleChildScrollView(
38 padding: EdgeInsets.all(15.sp),
39 child: Column(
40 crossAxisAlignment: CrossAxisAlignment.start,
41 children: [
42 Container(
43 width: double.infinity,
44 padding: EdgeInsets.all(15.sp),
45 decoration: BoxDecoration(
46 color: Colors.blue.withOpacity(0.11),
47 borderRadius: BorderRadius.circular(10),
48 ),
49 child: Center(
50 child: Text(
51 'Transport',
52 style: Theme.of(context)
53 .textTheme
54 .bodySmall
55 ?.copyWith(color: Colors.blue),
56 ),
57 ),
58 ),
59 SizedBox(height: 10.sp),
61 padding: EdgeInsets.all(15.sp),
62 child: Column(
63 crossAxisAlignment: CrossAxisAlignment.start,
64 children: [
65 SimpleProgressBar(
66 totalSteps: 6,
67 currentStep: 3,
68 ),
69 SizedBox(height: 10.sp),
70 Text(
71 'What Mode Of Transport Is Typically Used For Deliveries?',
72 style: Theme.of(context).textTheme.displaySmall?.copyWith(
73 fontSize: 12.sp,
74 ),
75 ),
76 Text(
77 '(Select All That Apply)',
78 style: Theme.of(context).textTheme.displaySmall?.copyWith(
79 color: Theme.of(context).hintColor,
80 fontSize: 10.sp,
81 ),
82 ),
83 SizedBox(height: 20.sp),
84 ...options.map((option) => Padding(
85 padding: const EdgeInsets.only(bottom: 10),
86 child: CustomOptionButton(
87 isSelected: selectedOptions.contains(option),
88 onPressed: () => _onSelect(option),
89 option: option,
90 ),
91 )),
92 if (selectedOptions.contains('Other (specify)'))
93 CustomTextFormField(
94 hintText: 'Type...',
95 maxLines: 4,
96 fillColor:
97 Theme.of(context).highlightColor.withOpacity(0.11),
98 controller: TextEditingController(),
99 ),
100 ],
101 ),
102 ),
103 ],
104 ),
105 );
106 }
107}
const TransportModeView({super.key})
override State< TransportModeView > createState()
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
final EdgeInsets padding
void _onSelect(String option)
final bool isSelected
class EnergySavingsMeasure extends StatefulWidget options
final Color color
Definition failures.dart:1
override Widget build(BuildContext context)
final Set< String > selectedOptions