@@ -334,6 +334,7 @@ class DatePickerDialog extends StatefulWidget {
334334 this .onDatePickerModeChange,
335335 this .switchToInputEntryModeIcon,
336336 this .switchToCalendarEntryModeIcon,
337+ this .insetPadding = const EdgeInsets .symmetric (horizontal: 16.0 , vertical: 24.0 ),
337338 }) : initialDate = initialDate == null ? null : DateUtils .dateOnly (initialDate),
338339 firstDate = DateUtils .dateOnly (firstDate),
339340 lastDate = DateUtils .dateOnly (lastDate),
@@ -436,7 +437,6 @@ class DatePickerDialog extends StatefulWidget {
436437 /// Flutter.
437438 final String ? restorationId;
438439
439-
440440 /// Called when the [DatePickerDialog] is toggled between
441441 /// [DatePickerEntryMode.calendar] ,[DatePickerEntryMode.input] .
442442 ///
@@ -451,6 +451,13 @@ class DatePickerDialog extends StatefulWidget {
451451 /// {@macro flutter.material.date_picker.switchToCalendarEntryModeIcon}
452452 final Icon ? switchToCalendarEntryModeIcon;
453453
454+ /// The amount of padding added to [MediaQueryData.viewInsets] on the outside
455+ /// of the dialog. This defines the minimum space between the screen's edges
456+ /// and the dialog.
457+ ///
458+ /// Defaults to `EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0)` .
459+ final EdgeInsets insetPadding;
460+
454461 @override
455462 State <DatePickerDialog > createState () => _DatePickerDialogState ();
456463}
@@ -520,9 +527,7 @@ class _DatePickerDialogState extends State<DatePickerDialog> with RestorationMix
520527 }
521528
522529 void _handleDateChanged (DateTime date) {
523- setState (() {
524- _selectedDate.value = date;
525- });
530+ setState (() => _selectedDate.value = date);
526531 }
527532
528533 Size _dialogSize (BuildContext context) {
@@ -725,7 +730,7 @@ class _DatePickerDialogState extends State<DatePickerDialog> with RestorationMix
725730 shape: useMaterial3
726731 ? datePickerTheme.shape ?? defaults.shape
727732 : datePickerTheme.shape ?? dialogTheme.shape ?? defaults.shape,
728- insetPadding: const EdgeInsets . symmetric (horizontal : 16.0 , vertical : 24.0 ) ,
733+ insetPadding: widget.insetPadding ,
729734 clipBehavior: Clip .antiAlias,
730735 child: AnimatedContainer (
731736 width: dialogSize.width,
0 commit comments