TargetInfo.fromJson constructor

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

Implementation

factory TargetInfo.fromJson(Map<String, dynamic> json) {
  return TargetInfo(
    targetId: TargetID.fromJson(json['targetId'] as String),
    type: json['type'] as String,
    title: json['title'] as String,
    url: json['url'] as String,
    attached: json['attached'] as bool? ?? false,
    openerId: json.containsKey('openerId')
        ? TargetID.fromJson(json['openerId'] as String)
        : null,
    canAccessOpener: json['canAccessOpener'] as bool? ?? false,
    openerFrameId: json.containsKey('openerFrameId')
        ? page.FrameId.fromJson(json['openerFrameId'] as String)
        : null,
    browserContextId: json.containsKey('browserContextId')
        ? browser.BrowserContextID.fromJson(
            json['browserContextId'] as String)
        : null,
    subtype: json.containsKey('subtype') ? json['subtype'] as String : null,
  );
}