SnackBarWidgets class
A utility class for displaying customizable snack bars using the GetX package.
Provides a static method showSnackBar to show a snack bar with various customization options such as message, style, background color, position, duration, and more.
Example usage:
SnackBarWidgets.showSnackBar(
context: context,
message: 'Operation successful!',
isErrorMessage: false,
);
Throws an Exception if the app is not wrapped with GetMaterialApp.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
showSnackBar(
{required String message, TextStyle messageStyle = const TextStyle(color: Colors.white, fontWeight: FontWeight.bold), bool isErrorMessage = false, Color backgroundColor = Colors.lightGreen, EdgeInsets margin = const EdgeInsets.all(0), EdgeInsets padding = const EdgeInsets.all(8), Duration duration = const Duration(milliseconds: 2000), SnackPosition snackPosition = SnackPosition.TOP, double borderRadius = 0, SnackStyle snackStyle = SnackStyle.GROUNDED}) → void - Displays a snack bar with the specified parameters.