createGroup method Null safety

Future<String> createGroup(
  1. {JMGroupType groupType = JMGroupType.private,
  2. String? name,
  3. String? desc}
)

Implementation

Future<String> createGroup({
  JMGroupType groupType = JMGroupType.private,
  String? name,
  String? desc,
}) async {
  String groupId = await _channel.invokeMethod(
      'createGroup',
      {'groupType': getStringFromEnum(groupType), 'name': name, 'desc': desc}
        ..removeWhere((key, value) => value == null));

  return groupId;
}