CpuInfo.fromJson constructor

CpuInfo.fromJson(
  1. Map json
)

Deserialize the data json retrieved from the device through platform specific code

Implementation

CpuInfo.fromJson(Map<dynamic, dynamic> json) {
  this.numberOfCores = json['numberOfCores'];
  this.abi = json['abi'];
  this.cpuTemperature = json['cpuTemperature'];
  Map.from(json['currentFrequencies']).forEach((key, value) {
    this.currentFrequencies[key] = value;
  });

  Map.from(json['minMaxFrequencies']).forEach((key, value) {
    var map = Map.from(value);
    this.minMaxFrequencies[key] = MinMaxFrequency(map['min'], map['max']);
  });
}