PinIndicatorAnimationController class
Controller for managing animations for PinIndicator.
It handles the queue of animations, so you just have to call desired animations and react to them in your UI using getters from this controller.
You can also listen to this in case you want to update your UI when animations starts or ends.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
PinIndicatorAnimation?> - PinIndicatorAnimationController
Constructors
- PinIndicatorAnimationController()
- Controller for managing animations for PinIndicator.
Properties
- canVibrate ↔ bool
-
Whether the device meets vibration requirements.
Vibration requires vibrator and custom vibration support.
So older devices will not vibrate even if it is enabled when calling animation.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isAnimating → bool
-
Returns true if there is an animation in progress.
no setter
- isAnimatingClear → bool
-
Returns true if there are animation in progress and it has clear type.
no setter
- isAnimatingErase → bool
-
Returns true if there are animation in progress and it has erase type.
no setter
- isAnimatingError → bool
-
Returns true if there are animation in progress and it has error type.
no setter
- isAnimatingIdle → bool
-
Returns true if there are animation in progress and it has idle type.
no setter
- isAnimatingInput → bool
-
Returns true if there are animation in progress and it has input type.
no setter
- isAnimatingLoading → bool
-
Returns true if there are animation in progress and it has loading type.
no setter
- isAnimatingNonInterruptible → bool
-
Returns true if the current animation can not be interrupted.
You can check which animations is interruptible in
lib/src/indicator/models/animation_data.dart
no setter
- isAnimatingSuccess → bool
-
Returns true if there are animation in progress and it has success type.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ PinIndicatorAnimation?
-
The current value stored in this notifier.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
animateClear(
{PinClearAnimation animation = PinClearAnimation.fade, bool vibration = false, Duration? delayBeforeAnimation, Duration? delayAfterAnimation, VoidCallback? onComplete, VoidCallback? onInterrupt, double animationSpeed = 1.0}) → void - Method for calling animation with input type for PinIndicator associated with this controller. Call this method when user clears entire pin code at once (if there are such logic) or you want to clear pin when other logic triggers it (for example, pressing "Forgot PIN code" button).
-
animateErase(
{PinEraseAnimation animation = PinEraseAnimation.deflate, bool vibration = false, VoidCallback? onComplete, VoidCallback? onInterrupt, double animationSpeed = 1.0}) → void - Method for calling animation with input type for PinIndicator associated with this controller. Call this method when user erases one symbol from pin.
-
animateError(
{PinErrorAnimation animation = PinErrorAnimation.shake, bool vibration = false, Duration? delayBeforeAnimation, Duration? delayAfterAnimation, VoidCallback? onComplete, VoidCallback? onInterrupt, double animationSpeed = 1.0}) → void - Method for calling animation with input type for PinIndicator associated with this controller. Call this method when user enters wrong pin code.
-
animateIdle(
{PinIdleAnimation animation = PinIdleAnimation.wave, bool vibration = false, int repeatCount = 1, VoidCallback? onComplete, VoidCallback? onInterrupt, double animationSpeed = 1.0}) → void - Method for calling animation with input type for PinIndicator associated with this controller. Call this method when user is inactive for a long time to let them know that action is required and show that app is still alive.
-
animateInput(
{PinInputAnimation animation = PinInputAnimation.inflate, bool vibration = false, VoidCallback? onComplete, VoidCallback? onInterrupt, double animationSpeed = 1.0}) → void - Method for calling animation with input type for PinIndicator associated with this controller. Call this method when user enters pin code symbol.
-
animateLoading(
{PinLoadingAnimation animation = PinLoadingAnimation.jump, bool vibration = false, int repeatCount = 1, Duration? delayBeforeAnimation, Duration? delayAfterAnimation, VoidCallback? onComplete, VoidCallback? onInterrupt, double animationSpeed = 1.0}) → void - Method for calling animation with loading type for PinIndicator associated with this controller. Call this method when you need to delay UI when making async operations or to let user know that app is doing something in this moment.
-
animateSuccess(
{PinSuccessAnimation animation = PinSuccessAnimation.collapse, bool vibration = false, Duration? delayBeforeAnimation, Duration? delayAfterAnimation, VoidCallback? onComplete, VoidCallback? onInterrupt, double animationSpeed = 1.0}) → void - Method for calling animation with input type for PinIndicator associated with this controller. Call this method when user enters correct pin code.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
initializeVibration(
) → Future< void> - Controller initialize method for vibration feature. You must call in case you want to use vibration in your animations. Otherwise it will throw an exception.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
stop(
{bool ignoreOnInterruptCallbacks = false}) → void - Call this method if you want to stop currently playing animation and all of planned ones if any. Method stops even non-interruptible animations from being played.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited