createGroup method

Future<Group> createGroup(
  1. String sdkId,
  2. String id,
  3. String name,
  4. GroupType? type,
  5. String password,
  6. String? server,
  7. int? q,
  8. int? n,
  9. String? superGroup,
  10. String? applicationId,
  11. 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);
}