showSBBModalPopup<T> function
Shows a SBB Modal Popup. Use according to documentation.
If you try to close the popup but the underlying page is navigated back
instead, try using the rootNavigator parameter of the Navigator:
Navigator.of(context, rootNavigator: true).pop(result)
See also:
- SBBModalPopup, which will be displayed.
- showDialog, which is used to display the modal.
- digital.sbb.ch/en/design-system/mobile/components/modal-view/
Implementation
Future<T?> showSBBModalPopup<T>({
required BuildContext context,
required String title,
required Widget child,
Clip clipBehavior = Clip.none,
bool showCloseButton = true,
Color? backgroundColor,
}) {
return showDialog<T>(
context: context,
builder: (BuildContext context) {
return SBBModalPopup(
title: title,
clipBehavior: clipBehavior,
showCloseButton: showCloseButton,
backgroundColor: backgroundColor,
child: child,
);
},
barrierColor: SBBInternal.barrierColor,
);
}