fromDynamic method Null safety

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

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;
}