show<T> static method
Future<T?>
show<T>({
- required BuildContext context,
- required Widget child,
- double heightFactor = 0.9,
- bool isDismissible = false,
- bool enableDrag = false,
- bool showDragHandle = false,
- double borderRadius = 24.0,
- VoidCallback? onDismissed,
Shows the payment screen as a modal bottom sheet.
This is the primary method to display the SDK payment UI. The bottom sheet slides up from the bottom and covers 90% of the screen.
Parameters:
context- The build contextchild- The payment screen widget to displayheightFactor- The height as a factor of screen height (default: 0.9)isDismissible- Whether the sheet can be dismissed by tapping outsideenableDrag- Whether the sheet can be dragged to dismissborderRadius- The radius for the top corners (default: 24.0)onDismissed- Callback when the sheet is dismissed
Returns a Future that completes when the bottom sheet is closed.
Implementation
static Future<T?> show<T>({
required BuildContext context,
required Widget child,
double heightFactor = 0.9,
bool isDismissible = false,
bool enableDrag = false,
bool showDragHandle = false,
double borderRadius = 24.0,
VoidCallback? onDismissed,
}) {
return showModalBottomSheet<T>(
context: context,
isScrollControlled: true,
isDismissible: isDismissible,
enableDrag: enableDrag,
backgroundColor: Colors.transparent,
builder: (context) => AmwalPayBottomSheet(
heightFactor: heightFactor,
isDismissible: isDismissible,
showDragHandle: showDragHandle,
borderRadius: borderRadius,
onDismissed: onDismissed,
child: child,
),
).then((value) {
onDismissed?.call();
return value;
});
}