getUser method
After user connected, this function returns user object
Implementation
@override
Future<EarthoUser?> getUser() async {
try {
if (earthoInstance == null) return null;
final eToken = await promiseToFuture(earthoInstance?.getIdToken());
if (eToken == null) return null;
Map<String, dynamic> decodedToken = JwtDecoder.decode(eToken as String);
return EarthoUser.fromJSON(decodedToken["user"]);
} catch (e) {
print(e);
return null;
}
}