fluttertoastflutter-web

Can I set duration to fluttertoast?


I am intending to use this library https://pub.dev/packages/fluttertoast/install for toasts.

Is there a way to set the duration. This is a web project, in case it makes any difference.

Thank you.


Solution

  • Here is what I've found:

    The duration for which a toast is displayed on screen is unfortunately defined by a flag: you can either show it for a SHORT duration, which is 2 seconds or a LONG duration which is 3,5 seconds. source

    The package fluttertoast only implements those two types of duration and if you want a longer toast you will need to make your own implementation using native code.