currentUser property

Future<CurrentUser?> currentUser

Current user.

Returns current user or null if SDK is not initialized.

Implementation

static Future<CurrentUser?> get currentUser {
  return NativeBridge.sync('GetSocial.getCurrentUser', null).then((value) {
    if (jsonDecode(value) == null) {
      return null;
    }
    Map<String, dynamic> decoded = jsonDecode(value);
    if (decoded['result'] != null && decoded['result'].isEmpty) {
      return null;
    }
    return CurrentUser.fromJSON(decoded);
  });
}