Skip to content

Commit 4bfdb62

Browse files
authored
Added AlertDialog.inset_padding property (#1899)
* insetPadding property of AlertDialog * fixed error with nullable padding
1 parent 7ee0885 commit 4bfdb62

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

package/lib/src/controls/alert_dialog.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class _AlertDialogControlState extends State<AlertDialogControl> {
6565
actionsPadding: parseEdgeInsets(widget.control, "actionsPadding"),
6666
actionsAlignment: actionsAlignment,
6767
shape: parseOutlinedBorder(widget.control, "shape"),
68+
insetPadding: parseEdgeInsets(widget.control, "insetPadding") ??
69+
const EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0),
6870
);
6971
}
7072

sdk/python/packages/flet-core/src/flet_core/alert_dialog.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def __init__(
7878
actions_padding: PaddingValue = None,
7979
actions_alignment: MainAxisAlignment = MainAxisAlignment.NONE,
8080
shape: Optional[OutlinedBorder] = None,
81+
inset_padding: PaddingValue = None,
8182
on_dismiss=None,
8283
):
8384

@@ -103,6 +104,7 @@ def __init__(
103104
self.actions_padding = actions_padding
104105
self.actions_alignment = actions_alignment
105106
self.shape = shape
107+
self.inset_padding = inset_padding
106108
self.on_dismiss = on_dismiss
107109

108110
def _get_control_name(self):
@@ -114,6 +116,7 @@ def _before_build_command(self):
114116
self._set_attr_json("contentPadding", self.__content_padding)
115117
self._set_attr_json("titlePadding", self.__title_padding)
116118
self._set_attr_json("shape", self.__shape)
119+
self._set_attr_json("insetPadding", self.__inset_padding)
117120

118121
def _get_children(self):
119122
children = []
@@ -225,6 +228,15 @@ def shape(self) -> Optional[OutlinedBorder]:
225228
def shape(self, value: Optional[OutlinedBorder]):
226229
self.__shape = value
227230

231+
# inset_padding
232+
@property
233+
def inset_padding(self) -> PaddingValue:
234+
return self.__inset_padding
235+
236+
@inset_padding.setter
237+
def inset_padding(self, value: PaddingValue):
238+
self.__inset_padding = value
239+
228240
# on_dismiss
229241
@property
230242
def on_dismiss(self):

0 commit comments

Comments
 (0)