show method

  1. @protected
void show(
  1. BuildContext context,
  2. TypeSafeModalRoute route,
  3. Widget modal,
  4. ModalRouteTheme theme,
)

Default method for show a modal

Implementation

@protected
void show(BuildContext context, TypeSafeModalRoute route, Widget modal, ModalRouteTheme theme) {
  // Open modal
  showGeneralDialog<void>(
    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.insetPadding,
            backgroundColor: Colors.white,
            shape: RoundedRectangleBorder(borderRadius: theme.borderRadius),
            child: SizedBox(
              width: theme.width,
              child: ModalContainer(padding: theme.padding, child: modal),
            ),
          );
    },
  );
}