@@ -11,7 +11,8 @@ part 'confirm_action.g.dart';
1111///
1212/// By default the dialog is built by the runtime and takes the app's look:
1313/// its font, primary color and surface come from the layout that shows it.
14- /// The optional color and radius fields override that look.
14+ /// The optional color, radius, border, shadow and text style fields
15+ /// override that look.
1516///
1617/// With a [dialogId] the dialog is that canvas instead, like
1718/// [ShowDialogAction] . A button in it answers the dialog with a "Navigate
@@ -74,6 +75,44 @@ class ConfirmAction extends ActionModel with Equatable, SerializableMixin {
7475 /// Corner radius of the built-in dialog. Null follows the app's buttons.
7576 final double ? cornerRadius;
7677
78+ /// Outline of the built-in dialog. Null draws none.
79+ final BorderSideModel ? border;
80+
81+ /// Drop shadows of the built-in dialog, e.g. a hard offset shadow (radius
82+ /// 0). Null keeps the default elevation shadow; an empty list draws none.
83+ final List <Effect >? shadows;
84+
85+ /// Font, size and color of the title. Unset values follow the app.
86+ final TextStyleModel ? titleStyle;
87+
88+ /// Font, size and color of the message. Unset values follow the app.
89+ final TextStyleModel ? messageStyle;
90+
91+ /// Font, size and color of both buttons' labels. Unset values follow the
92+ /// app; the label colors come from [confirmTextColor] and
93+ /// [cancelTextColor] when this sets none.
94+ final TextStyleModel ? buttonStyle;
95+
96+ /// Corner radius of the buttons. Null follows the app's buttons.
97+ final double ? buttonRadius;
98+
99+ /// Outline of both buttons. Null draws none.
100+ final BorderSideModel ? buttonBorder;
101+
102+ /// Drop shadows of the confirm button, and of the cancel button when it
103+ /// has a [cancelColor] . Null draws none.
104+ final List <Effect >? buttonShadows;
105+
106+ /// Label color of the confirm button. Null picks one that reads on its
107+ /// fill.
108+ final ColorRGBA ? confirmTextColor;
109+
110+ /// Fill of the cancel button. Null leaves it a text button.
111+ final ColorRGBA ? cancelColor;
112+
113+ /// Label color of the cancel button. Null uses the dialog's text color.
114+ final ColorRGBA ? cancelTextColor;
115+
77116 /// How the dialog is presented: centered, as a bottom sheet or as a side
78117 /// sheet. See [ShowDialogAction.presentation] .
79118 @JsonKey (unknownEnumValue: DialogPresentation .dialog)
@@ -127,6 +166,17 @@ class ConfirmAction extends ActionModel with Equatable, SerializableMixin {
127166 this .textColor,
128167 this .confirmColor,
129168 this .cornerRadius,
169+ this .border,
170+ this .shadows,
171+ this .titleStyle,
172+ this .messageStyle,
173+ this .buttonStyle,
174+ this .buttonRadius,
175+ this .buttonBorder,
176+ this .buttonShadows,
177+ this .confirmTextColor,
178+ this .cancelColor,
179+ this .cancelTextColor,
130180 this .presentation = DialogPresentation .dialog,
131181 this .sheetWidth,
132182 this .maxHeightFactor = 1 ,
@@ -161,6 +211,28 @@ class ConfirmAction extends ActionModel with Equatable, SerializableMixin {
161211 bool clearConfirmColor = false ,
162212 double ? cornerRadius,
163213 bool clearCornerRadius = false ,
214+ BorderSideModel ? border,
215+ bool clearBorder = false ,
216+ List <Effect >? shadows,
217+ bool clearShadows = false ,
218+ TextStyleModel ? titleStyle,
219+ bool clearTitleStyle = false ,
220+ TextStyleModel ? messageStyle,
221+ bool clearMessageStyle = false ,
222+ TextStyleModel ? buttonStyle,
223+ bool clearButtonStyle = false ,
224+ double ? buttonRadius,
225+ bool clearButtonRadius = false ,
226+ BorderSideModel ? buttonBorder,
227+ bool clearButtonBorder = false ,
228+ List <Effect >? buttonShadows,
229+ bool clearButtonShadows = false ,
230+ ColorRGBA ? confirmTextColor,
231+ bool clearConfirmTextColor = false ,
232+ ColorRGBA ? cancelColor,
233+ bool clearCancelColor = false ,
234+ ColorRGBA ? cancelTextColor,
235+ bool clearCancelTextColor = false ,
164236 DialogPresentation ? presentation,
165237 double ? sheetWidth,
166238 bool clearSheetWidth = false ,
@@ -184,6 +256,23 @@ class ConfirmAction extends ActionModel with Equatable, SerializableMixin {
184256 textColor: clearTextColor ? null : textColor ?? this .textColor,
185257 confirmColor: clearConfirmColor ? null : confirmColor ?? this .confirmColor,
186258 cornerRadius: clearCornerRadius ? null : cornerRadius ?? this .cornerRadius,
259+ border: clearBorder ? null : border ?? this .border,
260+ shadows: clearShadows ? null : shadows ?? this .shadows,
261+ titleStyle: clearTitleStyle ? null : titleStyle ?? this .titleStyle,
262+ messageStyle: clearMessageStyle ? null : messageStyle ?? this .messageStyle,
263+ buttonStyle: clearButtonStyle ? null : buttonStyle ?? this .buttonStyle,
264+ buttonRadius: clearButtonRadius ? null : buttonRadius ?? this .buttonRadius,
265+ buttonBorder: clearButtonBorder ? null : buttonBorder ?? this .buttonBorder,
266+ buttonShadows: clearButtonShadows
267+ ? null
268+ : buttonShadows ?? this .buttonShadows,
269+ confirmTextColor: clearConfirmTextColor
270+ ? null
271+ : confirmTextColor ?? this .confirmTextColor,
272+ cancelColor: clearCancelColor ? null : cancelColor ?? this .cancelColor,
273+ cancelTextColor: clearCancelTextColor
274+ ? null
275+ : cancelTextColor ?? this .cancelTextColor,
187276 presentation: presentation ?? this .presentation,
188277 sheetWidth: clearSheetWidth ? null : sheetWidth ?? this .sheetWidth,
189278 maxHeightFactor: maxHeightFactor ?? this .maxHeightFactor,
@@ -209,6 +298,17 @@ class ConfirmAction extends ActionModel with Equatable, SerializableMixin {
209298 textColor,
210299 confirmColor,
211300 cornerRadius,
301+ border,
302+ shadows,
303+ titleStyle,
304+ messageStyle,
305+ buttonStyle,
306+ buttonRadius,
307+ buttonBorder,
308+ buttonShadows,
309+ confirmTextColor,
310+ cancelColor,
311+ cancelTextColor,
212312 presentation,
213313 sheetWidth,
214314 maxHeightFactor,
0 commit comments