|
1 | 1 | import 'package:flutter/material.dart'; |
2 | 2 | import 'package:share_plus/share_plus.dart'; |
3 | 3 | import '../../services/pdf_tools_service.dart'; |
| 4 | +import '../../widgets/pdf_file_header.dart'; |
4 | 5 | import '../../widgets/pdf_picker_screen.dart'; |
5 | 6 |
|
6 | 7 | class DecryptScreen extends StatefulWidget { |
@@ -145,43 +146,12 @@ class _DecryptScreenState extends State<DecryptScreen> { |
145 | 146 | // Fichier |
146 | 147 | Text('Fichier PDF', style: Theme.of(context).textTheme.titleSmall), |
147 | 148 | const SizedBox(height: 8), |
148 | | - _path == null |
149 | | - ? SizedBox( |
150 | | - width: double.infinity, |
151 | | - child: OutlinedButton.icon( |
152 | | - onPressed: _pickFile, |
153 | | - icon: const Icon(Icons.folder_open), |
154 | | - label: const Text('Choisir un PDF'), |
155 | | - style: OutlinedButton.styleFrom( |
156 | | - minimumSize: const Size(0, 48), |
157 | | - ), |
158 | | - ), |
159 | | - ) |
160 | | - : ListTile( |
161 | | - contentPadding: EdgeInsets.zero, |
162 | | - leading: Container( |
163 | | - width: 40, |
164 | | - height: 40, |
165 | | - decoration: BoxDecoration( |
166 | | - color: Colors.red.withValues(alpha: 0.1), |
167 | | - borderRadius: BorderRadius.circular(8), |
168 | | - ), |
169 | | - child: const Icon( |
170 | | - Icons.picture_as_pdf, |
171 | | - color: Colors.red, |
172 | | - size: 22, |
173 | | - ), |
174 | | - ), |
175 | | - title: Text( |
176 | | - _name!, |
177 | | - overflow: TextOverflow.ellipsis, |
178 | | - style: const TextStyle(fontSize: 13), |
179 | | - ), |
180 | | - trailing: TextButton( |
181 | | - onPressed: _pickFile, |
182 | | - child: const Text('Changer'), |
183 | | - ), |
184 | | - ), |
| 149 | + PdfFilePickerCard( |
| 150 | + fileName: _name, |
| 151 | + onPick: _pickFile, |
| 152 | + pickLabel: _path == null ? 'Choisir' : 'Changer', |
| 153 | + emptyLabel: 'Choisir un PDF', |
| 154 | + ), |
185 | 155 | const SizedBox(height: 24), |
186 | 156 |
|
187 | 157 | // Mot de passe |
|
0 commit comments