13

I needed the following data of an android/ios device through my flutter app.

  1. Total memory size
  2. Free Memory size
  3. RAM size

How can I get it ?

1 Answer 1

10

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);
Sign up to request clarification or add additional context in comments.

9 Comments

I've updated my answer, check it again @SarveshDalvi
I've got 64 GB internal storage and on printing the output of getTotalDiskSpace() it gives me this value : 50287.5703125 ...... Is this wrong or maybe its in a different unit ?
I thought of it and hence divided it again by 1024 to get the output in GB ...... Then I'm getting 49.1 GB as final result ......... But my total storage space is 64 GB ..... What is happening here ?
This plugins does not support iOS I don't see why this was accepted as an answer is there any alternatives that do support iOS?
system_info plug-in is now marked "discontinued."
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.