HeapSample.fromJson constructor

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

Implementation

factory HeapSample.fromJson(Map<String, dynamic> json) {
  final adbMemoryInfo = json['adb_memoryInfo'];
  final memoryEventInfo = json['memory_eventInfo'];
  final rasterCache = json['raster_cache'];
  return HeapSample(
    json['timestamp'] as int,
    json['rss'] as int,
    json['capacity'] as int,
    json['used'] as int,
    json['external'] as int,
    json['gc'] as bool,
    adbMemoryInfo != null
        ? AdbMemoryInfo.fromJson(adbMemoryInfo)
        : AdbMemoryInfo.empty(),
    memoryEventInfo != null
        ? EventSample.fromJson(memoryEventInfo)
        : EventSample.empty(),
    rasterCache != null
        ? RasterCache.fromJson(rasterCache)
        : RasterCache.empty(),
  );
}