VxToast
VelocityX gives you VxToast to show toast in your flutter app.
important
Video Tutorial
Using VxToast class
VxToast.show(context, msg: "Hello from vx")
Or Using Context
context.showToast(msg: "Hello from vx")
note
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
Properties
Prop (Type) | Default | Description |
---|---|---|
showTime (int) | 2000 | To set duration of the toast |
bgColor (Color) | Sets background color of the toast | |
textColor (Color) | Sets text color of the toast | |
textSize (int) | 14 | Sets text font size of the toast |
position (VxToastPosition) | VxToastPosition.bottom | Available options - top, center, bottom |
pdHorizontal (double) | 20 | Sets horizontal padding |
pdVertical (double) | 10 | Sets vertical padding |