system_info2

4.2.0

Provides easy access to useful information about the system (architecture, bitness, kernel, memory, operating system, CPU, user).

Download archive

Readme

system_info2

A fork of system_info as the original maintainer no longer wishes to do so.

Thanks to onepub.dev for allowing me the time and resources to support this package.

Provides easy access to useful information about the system (architecture, bitness, kernel, memory, operating system, CPU, user).

system_info2 lets you discover specific hardware characteristics of the OS you are running on includeing:

  • kernelArchitecture
  • Kernel bitness
  • Kernel name
  • Kernel version
  • Operating system name
  • Operating system version
  • User directory
  • User id
  • User name
  • User space bitness

Basic examples:

if (SysInfo.operatingSystemName == "Ubuntu") {
  log.info("We love Ubuntu users");
}

Documentation

You can find the manual at:

sysinfo.onepub.dev

Windows memory queries

Memory getters use local PowerShell Get-CimInstance queries, so WMIC is not required. Windows PowerShell (powershell.exe) must be on PATH, with the CimCmdlets module and local WMI/CIM service/providers available. Queries run without profiles or interactive prompts and do not require remote WinRM. Each synchronous getter starts a PowerShell process; these calls can be slow and should not be used in a tight polling loop or on a latency-sensitive UI path.

The public methods still return bytes. FreePhysicalMemory, FreeVirtualMemory, and TotalVirtualMemorySize from Win32_OperatingSystem are converted from KiB; Win32_ComputerSystem.TotalPhysicalMemory and the current Dart process's Win32_Process.VirtualSize are already bytes. Available and free physical memory retain the same Windows meaning. Virtual memory retains the WMI property semantics (it is not a measurement of the Dart heap).

If PowerShell/CIM fails, is blocked by policy, or returns missing/invalid data, memory getters now throw StateError instead of silently reporting zero. A valid zero result is still returned as zero. No execution-policy bypass or WMIC fallback is used. Other Windows information queries may still depend on WMIC.

Property definitions: operating system, computer system, and process.

Run dart test for fixture regression coverage. Tests marked for Windows or macOS also exercise the public API on those operating systems; skips on Linux do not constitute native-platform verification.

Changelog

4.2.0

  • Fix #6: return macOS total physical memory in bytes without multiplying by page size.
  • Fix #7: recognize Windows AMD64 as x86_64.
  • Fix #12: use PowerShell CIM for Windows memory queries without requiring WMIC. Queries retain their units and WMI property semantics. Failed or invalid queries now throw StateError instead of silently returning zero; valid zero remains zero. Windows PowerShell and the local CIM providers are required. Other Windows information queries may still require WMIC. See README for limits and latency.
  • Add regression tests and Linux/macOS/Windows CI. Retain the Dart 2.19 library SDK floor.

4.1.0

  • Merge pull request #14 from GabrielTorelo/feat/storage_information
  • chore(example): adding the storage data to the example
  • feat(system_info): provides and comments functions to get data from storage
  • feat(storage): creates functions to get total storage and available storage
  • feat(utils): creates function to obtain 'StatFs' values and convert to map
  • Merge pull request #11 from dev-kasibhatla/system_info3-compatibility
  • Add getAvailablePhysicalMemory()

4.0.0

  • upgraded to support dart 3.0
  • removed dependency on deprecated file_utils package by coping the required classes into system_info.

3.0.2

  • Updated to kernel.dart processorToArchitecure map

3.0.1

  • breaking: changed SysInfo.kernelArchitecture to return a ProcessorArchitecture rather than a string as it provides a more useful abstraction.
  • Introduced the new SysInfo.rawKernelArchitecture which provides the same value as the original SysInfo.kernelArchitecture.

3.0.0

  • Breaking Change: removed all classes/methods marked as @deprecated in 2.x. To make your life easier be sure to remove all deprecated warnings before upgrading to 3.x
  • Breaking change, ProcessorArchitecture.aarch64 renamed to ProcessorArchitecture.arm64
  • significant refactoring of the code base by breaking out code into seperate dart files to improve readability.

2.0.4

  • fixed getFreePhysicalMemory - big thanks to @jingluoguo for the patch

2.0.3

  • removed trailing slashes of homepage and documenation.
  • fix of the readme.

2.0.2

  • released the manual and updated the readme to point to it.
  • made processors redundant and replaced with cores.
  • Applied lint hard and fixed incorrect camel case usage.

2.0.1

Acknowledged onepub.dev's support.

2.0.0

Forked an created a supported release.

  • 1.0.1
  • 1.0.1
  • 1.0.0
  • Merge pull request #3 from bsutton/master
  • Corrected the version no.
  • migrate to nnbd
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
  • 0.0.16
  • 0.0.15
  • Merge pull request #1 from martinsik/master
  • fixed _getKernelBitness for "macos"
  • 0.0.14
  • 0.0.12
  • 0.0.12
  • 0.0.12
  • 0.0.11
  • 0.0.11
  • 0.0.10
  • 0.0.9
  • 0.0.9
  • 0.0.8
  • 0.0.7
  • 0.0.6
  • 0.0.6
  • 0.0.5
  • 0.0.5
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
  • Initial commit

1.0.1

  • This package is no longer supported because it was flagged by Google Dart developers as being published by an unknown person. Publisher Unknown. As a normal person, I believe that hardly anyone would want to use software from unknown publishers.

1.0.0

  • The source code has been migrated to null safety. Thanks to the author of this work, Brett Sutton (github.com/bsutton).

0.1.3

  • Minor changes in processor architecture recognition

0.1.2

  • The source code has been modified in accordance with Google’s guidelines about the effectiveness of the Dart language

0.1.1

  • To avoid downgrading the rating on https://pub.dartlang.org, the source code has been changed to fit Google’s ever-changing recommendations on what a good (pedantic) source code should be.

0.1.0

  • Adaptation to Dart 2.0

0.0.16

  • Fixed bug in detection of user space bitness on Mac OS X

0.0.15

  • Fixed bug in detection of bitness of kernel on Mac OS X

0.0.14

  • Added statistics getVirtualMemorySize() about the current memory usage by the current process

0.0.12

  • Breaking change, ProcessorArchitecture.ARM64 renamed to ProcessorArchitecture.AARCH64

0.0.11

  • Fixed bug in detection of kernel architecture on Windows. More universal algorithm independent from the architecture name, allows detect any architecture (X86/ AMD64/ IA64/ etc)
  • Impoved detection of bitness of kernel on Windows. Added suport of IA64
  • Impoved detection of bitness of user space on Windows. Added suport of IA64

0.0.10

  • Implemented getFreePhysicalMemory() and getTotalVirtualMemory() on Mac OS X

0.0.9

  • Fixed bug in detection of bitness of kernel on Linux

0.0.8

  • Detection of bitness of kernel on Linux are based on the found file formats of libc.so.*

0.0.7

  • Partial support of processor architecture statistics

0.0.6

  • Renamed method physicalMemoryFreeSize() to getFreePhysicalMemory()
  • Renamed method physicalMemoryTotalSize() to getTotalPhysicalMemory()
  • Renamed method virtualMemoryFreeSize() to getFreeVirtualMemory()
  • Renamed method virtualMemoryTotalSize() to getTotalVirtualMemory()

0.0.5

  • Partial support of phycical memory and virtual memory statistics

0.0.4

  • Fixed a bug when parsing comments in the file /boot/config on Linux

0.0.3

  • Changed the algorithm for detecting the number of physical processor sockets on Windows

0.0.1

  • Initial release

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add system_info2
pubspec.yaml
name: system_info2
version: 4.2.0
homepage: https://sysinfo.onepub.dev
documentation: https://sysinfo.onepub.dev
description: Provides easy access to useful information about the system (architecture, bitness, kernel, memory, operating system, CPU, user).
repository: https://github.com/onepub-dev/system_info
environment:
  sdk: '>=2.19.0 <4.0.0'
dependencies:
  globbing: ^1.0.0
  path: ^1.8.0
dev_dependencies:
  lint_hard: ^6.2.1
  test: ^1.24.0

Version history

VersionPublishedArchiveSHA-256
2.0.0On demandDownload4d2bf5e8…a3f676
2.0.1On demandDownloadbf274e9f…500b20
2.0.2On demandDownloade515bf22…f77618
2.0.3On demandDownload59d9d035…c67d9f
2.0.4On demandDownload90621f3b…22a886
3.0.0On demandDownload080e23ae…ab8d95
3.0.1On demandDownloade9a8b428…6b7704
3.0.2On demandDownloadaf2f948e…6d8bc9
4.0.0On demandDownload65206bbe…f3efc9
4.1.0Cached · Upstream SHA-256 matchedDownloadb937736e…65ac43
4.2.0Cached · Upstream SHA-256 matchedDownload2d5e586c…1a1541

Dependencies

globbing "^1.0.0"

path "^1.8.0"