getUser method

  1. @override
Future<EarthoUser?> getUser()
override

After user connected, this function returns user object

Implementation

@override
Future<EarthoUser?> getUser() async {
  final rawJson = await methodChannel.invokeMethod('getUser');
  if (rawJson == null) return null;
  final decodedJson = jsonDecode(rawJson);
  return EarthoUser.fromJSON(decodedJson);
}