@@ -195,72 +195,68 @@ class ScanDialog extends HookConsumerWidget {
195
195
),
196
196
),
197
197
const SizedBox (height: 30 ),
198
- Padding (
199
- padding: const EdgeInsets .symmetric (horizontal: 20 ),
200
- child: Row (
201
- children: [
202
- GestureDetector (
203
- onTap: () {
204
- scannerNotifier.reset ();
205
- },
206
- child: const SizedBox (
207
- width: 100 ,
208
- child: AddEditButtonLayout (
209
- color: Colors .red,
210
- child: Text (
211
- "Annuler" ,
212
- style: TextStyle (
213
- color: Colors .white,
214
- fontWeight: FontWeight .bold,
215
- fontSize: 20 ,
198
+ if (data.qrCodeSecret != "" )
199
+ Padding (
200
+ padding: const EdgeInsets .symmetric (
201
+ horizontal: 20 ,
202
+ ),
203
+ child: Row (
204
+ children: [
205
+ GestureDetector (
206
+ onTap: () {
207
+ scannerNotifier.reset ();
208
+ },
209
+ child: const SizedBox (
210
+ width: 100 ,
211
+ child: AddEditButtonLayout (
212
+ color: Colors .red,
213
+ child: Text (
214
+ "Annuler" ,
215
+ style: TextStyle (
216
+ color: Colors .white,
217
+ fontWeight: FontWeight .bold,
218
+ fontSize: 20 ,
219
+ ),
216
220
),
217
221
),
218
222
),
219
223
),
220
- ),
221
- const Spacer (),
222
- GestureDetector (
223
- onTap: () async {
224
- await tokenExpireWrapper (ref, () async {
225
- final value = await ticketListNotifier
226
- .consumeTicket (
227
- sellerId,
228
- data,
229
- ticket.id,
230
- tag,
224
+ const Spacer (),
225
+ GestureDetector (
226
+ onTap: () async {
227
+ await tokenExpireWrapper (ref, () async {
228
+ await (ticketListNotifier.consumeTicket (
229
+ sellerId,
230
+ data,
231
+ ticket.id,
232
+ tag == "" ? "no tag" : tag,
233
+ )).then ((_) {
234
+ displayToastWithContext (
235
+ TypeMsg .msg,
236
+ "Scan validé" ,
231
237
);
232
- if (value) {
233
- displayToastWithContext (
234
- TypeMsg .msg,
235
- "Scan validé" ,
236
- );
237
- scannerNotifier.reset ();
238
- } else {
239
- displayToastWithContext (
240
- TypeMsg .error,
241
- "Erreur lors de la validation" ,
242
- );
243
- }
244
- });
245
- },
246
- child: const SizedBox (
247
- width: 100 ,
248
- child: AddEditButtonLayout (
249
- color: Colors .green,
250
- child: Text (
251
- "Valider" ,
252
- style: TextStyle (
253
- color: Colors .white,
254
- fontWeight: FontWeight .bold,
255
- fontSize: 20 ,
238
+ scannerNotifier.reset ();
239
+ });
240
+ });
241
+ },
242
+ child: const SizedBox (
243
+ width: 100 ,
244
+ child: AddEditButtonLayout (
245
+ color: Colors .green,
246
+ child: Text (
247
+ "Suivant" ,
248
+ style: TextStyle (
249
+ color: Colors .white,
250
+ fontWeight: FontWeight .bold,
251
+ fontSize: 20 ,
252
+ ),
256
253
),
257
254
),
258
255
),
259
256
),
260
- ) ,
261
- ] ,
257
+ ] ,
258
+ ) ,
262
259
),
263
- ),
264
260
],
265
261
);
266
262
},
0 commit comments