Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
show_documents_option.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3
4import '../../ui/theme/color_palette.dart';
5
7 final IconData icon;
8 final String title;
9 final Color color;
10 final VoidCallback onTap;
11
13 required this.icon,
14 required this.title,
15 required this.color,
16 required this.onTap,
17 });
18}
19
21 BuildContext context,
22 List<DocumentOption> options,
23) {
24 showDialog(
25 context: context,
26 builder: (BuildContext context) {
27 return Dialog(
28 backgroundColor: Colors.transparent,
29 elevation: 0,
30 child: Container(
31 width: 300.w,
32 decoration: BoxDecoration(
33 color: Colors.white,
34 borderRadius: BorderRadius.circular(20.r),
35 boxShadow: [
36 BoxShadow(
37 color: Colors.black.withValues(alpha: 0.1),
38 blurRadius: 10,
39 spreadRadius: 1,
40 ),
41 ],
42 ),
44 mainAxisSize: MainAxisSize.min,
45 children: [
46 Container(
47 padding: EdgeInsets.symmetric(vertical: 15.sp),
48 decoration: BoxDecoration(
50 borderRadius: BorderRadius.only(
51 topLeft: Radius.circular(20.r),
52 topRight: Radius.circular(20.r),
53 ),
54 ),
55 child: Center(
56 child: Text(
57 'Select Document Type',
58 style: Theme.of(context).textTheme.titleMedium?.copyWith(
59 fontWeight: FontWeight.bold,
60 color: Colors.white,
61 ),
62 ),
63 ),
64 ),
65 SizedBox(height: 20.h),
66 Padding(
67 padding: EdgeInsets.symmetric(horizontal: 15.w),
68 child: Text(
69 'Choose which document you want to view:',
70 textAlign: TextAlign.center,
71 style: TextStyle(
73 fontSize: 14.sp,
74 ),
75 ),
76 ),
77 SizedBox(height: 20.h),
78
80 Padding(
81 padding: EdgeInsets.symmetric(horizontal: 10.w),
82 child: Wrap(
83 alignment: WrapAlignment.center,
84 spacing: 10.w,
85 runSpacing: 10.h,
86 children: options.map((option) {
87 return _buildDocumentOption(
88 icon: option.icon,
89 title: option.title,
90 color: option.color,
91 onTap: () {
92 Navigator.pop(context);
93 option.onTap();
94 },
95 );
96 }).toList(),
97 ),
98 ),
99
100 SizedBox(height: 20.h),
101 Divider(height: 1, color: Colors.grey.withValues(alpha: 0.3)),
102 InkWell(
103 onTap: () => Navigator.pop(context),
104 borderRadius: BorderRadius.only(
105 bottomLeft: Radius.circular(20.r),
106 bottomRight: Radius.circular(20.r),
107 ),
108 child: Container(
109 padding: EdgeInsets.symmetric(vertical: 15.sp),
110 width: double.infinity,
111 alignment: Alignment.center,
112 child: Text(
113 'Cancel',
114 style: TextStyle(
115 color: Colors.grey,
116 fontWeight: FontWeight.w500,
117 fontSize: 16.sp,
118 ),
119 ),
120 ),
121 ),
122 ],
123 ),
124 ),
125 );
126 },
127 );
128}
129
131 required IconData icon,
132 required String title,
133 required Color color,
134 required VoidCallback onTap,
135}) {
136 return InkWell(
137 onTap: onTap,
138 borderRadius: BorderRadius.circular(15.r),
139 child: Container(
140 width: 120.w,
141 padding: EdgeInsets.symmetric(vertical: 15.sp, horizontal: 10.w),
142 decoration: BoxDecoration(
143 color: color.withValues(alpha: 0.1),
144 borderRadius: BorderRadius.circular(15.r),
145 border: Border.all(color: color.withValues(alpha: 0.3)),
146 ),
147 child: Column(
148 mainAxisSize: MainAxisSize.min,
149 children: [
150 Icon(icon, color: color, size: 40.sp),
151 SizedBox(height: 10.h),
152 Text(
153 title,
154 textAlign: TextAlign.center,
155 style: TextStyle(
156 color: color,
157 fontWeight: FontWeight.w500,
158 fontSize: 14.sp,
159 ),
160 ),
161 ],
162 ),
163 ),
164 );
165}
static const lightGreen
static const grey
final VoidCallback onTap
DocumentOption({ required this.icon, required this.title, required this.color, required this.onTap, })
final Widget child
final EdgeInsets padding
class Partner String
final Color color
Definition failures.dart:1
class DocumentOption showDocumentOptions(BuildContext context, List< DocumentOption > options,)
final VoidCallback onTap
Widget _buildDocumentOption({ required IconData icon, required String title, required Color color, required VoidCallback onTap, })
final String title
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
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,),),),],)