createDeviceInGroup method

Future<Device> createDeviceInGroup(
  1. String sdkId,
  2. String groupId,
  3. Device device
)

Implementation

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