Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose flushbar status + add isVisible method #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions lib/flushbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,33 @@ class Flushbar<T> 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<T>();
Expand Down