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