onInit method

  1. @override
Future<void> onInit()
override

Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.

Implementation

@override
Future<void> onInit() async {
  super.onInit();

  if (NavUtils.previousRoute.isEmpty) {
    from = Routes.login;
  }
  userImgUrl.value = SessionManagement.getUserImage() ?? "";
  LogMessage.d("auth : ", SessionManagement.getAuthToken().toString());
  if (NavUtils.arguments != null) {
    // from(NavUtils.arguments["from"]);
    if (from == Routes.login) {
      profileMobile.text =
          NavUtils.arguments['mobile'] ?? SessionManagement.getMobileNumber();
    }
  } else {
    profileMobile.text = "";
  }
  if (from == Routes.login) {
    if (!await AppUtils.isNetConnected()) {
      toToast(getTranslated("noInternetConnection"));
      return;
    }
  }
  checkAndEnableNotificationSound();
  getProfile();
  //profileStatus.value="I'm Mirror fly user";
  // await askStoragePermission();
  // getMetaData();
}