showSnackBar method
ScaffoldFeatureController<SnackBar, SnackBarClosedReason>
showSnackBar(
- SnackBar snackBar, {
- void onClosed()?,
- VoidCallback? onVisible,
Implementation
ScaffoldFeatureController<SnackBar, SnackBarClosedReason> showSnackBar(
SnackBar snackBar, {
void Function(SnackBarClosedReason)? onClosed,
VoidCallback? onVisible,
}) {
final controller = messenger.showSnackBar(snackBar);
onVisible?.call();
if (onClosed != null) {
controller.closed.then((reason) => onClosed.call(reason));
}
return controller;
}