createMetaData method Null safety

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

Implementation

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

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