@@ -29,7 +29,9 @@ class DialogHelper {
2929 content: Text (query),
3030 actions: [
3131 CupertinoDialogAction (
32- child: cancelActionText != null ? Text (cancelActionText) : Icon (CupertinoIcons .clear),
32+ child: cancelActionText != null
33+ ? Text (cancelActionText)
34+ : Icon (CupertinoIcons .clear),
3335 onPressed: () => Navigator .of (context).pop (false ),
3436 ),
3537 CupertinoDialogAction (
@@ -49,9 +51,10 @@ class DialogHelper {
4951 actionButtonStyle = TextButton .styleFrom (
5052 backgroundColor: Colors .red,
5153 disabledForegroundColor: Colors .white,
52- onSurface : Colors .white,
54+ foregroundColor : Colors .white,
5355 );
54- actionTextStyle = theme.textTheme.button! .copyWith (color: Colors .white);
56+ actionTextStyle =
57+ theme.textTheme.labelLarge? .copyWith (color: Colors .white);
5558 }
5659
5760 return showDialog <bool >(
@@ -60,7 +63,9 @@ class DialogHelper {
6063 content: Text (query),
6164 actions: [
6265 TextButton (
63- child: cancelActionText != null ? PlatformText (cancelActionText) : Icon (Icons .cancel),
66+ child: cancelActionText != null
67+ ? PlatformText (cancelActionText)
68+ : Icon (Icons .cancel),
6469 onPressed: () => Navigator .of (context).pop (false ),
6570 ),
6671 TextButton (
@@ -87,7 +92,10 @@ class DialogHelper {
8792 String ? cancelActionText,
8893 }) {
8994 return showWidgetDialog (context, Text (text),
90- title: title, actions: actions, okActionText: okActionText, cancelActionText: cancelActionText);
95+ title: title,
96+ actions: actions,
97+ okActionText: okActionText,
98+ cancelActionText: cancelActionText);
9199 }
92100
93101 /// Shows a dialog with the given [content] .
@@ -106,15 +114,21 @@ class DialogHelper {
106114 String ? cancelActionText,
107115 }) {
108116 actions ?? = [
109- if (defaultActions == DialogActions .cancel || defaultActions == DialogActions .okAndCancel) ...{
117+ if (defaultActions == DialogActions .cancel ||
118+ defaultActions == DialogActions .okAndCancel) ...{
110119 PlatformTextButton (
111- child: cancelActionText != null ? PlatformText (cancelActionText) : Icon (CommonPlatformIcons .cancel),
120+ child: cancelActionText != null
121+ ? PlatformText (cancelActionText)
122+ : Icon (CommonPlatformIcons .cancel),
112123 onPressed: () => Navigator .of (context).pop (false ),
113124 ),
114125 },
115- if (defaultActions == DialogActions .ok || defaultActions == DialogActions .okAndCancel) ...{
126+ if (defaultActions == DialogActions .ok ||
127+ defaultActions == DialogActions .okAndCancel) ...{
116128 PlatformTextButton (
117- child: okActionText != null ? PlatformText (okActionText) : Icon (CommonPlatformIcons .ok),
129+ child: okActionText != null
130+ ? PlatformText (okActionText)
131+ : Icon (CommonPlatformIcons .ok),
118132 onPressed: () => Navigator .of (context).pop (true ),
119133 ),
120134 },
0 commit comments