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

Flushbar not showing on a List view #92

Closed
RitchBe opened this issue Oct 29, 2019 · 1 comment
Closed

Flushbar not showing on a List view #92

RitchBe opened this issue Oct 29, 2019 · 1 comment

Comments

@RitchBe
Copy link

RitchBe commented Oct 29, 2019

Hi,

I am trying to show a flushbar when an item is deleted from a list. It works fine when I am on top of the list but never show when I am lower or when there are only two elements left on the list.

I might do something wrong or maybe I should use an other strategy to call the flushbar as I am calling it inside the delete function.

My code is like this at the moment:

` deleteMeme(document) async {

await Firestore.instance
    .collection('memes')
    .document(document['memeId'])
    .delete();
await widget.storage.ref().child('images/' + document['memeId']).delete();

Flushbar(
    flushbarPosition: FlushbarPosition.BOTTOM,
    title: 'The image was deleted',
    message: "Forever",
    duration: Duration(seconds: 4),
    backgroundGradient:
        LinearGradient(colors: [Color(0xFFFF6996), Color(0xFF524A87)]))
  ..show(context);

} `
This function is called when a RawMaterialButton is pressed.
The list is created from a StreamBuilder.
As I said before, there must be a better and more stable way of doing it..
Thank you for your help.

@RitchBe
Copy link
Author

RitchBe commented Oct 30, 2019

Found my mistake ! I was calling the flushbar on the wrong context.. I had to call it on the List context.

@RitchBe RitchBe closed this as completed Oct 30, 2019
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

No branches or pull requests

1 participant