createGroup method
Future<Group>
createGroup(
- String sdkId,
- String id,
- String name,
- GroupType? type,
- String password,
- String? server,
- int? q,
- int? n,
- String? superGroup,
- String? applicationId,
- DatabaseInitialisation initialisationData,
)
Implementation
Future<Group> createGroup(String sdkId, String id, String name, GroupType? type, String password, String? server, int? q, int? n, String? superGroup, String? applicationId, DatabaseInitialisation initialisationData) async {
final res = await _methodChannel.invokeMethod<String>(
'GroupApi.createGroup',
{
"sdkId": sdkId,
"id": jsonEncode(id),
"name": jsonEncode(name),
"type": jsonEncode(type == null ? null : GroupType.encode(type!)),
"password": jsonEncode(password),
"server": jsonEncode(server),
"q": jsonEncode(q),
"n": jsonEncode(n),
"superGroup": jsonEncode(superGroup),
"applicationId": jsonEncode(applicationId),
"initialisationData": jsonEncode(DatabaseInitialisation.encode(initialisationData)),
}
);
if (res == null) throw AssertionError("received null result from platform method createGroup");
final parsedResJson = jsonDecode(res);
return Group.fromJSON(parsedResJson);
}