@@ -9,28 +9,25 @@ import 'app.dart';
9
9
import 'content.dart' ;
10
10
import 'store.dart' ;
11
11
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
-
26
12
/// A platform-appropriate action for [AlertDialog.adaptive] 's [actions] param.
27
13
Widget _adaptiveAction ({required VoidCallback onPressed, required String text}) {
28
14
switch (defaultTargetPlatform) {
29
15
case TargetPlatform .android:
30
16
case TargetPlatform .fuchsia:
31
17
case TargetPlatform .linux:
32
18
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
+
34
31
case TargetPlatform .iOS:
35
32
case TargetPlatform .macOS:
36
33
return CupertinoDialogAction (onPressed: onPressed, child: Text (text));
0 commit comments