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() {
  super.onReady();
  pages.jumpToPage(router.tab.index);
  refresh();

  if (_settings.applicationSettings.value?.showIntroduction ?? true) {
    if (_myUserService.myUser.value != null) {
      _displayIntroduction(_myUserService.myUser.value!);
    } else {
      Worker? worker;
      worker = ever(_myUserService.myUser, (MyUser? myUser) {
        if (myUser != null && worker != null) {
          _displayIntroduction(myUser);
          worker?.dispose();
          worker = null;
        }
      });
    }
  }
}