fromDynamic static method

ListDevicesResponse fromDynamic(
  1. dynamic map,
  2. String? message,
  3. bool? success
)
override

Processes a Map or Map-like object into a response. If the map is null then this will return null.

Implementation

static ListDevicesResponse fromDynamic(
  dynamic map,
  String? message,
  bool? success,
) {
  late ListDevicesResponse result;

  if (map == null) {
    throw Exception('[ListDevicesResponse.fromDynamic]: map is null');
  } else {
    result = ListDevicesResponse(
      devices: JsonClass.fromDynamicList(
            map['devices'],
            (map) => ConnectedDevice.fromDynamic(map),
          ) ??
          <ConnectedDevice>[],
      message: message,
      success: success,
    );
  }

  return result;
}