LayoutShift.fromJson constructor

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

Implementation

factory LayoutShift.fromJson(Map<String, dynamic> json) {
  return LayoutShift(
    value: json['value'] as num,
    hadRecentInput: json['hadRecentInput'] as bool? ?? false,
    lastInputTime:
        network.TimeSinceEpoch.fromJson(json['lastInputTime'] as num),
    sources: (json['sources'] as List)
        .map(
            (e) => LayoutShiftAttribution.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}