Skip to content

StreamBuilder returning data even page is not loading #39824

@viratshukla

Description

@viratshukla

Hi,
I am using bloc (PublishSubject) to fetch data from internet. In one API, I am not getting the result due to expected reason hence displaying bottom sheet to display that error.
Now I navigate to some other screen, but since back screen is also rebuilt, it is causing bottom sheet of first screen to popup again.

Note - I am calling API only in initState(). Just listening for the stream.

Is there anyway, I can stop rebuilding widget of previous screen or stop listening to stream of previous screen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    d: stackoverflowGood question for Stack Overflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions