Reputation: 2688
I needed the following data of an android/ios device through my flutter app.
How can I get it ?
Upvotes: 12
Views: 8431
Reputation: 9019
You can use system_info
plugin to get information about system including total and free size of physical and virtual memory. You can get more detail in here.
// values are in byte
print(SysInfo.getTotalPhysicalMemory());
print(SysInfo.getFreePhysicalMemory());
print(SysInfo.getTotalVirtualMemory());
print(SysInfo.getFreeVirtualMemory());
print(SysInfo.getVirtualMemorySize());
For getting storage space you can use disk_space
plugin from here:
// values are in MB
print(await DiskSpace.getFreeDiskSpace);
print(await DiskSpace.getTotalDiskSpace);
Upvotes: 9