Open atn832 opened 1 year ago
If I show a first toast for 5 seconds, then after 4 seconds show a second toast, then the second message gets shown only one second. Seems like there are two ways one could fix that:
Timer
Future.delayed
CancelableOperation
https://github.com/appdev/FlutterToast/blob/372fe042d59df14d0a9df4d752b7d5e9b5ebae43/lib/toast.dart#L121-L122
If I show a first toast for 5 seconds, then after 4 seconds show a second toast, then the second message gets shown only one second. Seems like there are two ways one could fix that:
Timer
instead ofFuture.delayed
. Timers can be canceled. https://api.dart.dev/stable/2.3.1/dart-async/Timer/cancel.htmlFuture.delayed
with aCancelableOperation
. https://pub.dev/documentation/async/latest/async/CancelableOperation-class.html