1
1
import 'dart:convert' ;
2
2
import 'dart:ui' ;
3
3
4
+ import 'package:fluffychat/pages/key_verification/key_verification_styles.dart' ;
4
5
import 'package:fluffychat/utils/dialog/twake_dialog.dart' ;
5
6
import 'package:fluffychat/widgets/avatar/avatar_style.dart' ;
7
+ import 'package:fluffychat/widgets/twake_components/twake_text_button.dart' ;
6
8
import 'package:flutter/material.dart' ;
7
9
import 'package:flutter/services.dart' ;
8
10
9
11
import 'package:adaptive_dialog/adaptive_dialog.dart' ;
10
12
import 'package:flutter_gen/gen_l10n/l10n.dart' ;
13
+ import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart' ;
11
14
12
15
import 'package:matrix/encryption.dart' ;
13
16
import 'package:matrix/matrix.dart' ;
@@ -149,19 +152,37 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
149
152
),
150
153
);
151
154
buttons.add (
152
- TextButton (
153
- child: Text (
154
- L10n .of (context)! .submit,
155
+ TwakeTextButton (
156
+ onTap: () => checkInput (textEditingController.text),
157
+ message: L10n .of (context)! .submit,
158
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
159
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
160
+ color: Theme .of (context).colorScheme.primary,
161
+ ),
162
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
163
+ buttonDecoration: BoxDecoration (
164
+ color: LinagoraSysColors .material ().onPrimary,
165
+ borderRadius: const BorderRadius .all (
166
+ Radius .circular (100 ),
167
+ ),
155
168
),
156
- onPressed: () => checkInput (textEditingController.text),
157
169
),
158
170
);
159
171
buttons.add (
160
- TextButton (
161
- child: Text (
162
- L10n .of (context)! .skip,
172
+ TwakeTextButton (
173
+ onTap: () => widget.request.openSSSS (skip: true ),
174
+ message: L10n .of (context)! .skip,
175
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
176
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
177
+ color: Theme .of (context).colorScheme.primary,
178
+ ),
179
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
180
+ buttonDecoration: BoxDecoration (
181
+ color: LinagoraSysColors .material ().onPrimary,
182
+ borderRadius: const BorderRadius .all (
183
+ Radius .circular (100 ),
184
+ ),
163
185
),
164
- onPressed: () => widget.request.openSSSS (skip: true ),
165
186
),
166
187
);
167
188
break ;
@@ -183,20 +204,37 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
183
204
],
184
205
);
185
206
buttons.add (
186
- TextButton .icon (
187
- icon: const Icon (Icons .close),
188
- style: TextButton .styleFrom (foregroundColor: Colors .red),
189
- label: Text (L10n .of (context)! .reject),
190
- onPressed: () => widget.request
207
+ TwakeTextButton (
208
+ onTap: () => widget.request
191
209
.rejectVerification ()
192
- .then ((_) => Navigator .of (context, rootNavigator: false ).pop ()),
210
+ .then ((_) => Navigator .maybePop (context)),
211
+ message: L10n .of (context)! .reject,
212
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
213
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
214
+ color: Theme .of (context).colorScheme.primary,
215
+ ),
216
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
217
+ buttonDecoration: BoxDecoration (
218
+ color: LinagoraSysColors .material ().onPrimary,
219
+ borderRadius: const BorderRadius .all (
220
+ Radius .circular (100 ),
221
+ ),
222
+ ),
193
223
),
194
224
);
195
225
buttons.add (
196
- TextButton .icon (
197
- icon: const Icon (Icons .check),
198
- label: Text (L10n .of (context)! .accept),
199
- onPressed: () => widget.request.acceptVerification (),
226
+ TwakeTextButton (
227
+ onTap: () => widget.request.acceptVerification (),
228
+ message: L10n .of (context)! .accept,
229
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
230
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
231
+ color: LinagoraSysColors .material ().onPrimary,
232
+ ),
233
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
234
+ buttonDecoration: BoxDecoration (
235
+ color: Theme .of (context).colorScheme.primary,
236
+ borderRadius: BorderRadius .circular (100 ),
237
+ ),
200
238
),
201
239
);
202
240
break ;
@@ -262,20 +300,41 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
262
300
],
263
301
);
264
302
buttons.add (
265
- TextButton .icon (
266
- icon: const Icon (Icons .close),
267
- style: TextButton .styleFrom (
268
- foregroundColor: Colors .red,
303
+ TwakeTextButton (
304
+ onTap: () => widget.request.rejectSas (),
305
+ message: L10n .of (context)! .theyDontMatch,
306
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
307
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
308
+ color: Theme .of (context).colorScheme.primary,
309
+ ),
310
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
311
+ buttonDecoration: BoxDecoration (
312
+ color: LinagoraSysColors .material ().onPrimary,
313
+ borderRadius: const BorderRadius .all (
314
+ Radius .circular (100 ),
315
+ ),
316
+ ),
317
+ constraints: BoxConstraints (
318
+ maxWidth: KeyVerificationStyles .maxWidthMatchButton (context),
269
319
),
270
- label: Text (L10n .of (context)! .theyDontMatch),
271
- onPressed: () => widget.request.rejectSas (),
272
320
),
273
321
);
274
322
buttons.add (
275
- TextButton .icon (
276
- icon: const Icon (Icons .check_outlined),
277
- label: Text (L10n .of (context)! .theyMatch),
278
- onPressed: () => widget.request.acceptSas (),
323
+ TwakeTextButton (
324
+ onTap: () => widget.request.acceptSas (),
325
+ message: L10n .of (context)! .theyMatch,
326
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
327
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
328
+ color: LinagoraSysColors .material ().onPrimary,
329
+ ),
330
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
331
+ buttonDecoration: BoxDecoration (
332
+ color: Theme .of (context).colorScheme.primary,
333
+ borderRadius: BorderRadius .circular (100 ),
334
+ ),
335
+ constraints: BoxConstraints (
336
+ maxWidth: KeyVerificationStyles .maxWidthMatchButton (context),
337
+ ),
279
338
),
280
339
);
281
340
break ;
@@ -312,11 +371,20 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
312
371
],
313
372
);
314
373
buttons.add (
315
- TextButton (
316
- child: Text (
317
- L10n .of (context)! .close,
374
+ TwakeTextButton (
375
+ onTap: () => Navigator .maybePop (context),
376
+ message: L10n .of (context)! .close,
377
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
378
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
379
+ color: Theme .of (context).colorScheme.primary,
380
+ ),
381
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
382
+ buttonDecoration: BoxDecoration (
383
+ color: LinagoraSysColors .material ().onPrimary,
384
+ borderRadius: const BorderRadius .all (
385
+ Radius .circular (100 ),
386
+ ),
318
387
),
319
- onPressed: () => Navigator .of (context, rootNavigator: false ).pop (),
320
388
),
321
389
);
322
390
break ;
@@ -333,11 +401,20 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
333
401
],
334
402
);
335
403
buttons.add (
336
- TextButton (
337
- child: Text (
338
- L10n .of (context)! .close,
404
+ TwakeTextButton (
405
+ onTap: () => Navigator .maybePop (context),
406
+ message: L10n .of (context)! .close,
407
+ borderHover: KeyVerificationStyles .borderHoverButtonWaningBanner,
408
+ styleMessage: Theme .of (context).textTheme.labelLarge? .copyWith (
409
+ color: Theme .of (context).colorScheme.primary,
410
+ ),
411
+ margin: KeyVerificationStyles .marginButtonWarningBanner,
412
+ buttonDecoration: BoxDecoration (
413
+ color: LinagoraSysColors .material ().onPrimary,
414
+ borderRadius: const BorderRadius .all (
415
+ Radius .circular (100 ),
416
+ ),
339
417
),
340
- onPressed: () => Navigator .of (context, rootNavigator: false ).pop (),
341
418
),
342
419
);
343
420
break ;
0 commit comments