Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
documents_screen.dart
Go to the documentation of this file.
1import 'package:fluentui_system_icons/fluentui_system_icons.dart';
2import 'package:flutter/material.dart';
3
4import '../../core/ui/theme/color_palette.dart';
5import '../../core/ui/widgets/custom_scaffold.dart';
6import 'pdf_opener.dart';
7
8class DocumentsScreen extends StatefulWidget {
9 const DocumentsScreen({super.key});
10
11 @override
12 State<DocumentsScreen> createState() => _DocumentsScreenState();
13}
14
15class _DocumentsScreenState extends State<DocumentsScreen>
16 with SingleTickerProviderStateMixin {
17 final List<DocumentItem> documents = [
19 title: 'Driver personal id',
20 icon: FluentIcons.person_info_16_regular,
21 color: Colors.green.shade400,
22 subtitle: 'Valid until Dec 2025',
23 // documentPath: "assets/mock/pdfs/id.pdf",
24 ),
26 title: 'Driver license',
27 icon: FluentIcons.card_ui_20_regular,
28 color: Colors.teal.shade400,
29 subtitle: 'Valid until Nov 2025',
30 // documentPath: "assets/mock/pdfs/license.pdf",
31 ),
33 title: 'Naql waybill',
34 icon: FluentIcons.vehicle_car_16_regular,
35 color: Colors.blue.shade400,
36 subtitle: 'Expires Jan 2025',
37 // documentPath: "assets/mock/pdfs/waybill.pdf",
38 ),
40 title: 'Company authorization letter',
41 icon: FluentIcons.text_description_16_regular,
42 color: Colors.indigo.shade400,
43 subtitle: 'Contract #A-12345',
44 ),
46 title: 'Training certification',
47 icon: FluentIcons.certificate_16_regular,
48 color: Colors.indigo.shade400,
49 subtitle: 'Contract #A-12345',
50 ),
51 ];
52
53 @override
54 Widget build(BuildContext context) {
55 return CustomScaffold(
56 title: "",
57 backgroundColor: ColorPalette.antiFlashWhite,
58 body: SingleChildScrollView(
60 children: [_buildHeader(), _buildDocumentsView()],
61 ),
62 ),
63 );
64 }
65
66 Widget _buildHeader() {
67 return Padding(
68 padding: const EdgeInsets.all(20),
70 crossAxisAlignment: CrossAxisAlignment.start,
71 children: [
72 Row(
73 children: [
74 Column(
75 crossAxisAlignment: CrossAxisAlignment.start,
76 children: [
77 const Text(
78 'Documents',
79 style: TextStyle(
80 fontSize: 28,
81 fontWeight: FontWeight.bold,
82 color: Colors.black,
83 ),
84 ),
85 const SizedBox(height: 8),
86 Container(
87 padding:
88 const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
89 decoration: BoxDecoration(
90 color: Colors.white,
91 borderRadius: BorderRadius.circular(20),
92 ),
93 child: const Row(
94 children: [
95 Icon(Icons.check_circle,
96 color: Colors.greenAccent, size: 16),
97 SizedBox(width: 4),
98 Text(
99 'All documents up to date',
100 style: TextStyle(color: Colors.black, fontSize: 12),
101 ),
102 ],
103 ),
104 ),
105 ],
106 ),
107 ],
108 ),
109 ],
110 ),
111 );
112 }
113
115 return Column(children: [
116 for (int index = 0; index < documents.length; index++)
118 ]);
119 }
120
122 return Container(
123 margin: const EdgeInsets.only(
124 bottom: 16,
125 left: 20,
126 right: 20,
127 ),
128 decoration: BoxDecoration(
129 color: Colors.white,
130 borderRadius: BorderRadius.circular(20),
131 boxShadow: [
132 BoxShadow(
133 color: Colors.black.withValues(alpha: 0.1),
134 blurRadius: 20,
135 offset: const Offset(0, 10),
136 ),
137 ],
138 ),
139 child: ClipRRect(
140 borderRadius: BorderRadius.circular(20),
141 child: Material(
142 color: Colors.transparent,
143 child: InkWell(
144 onTap: () async {
145 if (document.documentPath != null) {
146 await PDFOpener.openPDFAsset(document.documentPath!);
147 }
148 },
149 child: Padding(
150 padding: const EdgeInsets.all(20),
151 child: Row(
152 children: [
153 Container(
154 padding: const EdgeInsets.all(12),
155 decoration: BoxDecoration(
156 color: document.color.withValues(alpha: 0.1),
157 borderRadius: BorderRadius.circular(16),
158 ),
159 child: Icon(document.icon, color: document.color, size: 28),
160 ),
161 const SizedBox(width: 16),
162 Expanded(
163 child: Column(
164 crossAxisAlignment: CrossAxisAlignment.start,
165 children: [
166 Text(
167 document.title,
168 style: const TextStyle(
169 fontSize: 18,
170 fontWeight: FontWeight.bold,
171 ),
172 ),
173 const SizedBox(height: 4),
174 Text(
175 document.subtitle,
176 style: TextStyle(
177 color: Colors.grey.shade600,
178 fontSize: 14,
179 ),
180 ),
181 ],
182 ),
183 ),
184 Container(
185 padding: const EdgeInsets.all(8),
186 decoration: BoxDecoration(
187 color: document.color.withValues(alpha: 0.1),
188 borderRadius: BorderRadius.circular(12),
189 ),
190 child: Icon(
191 Icons.download_rounded,
192 color: document.color,
193 ),
194 ),
195 ],
196 ),
197 ),
198 ),
199 ),
200 ),
201 );
202 }
203}
204
207 final IconData icon;
208 final Color color;
211
213 required this.title,
214 required this.icon,
215 required this.color,
216 required this.subtitle,
217 this.documentPath,
218 });
219}
class App extends StatefulWidget build(BuildContext context)
Definition app.dart:31
static const antiFlashWhite
final String documentPath
final IconData icon
DocumentItem({ required this.title, required this.icon, required this.color, required this.subtitle, this.documentPath, })
final String subtitle
static Future< void > openPDFAsset(String assetPath) async
const DocumentsScreen({super.key})
override State< DocumentsScreen > createState()
final Widget child
final EdgeInsets padding
final String subtitle
class Partner String
Widget _buildDocumentCard(DocumentItem document)
Widget _buildHeader()
Widget _buildDocumentsView()
class DocumentsScreen extends StatefulWidget documents
final Color color
Definition failures.dart:1
final 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,),),),],)