VelocityX gives you VxToast to show toast in your flutter app.


Video Tutorial

Using VxToast class

VxToast.show(context, msg: "Hello from vx")

Or Using Context

context.showToast(msg: "Hello from vx")

Toast sample 1

Both of these works perfectly fine. So it is your call whatever you prefer.

Show Loading using VxToast

VxToast.showLoading(context, msg: "Loading");

Or Show Loading using Context

final close = context.showLoading(msg: "Loading");
Future.delayed(2.seconds, close); // Removes toast after 2 seconds
Toast sample 2


Prop (Type)DefaultDescription
showTime (int)2000To set duration of the toast
bgColor (Color)Sets background color of the toast
textColor (Color)Sets text color of the toast
textSize (int)14Sets text font size of the toast
position (VxToastPosition)VxToastPosition.bottomAvailable options - top, center, bottom
pdHorizontal (double)20Sets horizontal padding
pdVertical (double)10Sets vertical padding