Skip to content

Unclear how to handle conditional UI, when resolving the condition is async #13445

@mit-mit

Description

@mit-mit

Occasionally apps need to render different UI depending on some condition that is resolved asynchronously, for example:

  • Dependent on device vs. emulator: The device_info package has an isEmulator API, but this is async

  • Dependent on login state: The firebase_auth package handles login, but asking if the user is logged in or not is async

It would be great if flutter.io has documentation for how to generally render UI that is conditional on async state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions