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

added isAppearing to prevent double render #93

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jensvrai
Copy link

The only real change is the adding of isAppearing function. Still needed 6 commits though :)

  /// Checks if the flushbar is appearing
  bool isAppearing() {
    return _flushbarRoute?.currentStatus == FlushbarStatus.IS_APPEARING;
  }

In my project I'm loading a flushbar when certain conditions are met, but sometimes I got double renders. But when I check the isAppearing()

Flushbar offlineFlushbar = Flushbar<bool>(
  message: "Je bent offline",
);

In my builder

WidgetsBinding.instance.addPostFrameCallback((_) {
  if (!offlineFlushbar.isShowing() &&
      !offlineFlushbar.isAppearing()) {
    offlineFlushbar.show(context);
  }
});

@@ -1,3 +1,3 @@
sdk.dir=/Users/andrehaueisen/Library/Android/sdk
flutter.sdk=/Users/andrehaueisen/Development/flutter

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jensvrai you're going to want to revert this change
@AndreHaueisen this probably should have been gitignored?

@danielRi
Copy link

Any news on this? We need this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants