showPicker function Null safety

Future<DateTime?> showPicker(
  1. BuildContext context,
  2. {required WidgetBuilder builder,
  3. bool barrierDismissible = true,
  4. Color? barrierColor = Colors.black54,
  5. Duration transitionDuration = const Duration(milliseconds: 200),
  6. bool useRootNavigator = true}
)

Implementation

Future<DateTime?> showPicker(
  BuildContext context, {
  required WidgetBuilder builder,
  bool barrierDismissible = true,
  Color? barrierColor = Colors.black54,
  Duration transitionDuration = const Duration(milliseconds: 200),
  bool useRootNavigator = true,
}) async {
  return await Navigator.of(context, rootNavigator: useRootNavigator).push(
    _PickerRouter(
      builder: builder,
      barrierColor: barrierColor,
      barrierDismissible: barrierDismissible,
      transitionDuration: transitionDuration,
    ),
  );
}