getUserInfo method
Get user info of the user if logged in
Implementation
Future<UserInfo> getUserInfo() async {
if (_userInfo == null) {
var info = await request(method: METHOD_GET_USER_INFO, params: []);
_userInfo = UserInfo(
info["address"],
info["email"],
info["id"],
info["loginToken"],
LoginType.values.firstWhere(
(e) => e.toString() == 'LoginType.${info["loginType"]}'
),
info["name"],
info["picture"],
info["publicKey"],
);
}
// return _userInfo;
return Future.value(_userInfo);
}