Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
confirmation_dialogs.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3
4import '../../../../core/UI/theme/color_palette.dart';
5
7 static void showAcceptDialog(BuildContext context, VoidCallback onConfirm) {
8 showDialog(
9 context: context,
10 builder: (BuildContext context) {
11 return AlertDialog(
12 shape: RoundedRectangleBorder(
13 borderRadius: BorderRadius.circular(16.r),
14 ),
15 title: Row(
16 children: [
17 Container(
18 padding: EdgeInsets.all(8.sp),
19 decoration: BoxDecoration(
20 color: ColorPalette.lightGreen.withValues(alpha: 0.1),
21 borderRadius: BorderRadius.circular(8.r),
22 ),
23 child: Icon(
24 Icons.check_circle,
26 size: 20.sp,
27 ),
28 ),
29 SizedBox(width: 12.w),
30 Text(
31 'Accept Request',
32 style: TextStyle(
33 fontSize: 18.sp,
34 fontWeight: FontWeight.w600,
36 ),
37 ),
38 ],
39 ),
40 content: Text(
41 'Are you sure you want to accept this driver request? This will confirm your availability for the route.',
42 style: TextStyle(
43 fontSize: 14.sp,
45 height: 1.4,
46 ),
47 ),
48 actions: [
49 TextButton(
50 onPressed: () => Navigator.of(context).pop(),
51 child: Text(
52 'Cancel',
53 style: TextStyle(
55 fontSize: 14.sp,
56 ),
57 ),
58 ),
59 Container(
60 decoration: BoxDecoration(
61 gradient: LinearGradient(
62 colors: [
64 ColorPalette.lightGreen.withValues(alpha: 0.8),
65 ],
66 ),
67 borderRadius: BorderRadius.circular(8.r),
68 ),
69 child: TextButton(
70 onPressed: () {
71 Navigator.of(context).pop();
72 onConfirm();
73 },
74 child: Text(
75 'Accept',
76 style: TextStyle(
77 color: Colors.white,
78 fontSize: 14.sp,
79 fontWeight: FontWeight.w600,
80 ),
81 ),
82 ),
83 ),
84 ],
85 );
86 },
87 );
88 }
89
90 static void showDeclineDialog(BuildContext context, VoidCallback onConfirm) {
91 showDialog(
92 context: context,
93 builder: (BuildContext context) {
94 return AlertDialog(
95 shape: RoundedRectangleBorder(
96 borderRadius: BorderRadius.circular(16.r),
97 ),
98 title: Row(
99 children: [
100 Container(
101 padding: EdgeInsets.all(8.sp),
102 decoration: BoxDecoration(
103 color: Colors.red.withValues(alpha: 0.1),
104 borderRadius: BorderRadius.circular(8.r),
105 ),
106 child: Icon(
107 Icons.cancel,
108 color: Colors.red,
109 size: 20.sp,
110 ),
111 ),
112 SizedBox(width: 12.w),
113 Text(
114 'Decline Request',
115 style: TextStyle(
116 fontSize: 18.sp,
117 fontWeight: FontWeight.w600,
119 ),
120 ),
121 ],
122 ),
123 content: Text(
124 'Are you sure you want to decline this driver request? This action cannot be undone.',
125 style: TextStyle(
126 fontSize: 14.sp,
128 height: 1.4,
129 ),
130 ),
131 actions: [
132 TextButton(
133 onPressed: () => Navigator.of(context).pop(),
134 child: Text(
135 'Cancel',
136 style: TextStyle(
138 fontSize: 14.sp,
139 ),
140 ),
141 ),
142 Container(
143 decoration: BoxDecoration(
144 gradient: LinearGradient(
145 colors: [
146 Colors.red,
147 Colors.red.withValues(alpha: 0.8),
148 ],
149 ),
150 borderRadius: BorderRadius.circular(8.r),
151 ),
152 child: TextButton(
153 onPressed: () {
154 Navigator.of(context).pop();
155 onConfirm();
156 },
157 child: Text(
158 'Decline',
159 style: TextStyle(
160 color: Colors.white,
161 fontSize: 14.sp,
162 fontWeight: FontWeight.w600,
163 ),
164 ),
165 ),
166 ),
167 ],
168 );
169 },
170 );
171 }
172}
static const darkGrey
static const lightGreen
static const grey
static void showDeclineDialog(BuildContext context, VoidCallback onConfirm)
static void showAcceptDialog(BuildContext context, VoidCallback onConfirm)
final Widget child
final EdgeInsets padding
final Color color
Definition failures.dart:1
final VoidCallback onPressed
final String title
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)