TimelineEvent.fromJson constructor
TimelineEvent.fromJson(
- Map<String, dynamic> json
)
Implementation
factory TimelineEvent.fromJson(Map<String, dynamic> json) {
return TimelineEvent(
frameId: page.FrameId.fromJson(json['frameId'] as String),
type: json['type'] as String,
name: json['name'] as String,
time: network.TimeSinceEpoch.fromJson(json['time'] as num),
duration: json.containsKey('duration') ? json['duration'] as num : null,
lcpDetails: json.containsKey('lcpDetails')
? LargestContentfulPaint.fromJson(
json['lcpDetails'] as Map<String, dynamic>)
: null,
layoutShiftDetails: json.containsKey('layoutShiftDetails')
? LayoutShift.fromJson(
json['layoutShiftDetails'] as Map<String, dynamic>)
: null,
);
}