@@ -321,13 +321,28 @@ class UpgradeAlertState extends State<UpgradeAlert> {
321
321
)));
322
322
final actions = < Widget > [
323
323
if (showIgnore)
324
- button (cupertino, messages.message (UpgraderMessage .buttonTitleIgnore),
325
- context, () => onUserIgnored (context, true )),
324
+ button (
325
+ cupertino: cupertino,
326
+ text: messages.message (UpgraderMessage .buttonTitleIgnore),
327
+ context: context,
328
+ onPressed: () => onUserIgnored (context, true ),
329
+ isDefaultAction: false ,
330
+ ),
326
331
if (showLater)
327
- button (cupertino, messages.message (UpgraderMessage .buttonTitleLater),
328
- context, () => onUserLater (context, true )),
329
- button (cupertino, messages.message (UpgraderMessage .buttonTitleUpdate),
330
- context, () => onUserUpdated (context, ! widget.upgrader.blocked ())),
332
+ button (
333
+ cupertino: cupertino,
334
+ text: messages.message (UpgraderMessage .buttonTitleLater),
335
+ context: context,
336
+ onPressed: () => onUserLater (context, true ),
337
+ isDefaultAction: false ,
338
+ ),
339
+ button (
340
+ cupertino: cupertino,
341
+ text: messages.message (UpgraderMessage .buttonTitleUpdate),
342
+ context: context,
343
+ onPressed: () => onUserUpdated (context, ! widget.upgrader.blocked ()),
344
+ isDefaultAction: true ,
345
+ ),
331
346
];
332
347
333
348
return cupertino
@@ -337,12 +352,18 @@ class UpgradeAlertState extends State<UpgradeAlert> {
337
352
key: key, title: textTitle, content: content, actions: actions);
338
353
}
339
354
340
- Widget button (bool cupertino, String ? text, BuildContext context,
341
- VoidCallback ? onPressed) {
355
+ Widget button ({
356
+ required bool cupertino,
357
+ String ? text,
358
+ required BuildContext context,
359
+ VoidCallback ? onPressed,
360
+ bool isDefaultAction = false ,
361
+ }) {
342
362
return cupertino
343
363
? CupertinoDialogAction (
344
364
textStyle: widget.cupertinoButtonTextStyle,
345
365
onPressed: onPressed,
366
+ isDefaultAction: isDefaultAction,
346
367
child: Text (text ?? '' ))
347
368
: TextButton (onPressed: onPressed, child: Text (text ?? '' ));
348
369
}
0 commit comments