showAsDialog<T> method

Future<T?> showAsDialog<T>(
  1. BuildContext context, {
  2. PopupAnimation animation = PopupAnimation.scale,
  3. bool barrierDismissible = true,
  4. Color? barrierColor,
  5. EdgeInsets? margin,
  6. EdgeInsets? padding,
  7. double? width,
  8. double? height,
  9. BorderRadius? borderRadius,
  10. Color? backgroundColor,
})

Show ContentView as center dialog Usage:

final result = await myContentView.showAsDialog(context);

Implementation

Future<T?> showAsDialog<T>(
  BuildContext context, {
  PopupAnimation animation = PopupAnimation.scale,
  bool barrierDismissible = true,
  Color? barrierColor,
  EdgeInsets? margin,
  EdgeInsets? padding,
  double? width,
  double? height,
  BorderRadius? borderRadius,
  Color? backgroundColor,
}) async {
  return await showPopup<T>(
    context,
    position: PopupPosition.center,
    animation: animation,
    barrierDismissible: barrierDismissible,
    barrierColor: barrierColor,
    margin: margin,
    padding: padding,
    width: width,
    height: height,
    borderRadius: borderRadius,
    backgroundColor: backgroundColor,
  );
}