JackJonson / flutter_styled_toast

A Styled Toast Flutter package.
Apache License 2.0
76 stars 42 forks source link

How to hide the toast ? #19

Closed MahmoudAbunaji closed 3 years ago

MahmoudAbunaji commented 3 years ago

How to hide the shown toast programmatically

ampyoso commented 3 years ago

There's no neat way to do that. I found that specifying isIgnoring and duration parameters works. If you want a toast to stay forever you could do :

showToastWidget(
    isIgnoring: false
    duration: Duration.zero
)

If you want this same toast to be dismissed :

showToastWidget(
    isIgnoring: true
    duration: Duration(milliseconds: 1)
)
JackJonson commented 3 years ago

Use dismissAllToast(showAnim: true);

MahmoudAbunaji commented 3 years ago

@JackJonson I'll try thank you