@@ -9,28 +9,25 @@ import 'app.dart';
99import 'content.dart' ;
1010import 'store.dart' ;
1111
12- Widget _materialDialogActionText (String text) {
13- return Text (
14- text,
15-
16- // As suggested by
17- // https://api.flutter.dev/flutter/material/AlertDialog/actions.html :
18- // > It is recommended to set the Text.textAlign to TextAlign.end
19- // > for the Text within the TextButton, so that buttons whose
20- // > labels wrap to an extra line align with the overall
21- // > OverflowBar's alignment within the dialog.
22- textAlign: TextAlign .end,
23- );
24- }
25-
2612/// A platform-appropriate action for [AlertDialog.adaptive] 's [actions] param.
2713Widget _adaptiveAction ({required VoidCallback onPressed, required String text}) {
2814 switch (defaultTargetPlatform) {
2915 case TargetPlatform .android:
3016 case TargetPlatform .fuchsia:
3117 case TargetPlatform .linux:
3218 case TargetPlatform .windows:
33- return TextButton (onPressed: onPressed, child: _materialDialogActionText (text));
19+ return TextButton (
20+ onPressed: onPressed,
21+ child: Text (
22+ text,
23+ // As suggested by
24+ // https://api.flutter.dev/flutter/material/AlertDialog/actions.html :
25+ // > It is recommended to set the Text.textAlign to TextAlign.end
26+ // > for the Text within the TextButton, so that buttons whose
27+ // > labels wrap to an extra line align with the overall
28+ // > OverflowBar's alignment within the dialog.
29+ textAlign: TextAlign .end));
30+
3431 case TargetPlatform .iOS:
3532 case TargetPlatform .macOS:
3633 return CupertinoDialogAction (onPressed: onPressed, child: Text (text));
0 commit comments