createHealthElement method

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

Implementation

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