saveUserMainInfo static method

Future<void> saveUserMainInfo()

Implementation

static Future<void> saveUserMainInfo() async {
  //Diferenciamos si esta en Web o no
  log(_tag + ", saveUserMainInfo...");
  GoogleSignInAccount _currentUser = AuthWithGoogleService().getCurrentUser();
  // if (kIsWeb) {
  //   window.localStorage[Constants.EMAIL_STORAGE_KEY] = _currentUser.email;
  //   window.localStorage[Constants.NAME_STORAGE_KEY] =
  //       _currentUser.displayName;
  //   window.localStorage[Constants.URL_IMAGE_STORAGE_KEY] =
  //       _currentUser.photoUrl;
  // } else {
  //   //Guardamos la info en el preference E-Mail.
  //   await SharedPreferences.getInstance().then((prefs) => {
  //         //Email
  //         prefs.setString(Constants.EMAIL_STORAGE_KEY, _currentUser.email),
  //         //Display Name
  //         prefs.setString(
  //             Constants.NAME_STORAGE_KEY, _currentUser.displayName),
  //         //Url of User
  //         prefs.setString(
  //             Constants.URL_IMAGE_STORAGE_KEY, _currentUser.photoUrl),
  //       });
  // }
  //Guardamos la info en el preference E-Mail.
  await SharedPreferences.getInstance().then((prefs) => {
    //Email
    prefs.setString(Constants.EMAIL_STORAGE_KEY, _currentUser.email),
    //Display Name
    prefs.setString(
        Constants.NAME_STORAGE_KEY, _currentUser.displayName!),
    //Url of User
    prefs.setString(
        Constants.URL_IMAGE_STORAGE_KEY, _currentUser.photoUrl!),
  });
}