createGroup method

Future<GroupInfo> createGroup({
  1. String? groupName,
  2. String? notification,
  3. String? introduction,
  4. String? faceUrl,
  5. int? groupType,
  6. String? ex,
  7. required List<GroupMemberRole> list,
  8. String? operationID,
})

创建一个组 groupName 群名 notification 公告 introduction 群介绍 faceUrl 群头像 groupType 组类型 GroupType ex 额外信息 list 初创群成员以及其角色列表GroupMemberRole

Implementation

Future<GroupInfo> createGroup({
  String? groupName,
  String? notification,
  String? introduction,
  String? faceUrl,
  int? groupType,
  String? ex,
  required List<GroupMemberRole> list,
  String? operationID,
}) =>
    _channel
        .invokeMethod(
            'createGroup',
            _buildParam({
              'gInfo': {
                "groupName": groupName,
                "notification": notification,
                "introduction": introduction,
                "faceURL": faceUrl,
                "groupType": groupType,
                "ex": ex,
              },
              'memberList': list.map((e) => e.toJson()).toList(),
              'operationID': Utils.checkOperationID(operationID),
            }))
        .then(
            (value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map)));