CPUInfo.fromMap constructor

CPUInfo.fromMap(
  1. Map<String, dynamic> map
)

fromMap is the method to convert the map to a class.

Implementation

factory CPUInfo.fromMap(Map<String, dynamic> map) {
  return CPUInfo(
    soc: map['soc'],
    cpu: map['cpu'],
    vendor: map['vendor'],
    cores: map['cores'],
    machines: map['machines'],
    cpuClockRange: map['cpuClockRange'],
    cpuClocks: map['cpuClocks'] != null
        ? List<CPUCores>.from(
            map['cpuClocks']?.map((x) => CPUCores.fromMap(x)))
        : null,
    supportedAbis: map['supportedAbis'] != null
        ? List<String>.from(map['supportedAbis'])
        : [],
    supported32bitAbis: map['supported32bitAbis'] != null
        ? List<String>.from(map['supported32bitAbis'])
        : [],
    supported64bitAbis: map['supported64bitAbis'] != null
        ? List<String>.from(map['supported64bitAbis'])
        : [],
    instructions: List<String>.from(map['instructions']),
    revision: map['revision'],
    governer: map['governer'],
    gpu: map['gpu'],
    gpuVendor: map['gpuVendor'],
    gpuVersion: map['gpuVersion'],
    openglExtensions: map['openglExtensions'] != null
        ? List<String>.from(map['openglExtensions'])
        : [],
  );
}