Skip to content

Commit

Permalink
make toast ignore pointer
Browse files Browse the repository at this point in the history
close #85
  • Loading branch information
boyan01 committed Nov 13, 2022
1 parent cf78223 commit 76b0cee
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/src/toast/toast.dart
Expand Up @@ -21,16 +21,24 @@ class Toast {
/// [duration] : the duration to show a toast,
/// for most situation, you can use [Toast.LENGTH_SHORT] and [Toast.LENGTH_LONG]
///
void toast(String message,
{Duration duration = Toast.LENGTH_SHORT, BuildContext? context}) {
void toast(
String message, {
Duration duration = Toast.LENGTH_SHORT,
BuildContext? context,
}) {
if (duration <= Duration.zero) {
//fast fail
return;
}

showOverlay(
(context, t) {
return Opacity(opacity: t, child: _Toast(content: Text(message)));
return IgnorePointer(
child: Opacity(
opacity: t,
child: _Toast(content: Text(message)),
),
);
},
curve: Curves.ease,
key: const ValueKey('overlay_toast'),
Expand Down

0 comments on commit 76b0cee

Please sign in to comment.