createHealthElement method

Future<GroupScoped<HealthElement>> createHealthElement(
  1. String sdkId,
  2. GroupScoped<HealthElement> entity
)

Implementation

Future<GroupScoped<HealthElement>> createHealthElement(String sdkId, GroupScoped<HealthElement> entity) async {
	final res = await _methodChannel.invokeMethod<String>(
		'HealthElementApi.inGroup.tryAndRecover.createHealthElement',
		{
			"sdkId": sdkId,
			"entity": jsonEncode(GroupScoped.encode(
				entity,
				(x0) {
					return HealthElement.encode(x0);
				},
			)),
		}
	).catchError(convertPlatformException);
	if (res == null) throw AssertionError("received null result from platform method createHealthElement");
	final parsedResJson = jsonDecode(res);
	return GroupScoped.fromJSON(
		parsedResJson,
		(x1) {
			return HealthElement.fromJSON(x1);
		},
	);
}