CupertinoDialogRoute<T> constructor Null safety

CupertinoDialogRoute<T>(
  1. {required WidgetBuilder builder,
  2. required BuildContext context,
  3. bool barrierDismissible = true,
  4. Color? barrierColor,
  5. String? barrierLabel,
  6. Duration transitionDuration = const Duration(milliseconds: 250),
  7. RouteTransitionsBuilder? transitionBuilder = _buildCupertinoDialogTransitions,
  8. RouteSettings? settings,
  9. Offset? anchorPoint}
)

A dialog route that shows an iOS-style dialog.

Implementation

CupertinoDialogRoute({
  required WidgetBuilder builder,
  required BuildContext context,
  super.barrierDismissible,
  Color? barrierColor,
  String? barrierLabel,
  // This transition duration was eyeballed comparing with iOS
  super.transitionDuration = const Duration(milliseconds: 250),
  super.transitionBuilder = _buildCupertinoDialogTransitions,
  super.settings,
  super.anchorPoint,
}) : assert(barrierDismissible != null),
    super(
      pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
        return builder(context);
      },
      barrierLabel: barrierLabel ?? CupertinoLocalizations.of(context).modalBarrierDismissLabel,
      barrierColor: barrierColor ?? CupertinoDynamicColor.resolve(kCupertinoModalBarrierColor, context),
    );