From 62b046ec7c519f0a2cfca11f6bce7744edf4efb2 Mon Sep 17 00:00:00 2001 From: Herrick Wolber Date: Tue, 29 Dec 2020 19:06:58 +0100 Subject: [PATCH] Expose all status + add isVisible method --- lib/flushbar.dart | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/flushbar.dart b/lib/flushbar.dart index dc1da81..6b8d29f 100644 --- a/lib/flushbar.dart +++ b/lib/flushbar.dart @@ -257,16 +257,33 @@ class Flushbar extends StatefulWidget { return null; } - /// Checks if the flushbar is visible + /// Checks if the flushbar status is showing bool isShowing() { return _flushbarRoute?.currentStatus == FlushbarStatus.SHOWING; } - /// Checks if the flushbar is dismissed + /// Checks if the flushbar status is appearing + bool isAppearing() { + return _flushbarRoute?.currentStatus == FlushbarStatus.IS_APPEARING; + } + + /// Checks if the flushbar status is hiding + bool isHiding() { + return _flushbarRoute?.currentStatus == FlushbarStatus.IS_HIDING; + } + + /// Checks if the flushbar status is dismissed bool isDismissed() { return _flushbarRoute?.currentStatus == FlushbarStatus.DISMISSED; } + /// Checks if the flushbar is visible + bool isVisible() { + return _flushbarRoute?.currentStatus == FlushbarStatus.SHOWING || + _flushbarRoute?.currentStatus == FlushbarStatus.IS_APPEARING || + _flushbarRoute?.currentStatus == FlushbarStatus.IS_HIDING; + } + @override State createState() { return _FlushbarState();