system_info2 4.0.0 copy "system_info2: ^4.0.0" to clipboard
system_info2: ^4.0.0 copied to clipboard

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

example/example.dart

import 'package:system_info2/system_info2.dart';

void main() {
  print('Kernel architecture     : ${SysInfo.kernelArchitecture}');
  print('Raw Kernel architecture : ${SysInfo.rawKernelArchitecture}');
  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}');
  final cores = SysInfo.cores;
  print('Number of core    : ${cores.length}');
  for (final core in cores) {
    print('  Architecture          : ${core.architecture}');
    print('  Name                  : ${core.name}');
    print('  Socket                : ${core.socket}');
    print('  Vendor                : ${core.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');
}

const int megaByte = 1024 * 1024;
57
likes
160
pub points
95%
popularity

Publisher

verified publisheronepub.dev

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

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

globbing, path

More

Packages that depend on system_info2