TRTCScreenCaptureSourceInfo.fromJson constructor

TRTCScreenCaptureSourceInfo.fromJson(
  1. Map<String, dynamic> json
)

Parse the corresponding structure from Json

Implementation

factory TRTCScreenCaptureSourceInfo.fromJson(Map<String, dynamic> json) {
  Map<String, dynamic> thumbBGRAJson;
  thumbBGRAJson = (json['thumbBGRA'] as Map<Object?, Object?>).cast<String, dynamic>();

  Map<String, dynamic> iconBGRAJson;
  iconBGRAJson = (json['iconBGRA'] as Map<Object?, Object?>).cast<String, dynamic>();

  return TRTCScreenCaptureSourceInfo(
    type: _fromInt(json['type']),
    sourceId: json['sourceId'],
    sourceName: json['sourceName'],
    thumbBGRA: TRTCImageBuffer.fromJson(thumbBGRAJson),
    iconBGRA: TRTCImageBuffer.fromJson(iconBGRAJson),
    isMinimizeWindow: json['isMinimizeWindow'],
    isMainScreen: json['isMainScreen'],
    x: json['x'],
    y: json['y'],
    width: json['width'],
    height: json['height'],
  );
}