showCalendarDatePicker2Dialog function
Future<List<DateTime?> ?>
showCalendarDatePicker2Dialog({
- required BuildContext context,
- required CalendarDatePicker2WithActionButtonsConfig config,
- required Size dialogSize,
- List<
DateTime?> value = const [], - BorderRadius? borderRadius,
- bool barrierDismissible = true,
- Color? barrierColor = Colors.black54,
- bool useSafeArea = true,
- Color? dialogBackgroundColor,
- RouteSettings? routeSettings,
- String? barrierLabel,
- TransitionBuilder? builder,
Implementation
Future<List<DateTime?>?> showCalendarDatePicker2Dialog({
required BuildContext context,
required CalendarDatePicker2WithActionButtonsConfig config,
required Size dialogSize,
List<DateTime?> value = const [],
BorderRadius? borderRadius,
bool useRootNavigator = true,
bool barrierDismissible = true,
Color? barrierColor = Colors.black54,
bool useSafeArea = true,
Color? dialogBackgroundColor,
RouteSettings? routeSettings,
String? barrierLabel,
TransitionBuilder? builder,
}) {
var dialog = Dialog(
insetPadding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
backgroundColor: dialogBackgroundColor ?? Theme.of(context).canvasColor,
shape: RoundedRectangleBorder(
borderRadius: borderRadius ?? BorderRadius.circular(10),
),
clipBehavior: Clip.antiAlias,
child: SizedBox(
width: dialogSize.width,
height: max(dialogSize.height, 410),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CalendarDatePicker2WithActionButtons(
value: value,
config: config.copyWith(openedFromDialog: true),
),
],
),
),
);
return showDialog<List<DateTime?>>(
context: context,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings,
builder: (BuildContext context) {
return builder == null ? dialog : builder(context, dialog);
},
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
useSafeArea: useSafeArea,
);
}