website icon indicating copy to clipboard operation
website copied to clipboard

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

Open zoechi opened this issue 6 years ago • 7 comments

@mit-mit commented on Fri Dec 08 2017

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.


@goderbauer commented on Fri Dec 28 2018

The cookbook would be a great place to add this (https://flutter.io/docs/cookbook).

Should this be moved to the website repo?

zoechi avatar Dec 30 '18 17:12 zoechi