onepub-dev / system_info

Provides easy access to useful information about the system (architecture, bitness, kernel, memory, operating system, CPU, user).
BSD 3-Clause "New" or "Revised" License
19 stars 8 forks source link

getFreePhysicalMemory() on iOS throws exception #5

Open bardram opened 1 year ago

bardram commented 1 year ago

I get a

UnsupportedError (Unsupported operation: Unsupported operating system.)

when calling SysInfo.getFreePhysicalMemory(); on iOS.

Does this plugin not support iOS?

bsutton commented 1 year ago

ios has limited support.

If you are interested in raising a PR it would be a great inclusion.

Looks like using FFI to call the methods discussed here would be the way to go:

https://stackoverflow.com/questions/5012886/determining-the-available-amount-of-ram-on-an-ios-device

src/platform/memory.dart is where the call would need to be wired in.

escamoteur commented 1 year ago

actually none of the memory functions seem to work on ios. I think a note in the docs would be helpful