Overlayer.showOverlay constructor
Overlayer.showOverlay({
- int backgroundColor = 0x42000000,
- int seconds = 0,
- bool clickClose = false,
- bool allowClick = false,
- bool ignoreContentClick = false,
- bool crossPage = true,
- int animationMilliseconds = 200,
- int animationReverseMilliseconds = 200,
- BackButtonBehaviorChecker backButtonBehavior = BackButtonBehaviorChecker.none,
- void cancelFunc()?,
- required Widget child,
Constructs an OverLaymanager instance to show an overlay.
The overlay will display the given child
widget and can be customized with various parameters.
- backgroundColor: The background color of the overlay.
- seconds: The duration for which the overlay will be displayed.
- clickClose: Determines if clicking on the overlay will close it.
- allowClick: Determines if clicking outside the overlay area will close it.
- ignoreContentClick: Determines if clicking on the content within the overlay will be ignored.
- crossPage: Determines if the overlay should persist across multiple pages.
- animationMilliseconds: The duration for the overlay animation to complete when it appears.
- animationReverseMilliseconds: The duration for the overlay animation to complete when it disappears.
- backButtonBehavior: The behavior to apply when the back button is pressed.
- cancelFunc: A callback function to be invoked when the overlay is closed.
Implementation
Overlayer.showOverlay({
this.backgroundColor = 0x42000000,
this.seconds = 0,
this.clickClose = false,
this.allowClick = false,
this.ignoreContentClick = false,
this.crossPage = true,
this.animationMilliseconds = 200,
this.animationReverseMilliseconds = 200,
this.backButtonBehavior = BackButtonBehaviorChecker.none,
this.cancelFunc,
required Widget child,
}) {
BotToast.showCustomLoading(
clickClose: clickClose,
allowClick: allowClick,
backButtonBehavior:
getBackButtonBehavior(backButtonBehavior: backButtonBehavior),
ignoreContentClick: ignoreContentClick,
animationDuration: Duration(milliseconds: animationMilliseconds),
animationReverseDuration:
Duration(milliseconds: animationReverseMilliseconds),
duration: seconds == 0 ? null : Duration(seconds: seconds),
backgroundColor: Color(backgroundColor),
align: Alignment.center,
toastBuilder: (cancelFuncval) {
cancelFunc = cancelFuncval;
return child;
},
);
}