system_info_ml 1.0.0 copy "system_info_ml: ^1.0.0" to clipboard
system_info_ml: ^1.0.0 copied to clipboard

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

example/system_info_ml_example.dart

import 'package:system_info_ml/src/system_info.dart';

// ignore: constant_identifier_names
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");
}
1
likes
140
points
20
downloads

Publisher

verified publishermanichord.com

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

file_utils, path

More

Packages that depend on system_info_ml