MemoryInfo.fromMap constructor

MemoryInfo.fromMap(
  1. Map map
)

Implementation

factory MemoryInfo.fromMap(Map<dynamic, dynamic> map) {
  return MemoryInfo(
    totalMB: ((map['total'] ?? 0) as int) ~/ (1024 * 1024), // bytes to MB
    freeMB: ((map['free'] ?? 0) as int) ~/ (1024 * 1024), // bytes to MB
  );
}