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.0.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:

ParametersArgumentsDescription
effectTypeEffectTypeUsed to define the effect type that will be shown
slidePositionTypeSlidePositionType?Used to define the postion of effect based effectType.
zoomPositionTypeZoomPositionType?Used to define the postion of effect based effectType.
fadePositionTypeFadePositionType?Used to define the postion of effect based effectType.
sizePositionTypeSizePositionType?Used to define the postion of effect based effectType.
animationTypeCurveUsed to define what animation type will be shown.
messageDurationDuration?Used to define how long message will last.
automaticallyReversebool?Used to define if toast will reverse automatically.
showInInitStatebool?Used to define if message will shown when application starts.
controllerAnimationControllerUsed to control toast animations.
onStatusDismissedVoidCallback?It's a callback fuction that will be called when animation is dismissed.
onStatusForwardVoidCallback?It's a callback fuction that will be called when animation is initializated.
onStatusReverseVoidCallback?It's a callback fuction that will be called when animation is reversed.
onStatusCompletedVoidCallback?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