Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
third_party_delivery_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 '../../energy/energy_screen.dart';
6import '../../operational_details_screen/views/operational_hours_view.dart';
7import '../../widgets/step_brogress_bar.dart';
8
9class ThirdPartyDeliveryView extends StatefulWidget {
10 const ThirdPartyDeliveryView({super.key});
11
12 @override
13 State<ThirdPartyDeliveryView> createState() => _ThirdPartyDeliveryViewState();
14}
15
16class _ThirdPartyDeliveryViewState extends State<ThirdPartyDeliveryView> {
19 final TextEditingController _thirdPartyDistanceController = TextEditingController();
20 final TextEditingController _ownVehiclesDistanceController = TextEditingController();
21
22 final List<String> yesNoOptions = ['Yes', 'No'];
23
24 void _onSelectThirdParty(String option) {
25 setState(() {
26 useThirdParty = option;
27 });
28 }
29
30 void _onSelectSustainableCommuting(String option) {
31 setState(() {
33 });
34 }
35
36 @override
37 Widget build(BuildContext context) {
38 return SingleChildScrollView(
39 padding: EdgeInsets.all(15.sp),
40 child: Column(
41 crossAxisAlignment: CrossAxisAlignment.start,
42 children: [
43 Container(
44 width: double.infinity,
45 padding: EdgeInsets.all(15.sp),
46 decoration: BoxDecoration(
47 color: Colors.blue.withOpacity(0.11),
48 borderRadius: BorderRadius.circular(10),
49 ),
50 child: Center(
51 child: Text(
52 'Transport',
53 style: Theme.of(context)
54 .textTheme
55 .bodySmall
56 ?.copyWith(color: Colors.blue),
57 ),
58 ),
59 ),
60 SizedBox(height: 10.sp),
62 padding: EdgeInsets.all(15.sp),
63 child: Column(
64 crossAxisAlignment: CrossAxisAlignment.start,
65 children: [
66 SimpleProgressBar(
67 totalSteps: 6,
68 currentStep: 6,
69 ),
70 SizedBox(height: 10.sp),
71 Text(
72 'Do You Use Third-Party Delivery Platforms (E.G., Talabat, Jahez)?',
73 style: Theme.of(context).textTheme.displaySmall?.copyWith(
74 fontSize: 12.sp,
75 ),
76 ),
77 SizedBox(height: 20.sp),
78 ...yesNoOptions.map((option) => Padding(
79 padding: const EdgeInsets.only(bottom: 10),
80 child: CustomOptionButton(
81 isSelected: useThirdParty == option,
82 onPressed: () => _onSelectThirdParty(option),
83 option: option,
84 ),
85 )),
86 if (useThirdParty == 'Yes') ...[
87 SizedBox(height: 20.sp),
88 Text(
89 '(If Yes) What Is The Average Monthly Distance Covered For These Third-Party Deliveries (In Km)?',
90 style: Theme.of(context).textTheme.displaySmall?.copyWith(
91 fontSize: 12.sp,
92 ),
93 ),
94 SizedBox(height: 10.sp),
95 CustomInputField(
96 label: 'Monthly Distance',
97 hint: 'km/month',
98 ),
99 ],
100 SizedBox(height: 20.sp),
101 Text(
102 '(If Using Your Own Vehicles) What Is The Average Monthly Distance Covered (In Km)?',
103 style: Theme.of(context).textTheme.displaySmall?.copyWith(
104 fontSize: 12.sp,
105 ),
106 ),
107 SizedBox(height: 10.sp),
108 CustomInputField(
109 label: 'Monthly Distance',
110 hint: 'km/month',
111 ),
112 SizedBox(height: 20.sp),
113 Text(
114 'Do You Encourage Sustainable Commuting Options For Staff (E.G., Carpooling, Public Transport Incentives)?',
115 style: Theme.of(context).textTheme.displaySmall?.copyWith(
116 fontSize: 12.sp,
117 ),
118 ),
119 SizedBox(height: 20.sp),
120 ...yesNoOptions.map((option) => Padding(
121 padding: const EdgeInsets.only(bottom: 10),
122 child: CustomOptionButton(
124 onPressed: () => _onSelectSustainableCommuting(option),
125 option: option,
126 ),
127 )),
128 ],
129 ),
130 ),
131 ],
132 ),
133 );
134 }
135
136 @override
137 void dispose() {
140 super.dispose();
141 }
142}
override State< ThirdPartyDeliveryView > createState()
const ThirdPartyDeliveryView({super.key})
override void dispose()
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
final EdgeInsets padding
final String label
final bool isSelected
final Color color
Definition failures.dart:1
override Widget build(BuildContext context)
final List< String > yesNoOptions
void _onSelectThirdParty(String option)
void _onSelectSustainableCommuting(String option)
String useSustainableCommuting
final TextEditingController _thirdPartyDistanceController
class ThirdPartyDeliveryView extends StatefulWidget useThirdParty
final TextEditingController _ownVehiclesDistanceController