updateMetaData method Null safety

Future<Map<String, String>> updateMetaData(
  1. Map<String, String> metaDataMap
)

Implementation

Future<Map<String, String>> updateMetaData(
    Map<String, String> metaDataMap) async {
  if (metaDataMap.isEmpty) {
    throw InvalidParameterError();
  }

  final sdk = SendbirdSdk().getInternal();
  final result = await sdk.api
      .send(UserMetaDataUpdateRequest(metaDataMap, upsert: true));
  final map = Map<String, String>.from(result);
  metaData.addAll(map);
  return map;
}