@@ -5,28 +5,24 @@ import 'package:flutter/material.dart';
5
5
import '../generated/l10n/zulip_localizations.dart' ;
6
6
import 'actions.dart' ;
7
7
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
-
22
8
/// A platform-appropriate action for [AlertDialog.adaptive] 's [actions] param.
23
9
Widget _adaptiveAction ({required VoidCallback onPressed, required String text}) {
24
10
switch (defaultTargetPlatform) {
25
11
case TargetPlatform .android:
26
12
case TargetPlatform .fuchsia:
27
13
case TargetPlatform .linux:
28
14
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));
30
26
case TargetPlatform .iOS:
31
27
case TargetPlatform .macOS:
32
28
return CupertinoDialogAction (onPressed: onPressed, child: Text (text));
0 commit comments