@@ -5,28 +5,24 @@ import 'package:flutter/material.dart';
55import '../generated/l10n/zulip_localizations.dart' ;
66import 'actions.dart' ;
77
8- Widget _materialDialogActionText (String text) {
9- return Text (
10- text,
11-
12- // As suggested by
13- // https://api.flutter.dev/flutter/material/AlertDialog/actions.html :
14- // > It is recommended to set the Text.textAlign to TextAlign.end
15- // > for the Text within the TextButton, so that buttons whose
16- // > labels wrap to an extra line align with the overall
17- // > OverflowBar's alignment within the dialog.
18- textAlign: TextAlign .end,
19- );
20- }
21-
228/// A platform-appropriate action for [AlertDialog.adaptive] 's [actions] param.
239Widget _adaptiveAction ({required VoidCallback onPressed, required String text}) {
2410 switch (defaultTargetPlatform) {
2511 case TargetPlatform .android:
2612 case TargetPlatform .fuchsia:
2713 case TargetPlatform .linux:
2814 case TargetPlatform .windows:
29- return TextButton (onPressed: onPressed, child: _materialDialogActionText (text));
15+ return TextButton (
16+ onPressed: onPressed,
17+ child: Text (
18+ text,
19+ // As suggested by
20+ // https://api.flutter.dev/flutter/material/AlertDialog/actions.html :
21+ // > It is recommended to set the Text.textAlign to TextAlign.end
22+ // > for the Text within the TextButton, so that buttons whose
23+ // > labels wrap to an extra line align with the overall
24+ // > OverflowBar's alignment within the dialog.
25+ textAlign: TextAlign .end));
3026 case TargetPlatform .iOS:
3127 case TargetPlatform .macOS:
3228 return CupertinoDialogAction (onPressed: onPressed, child: Text (text));
0 commit comments