ConsoleAPICalledEvent.fromJson constructor

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

Implementation

factory ConsoleAPICalledEvent.fromJson(Map<String, dynamic> json) {
  return ConsoleAPICalledEvent(
    type: ConsoleAPICalledEventType.fromJson(json['type'] as String),
    args: (json['args'] as List)
        .map((e) => RemoteObject.fromJson(e as Map<String, dynamic>))
        .toList(),
    executionContextId: ExecutionContextId.fromJson(
      json['executionContextId'] as int,
    ),
    timestamp: Timestamp.fromJson(json['timestamp'] as num),
    stackTrace: json.containsKey('stackTrace')
        ? StackTraceData.fromJson(json['stackTrace'] as Map<String, dynamic>)
        : null,
    context: json.containsKey('context') ? json['context'] as String : null,
  );
}