Profile.fromJson constructor

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

Implementation

factory Profile.fromJson(Map<String, dynamic> json) {
  return Profile(
    nodes: (json['nodes'] as List)
        .map((e) => ProfileNode.fromJson(e as Map<String, dynamic>))
        .toList(),
    startTime: json['startTime'] as num,
    endTime: json['endTime'] as num,
    samples: json.containsKey('samples')
        ? (json['samples'] as List).map((e) => e as int).toList()
        : null,
    timeDeltas: json.containsKey('timeDeltas')
        ? (json['timeDeltas'] as List).map((e) => e as int).toList()
        : null,
  );
}