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