show<T> method

  1. @protected
Future<T?> show<T>(
  1. BuildContext context,
  2. TypeSafeModalRoute route,
  3. Widget modal,
  4. ModalRouteTheme theme,
)

Default method for show a modal

Implementation

@protected
Future<T?> show<T>(
  BuildContext context,
  TypeSafeModalRoute route,
  Widget modal,
  ModalRouteTheme theme,
) {
  // Open modal
  return showGeneralDialog<T>(
    context: context,
    barrierLabel: 'Dismiss',
    useRootNavigator: true,
    transitionBuilder: theme.transition.builder,
    barrierDismissible: theme.barrierDismissible,
    pageBuilder: (context, animation, secondaryAnimation) {
      return modal is CustomContentModal
          ? modal
          : Dialog(
            insetPadding: theme.margin,
            backgroundColor: Colors.white,
            shape: RoundedRectangleBorder(borderRadius: theme.borderRadius),
            child: SizedBox(
              width: theme.width,
              child: ModalContainer(padding: theme.padding, child: modal),
            ),
          );
    },
  );
}