onReady method

  1. @override
void onReady()
override

Called 1 frame after onInit(). It is the perfect place to enter navigation events, like snackbar, dialogs, or a new route, or async request.

Implementation

@override
void onReady() {
  SchedulerBinding.instance.addPostFrameCallback((_) => _ready.finish());

  _accountsSubscription = profiles.listen((accounts) {
    if (accounts.isEmpty) {
      screen.value = AuthScreen.signIn;
    } else {
      screen.value = AuthScreen.accounts;
    }
  });

  super.onReady();
}