on_toast_widget

Pub.dev Platforms Flutter

on_toast_widget is a Flutter Package used to show a custom and animated toast or snackbar Widget.

Help:

Any problem? Issues
Any suggestion? Pull request

Translations:

NOTE: Feel free to help with readme translations

Topics:

How to Install:

Add the following code to your pubspec.yaml:

dependencies:
  on_toast_widget: ^1.1.0

TODO:

  • Fix bugs.
  • Add more [Features]

How to use:

OnToastWidget() // The main widget to start using the plugin.

All types of parameters on this plugin:

Parameters Arguments Description
effectType EffectType Used to define the effect type that will be shown
slidePositionType SlidePositionType? Used to define the postion of effect based effectType.
zoomPositionType ZoomPositionType? Used to define the postion of effect based effectType.
fadePositionType FadePositionType? Used to define the postion of effect based effectType.
sizePositionType SizePositionType? Used to define the postion of effect based effectType.
animationType Curve Used to define what animation type will be shown.
messageDuration Duration? Used to define how long message will last.
automaticallyReverse bool? Used to define if toast will reverse automatically.
showInInitState bool? Used to define if message will shown when application starts.
controller AnimationController Used to control toast animations.
onStatusDismissed VoidCallback? It's a callback fuction that will be called when animation is dismissed.
onStatusForward VoidCallback? It's a callback fuction that will be called when animation is initializated.
onStatusReverse VoidCallback? It's a callback fuction that will be called when animation is reversed.
onStatusCompleted VoidCallback? It's a callback fuction that will be called when animation is completed.

See more in Documentation

Example:

OnToastWidget

   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,
     ),
 ),

LICENSE:

Libraries

on_toast_widget