system_info 0.0.16

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 66

system_info

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

Version: 0.0.16

Warning! Not tested on Mac OS X! Warning! Not tested on Linux ARM!

Basic examples:

if (SysInfo.operatingSystemName == "Ubuntu") {
  log.info("We love Ubuntu users");
}
if (SysInfo.userSpaceBitness == 32) {
  log.info("Dart VM runs as a 32-bit process");
}

Common information:

import "package:system_info/system_info.dart";

const int MEGABYTE = 1024 * 1024;

void main() {
  print("Kernel architecture     : ${SysInfo.kernelArchitecture}");
  print("Kernel bitness          : ${SysInfo.kernelBitness}");
  print("Kernel name             : ${SysInfo.kernelName}");
  print("Kernel version          : ${SysInfo.kernelVersion}");
  print("Operating system name   : ${SysInfo.operatingSystemName}");
  print("Operating system version: ${SysInfo.operatingSystemVersion}");
  print("User directory          : ${SysInfo.userDirectory}");
  print("User id                 : ${SysInfo.userId}");
  print("User name               : ${SysInfo.userName}");
  print("User space bitness      : ${SysInfo.userSpaceBitness}");
  var processors = SysInfo.processors;
  print("Number of processors    : ${processors.length}");
  for (var processor in processors) {
    print("  Architecture          : ${processor.architecture}");
    print("  Name                  : ${processor.name}");
    print("  Socket                : ${processor.socket}");
    print("  Vendor                : ${processor.vendor}");
  }
  print("Total physical memory   : ${SysInfo.getTotalPhysicalMemory() ~/ MEGABYTE} MB");
  print("Free physical memory    : ${SysInfo.getFreePhysicalMemory() ~/ MEGABYTE} MB");
  print("Total virtual memory    : ${SysInfo.getTotalVirtualMemory() ~/ MEGABYTE} MB");
  print("Free virtual memory     : ${SysInfo.getFreeVirtualMemory() ~/ MEGABYTE} MB");
  print("Virtual memory size     : ${SysInfo.getVirtualMemorySize() ~/ MEGABYTE} MB");
}

Output:

Kernel architecture     : i686
Kernel bitness          : 32
Kernel name             : Linux
Kernel version          : 3.13.0-43-generic
Operating system name   : Ubuntu
Operating system version: 14.04
User directory          : /home/andrew
User id                 : 1000
User name               : andrew
User space bitness      : 32
Number of processors    : 2
  Architecture          : X86_64
  Name                  : AMD Athlon(tm) II X2 240 Processor
  Socket                : 0
  Vendor                : AuthenticAMD
  Architecture          : X86_64
  Name                  : AMD Athlon(tm) II X2 240 Processor
  Socket                : 0
  Vendor                : AuthenticAMD
Total physical memory   : 3782 MB
Free physical memory    : 385 MB
Total virtual memory    : 7651 MB
Free virtual memory     : 4249 MB

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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  system_info: "^0.0.16"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:system_info/system_info.dart';
  
Version Uploaded Documentation Archive
0.0.16 Jun 20, 2015 Go to the documentation of system_info 0.0.16 Download system_info 0.0.16 archive
0.0.15 Jun 16, 2015 Go to the documentation of system_info 0.0.15 Download system_info 0.0.15 archive
0.0.14 Feb 26, 2015 Go to the documentation of system_info 0.0.14 Download system_info 0.0.14 archive
0.0.12 Jan 1, 2015 Go to the documentation of system_info 0.0.12 Download system_info 0.0.12 archive
0.0.11 Dec 20, 2014 Go to the documentation of system_info 0.0.11 Download system_info 0.0.11 archive
0.0.10 Dec 18, 2014 Go to the documentation of system_info 0.0.10 Download system_info 0.0.10 archive
0.0.9 Dec 18, 2014 Go to the documentation of system_info 0.0.9 Download system_info 0.0.9 archive
0.0.8 Dec 17, 2014 Go to the documentation of system_info 0.0.8 Download system_info 0.0.8 archive
0.0.6 Dec 16, 2014 Go to the documentation of system_info 0.0.6 Download system_info 0.0.6 archive
0.0.5 Dec 14, 2014 Go to the documentation of system_info 0.0.5 Download system_info 0.0.5 archive

All 11 versions...

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
73 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
66
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:system_info/system_info.dart with components: io.

Suggestions

  • Use constrained dependencies.

    The pubspec.yaml contains 2 dependencies without version constraints. Specify version ranges for the following dependencies: file_utils, path.

  • Package is too old.

    The package was released more than two years ago.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use system_info.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 hints.

    Run dartfmt to format lib/src/fluent.dart.

    Run dartfmt to format lib/src/system_info.dart.

    Similar analysis of the following files failed:

    • lib/src/utils.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
file_utils any 0.0.23
path any 1.6.1
Transitive dependencies
globbing 0.1.20
Dev dependencies
build_tools any