createInsurance method

Future<Insurance> createInsurance(
  1. String sdkId,
  2. Insurance insurance
)

Implementation

Future<Insurance> createInsurance(String sdkId, Insurance insurance) async {
	final res = await _methodChannel.invokeMethod<String>(
		'InsuranceApi.createInsurance',
		{
			"sdkId": sdkId,
			"insurance": jsonEncode(Insurance.encode(insurance)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method createInsurance");
	final parsedResJson = jsonDecode(res);
	return Insurance.fromJSON(parsedResJson);
}