ContextSnackBar extension
Provides convenient methods for showing snackbars.
- on
Methods
-
hideSnackBar(
) → void -
Available on BuildContext, provided by the ContextSnackBar extension
Hides the current snackbar. -
showError(
[String msg = 'Error']) → void -
Available on BuildContext, provided by the ContextSnackBar extension
Shows an error snackbar with a default message and colors. -
showSnackBar(
String msg, {Color? foreground, Color? background, SnackBarBehavior? behavior = SnackBarBehavior.floating, int durationMilliseconds = 2000, bool closeIcon = false, SnackBarAction? action, bool hideCurrent = true, TextStyle? textStyle, EdgeInsets? margin}) → void -
Available on BuildContext, provided by the ContextSnackBar extension
Shows a customizable snackbar.msgis the text content of the snackbar.foregroundis the color of the text and close icon.backgroundis the background color of the snackbar.behaviorcontrols how the snackbar is displayed (floating or fixed). duration is the duration the snackbar is visible (in milliseconds).closeIconshows or hides the close icon.actionis an optional action button for the snackbar.hideCurrentdetermines if the current snackbar should be hidden before showing a new one. -
showSuccess(
[String msg = 'Success']) → void -
Available on BuildContext, provided by the ContextSnackBar extension
Shows a success snackbar with a default message and colors.