fromDynamic static method

ScreenshotResponse 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 ScreenshotResponse fromDynamic(
  dynamic map,
  String? message,
  bool? success,
) {
  late ScreenshotResponse result;

  if (map == null) {
    throw Exception('[ScreenshotResponse.fromDynamic]: map is null');
  } else {
    result = ScreenshotResponse(
      image: (map['image'] == null ? null : base64Decode(map['image'])) ??
          Uint8List(0),
      message: message,
      success: success,
    );
  }

  return result;
}