OnToastWidget class

Main Widget for use on_toast_widget

This widget will will show a custom and animated toast or snackbar Widget simply using AnimationController.

Usage:

Example:

  OnToastWidget(
    effectType: EffectType.SLIDE,
    slidePositionType: SlidePositionType.LEFT_BOTTOM,
    controller: _controller,
    showInInitState: true,
    animationType: Curves.linearToEaseOut,
    messageDuration: Duration(seconds: 2),
    automaticallyReverse: true,
    onStatusCompleted: () {
      //doSoomething
    },
    // onStatusDismissed: () {},
    // onStatusForward: () {},
    // onStatusReverse: () {},
    child: Container(
      height: 60,
      color: Colors.red,
    ),
),

Important:

  • It's important use animation Position based in your EffectType or will cause a FlutterError.
  • This package it's under development, any issue or suggestion, on_toast_widget Github.
Inheritance

Constructors

OnToastWidget({Key? key, required EffectType effectType, required AnimationController controller, required Widget? child, SlidePositionType? slidePositionType, FadePositionType? fadePositionType, SizePositionType? sizePositionType, ZoomPositionType? zoomPositionType, Curve animationType = Curves.linearToEaseOut, Duration? messageDuration = const Duration(seconds: 1), bool? automaticallyReverse = true, bool? showInInitState = false, VoidCallback? onStatusDismissed, VoidCallback? onStatusForward, VoidCallback? onStatusReverse, VoidCallback? onStatusCompleted})
Main Widget for use on_toast_widget
const

Properties

animationType Curve
animationType is used to define what animation type will be shown.
final
automaticallyReverse bool?
automaticallyReverse is used to define if toast will reverse automatically or only when controller.reverse is called.
final
child Widget?
child is the Widget child that will be animated.
final
controller AnimationController
controller is used to control toast animations.
final
effectType EffectType
effectType the effect type that will be shown.
final
fadePositionType FadePositionType?
fadePositionType the postion of effect based in your choice.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
messageDuration Duration?
messageDuration is used to define how long message will last.
final
onStatusCompleted VoidCallback?
onStatusCompleted it's a callback fuction that will be called when animation is completed.
final
onStatusDismissed VoidCallback?
onStatusDismissed it's a callback fuction that will be called when animation is dismissed.
final
onStatusForward VoidCallback?
onStatusForward it's a callback fuction that will be called when animation is initializated.
final
onStatusReverse VoidCallback?
onStatusReverse it's a callback fuction that will be called when animation is reversed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showInInitState bool?
showInInitState is used to define if message will shown when application starts.
final
sizePositionType SizePositionType?
sizePositionType the postion of effect based in your choice.
final
slidePositionType SlidePositionType?
slidePositionType the postion of effect based in your choice.
final
zoomPositionType ZoomPositionType?
zoomPositionType the postion of effect based in your choice.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _OnToastWidgetState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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