LitSnackbarController class

A controller to handle animations on LitSnackbar widgets.

Each LitSnackbar is required to have a LitSnackbarController in order to perform the animation, which will slide in and out the LitSnackbar using the showSnackBar method.

To use LitSnackbars outside the LitScaffold, their controller class should be initialized by excuting the LitSnackbarController's init method.

Constructors

LitSnackbarController({Duration animationDuration = const Duration(milliseconds: 350), Duration displayDuration = const Duration(milliseconds: 3500), SnackbarAnimationType animationType = SnackbarAnimationType.rightToLeft})
Creates a new controller for a LitSnackbar.

Properties

animationController AnimationController
The AnimationController necessary to animate the LitSnackbar.
getter/setter pair
animationDuration Duration
The AnimationController' duration.
final
animationType SnackbarAnimationType
The behavior of the snackbar's animation.
final
displayDuration Duration
The duration the snackbar should be displayed.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(void func()) → void
Adds a listener to the panel.
dismissSnackBar() → void
Dismisses the LitSnackbar.
dispose() → void
Dispose this LitSnackbarController.
init(TickerProvider vsync) → void
Initalizes the AnimationController by passing the provided TickerProvider.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
showSnackBar({bool reverseAnimation = true}) Future<void>
Slides in the LitSnackbar by playing the AnimationController's animation. It will then either play the reverse animation after the forward animation completed, or it will just stay at the 'animation complete' state to be disposed otherwise.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited