show<T> method
Future<T?>
show<T>(
- BuildContext context,
- TypeSafeModalRoute route,
- Widget modal,
- 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),
),
);
},
);
}