getNoPushUsersFromCache method Null safety

Future<List<String>> getNoPushUsersFromCache()

Gets the list of users which have blocked the push notification.

return The list of user that blocked the push notification.

Throws A description of the issue that caused this exception. See {@link EMError}

Implementation

Future<List<String>> getNoPushUsersFromCache() async {
  Map result = await _channel.invokeMethod(ChatMethodKeys.getNoPushUsers);
  List<String> list = [];
  if (result.containsKey(ChatMethodKeys.getNoPushUsers)) {
    list = result[ChatMethodKeys.getNoPushUsers]?.cast<String>();
  }
  return list;
}