system_info_fetch 0.0.0 system_info_fetch: ^0.0.0 copied to clipboard
A library for get system info detail like ram or proccesor ram in dart support client side and server side.
System info fetch #
import 'package:system_info_fetch/system_info_fetch.dart';
void main() {
var message = "";
message += '\nKernel architecture : ${SysInfo.kernelArchitecture}';
message += '\nKernel bitness : ${SysInfo.kernelBitness}';
message += '\nKernel name : ${SysInfo.kernelName}';
message += '\nKernel version : ${SysInfo.kernelVersion}';
message += '\nOperating system name : ${SysInfo.operatingSystemName}';
message += '\nOperating system version: ${SysInfo.operatingSystemVersion}';
message += '\nUser directory : ${SysInfo.userDirectory}';
message += '\nUser id : ${SysInfo.userId}';
message += '\nUser name : ${SysInfo.userName}';
message += '\nUser space bitness : ${SysInfo.userSpaceBitness}';
final processors = SysInfo.processors;
message += '\nNumber of processors : ${processors.length}';
message += '\n Architecture : ${processors.first.architecture}';
message += '\n Name : ${processors.first.name}';
message += '\n Socket : ${processors.first.socket}';
message += '\n Vendor : ${processors.first.vendor}';
message += '\nTotal physical memory : ${SysInfo.getTotalPhysicalMemory() ~/ MEGABYTE} MB';
message += '\nFree physical memory : ${SysInfo.getFreePhysicalMemory() ~/ MEGABYTE} MB';
message += '\nTotal virtual memory : ${SysInfo.getTotalVirtualMemory() ~/ MEGABYTE} MB';
message += '\nFree virtual memory : ${SysInfo.getFreeVirtualMemory() ~/ MEGABYTE} MB';
message += '\nVirtual memory size : ${SysInfo.getVirtualMemorySize() ~/ MEGABYTE} MB';
print(message);
}
const int MEGABYTE = 1024 * 1024;
result
Kernel architecture : x86_64
Kernel bitness : 64
Kernel name : Linux
Kernel version : 5.19.0-051900-generic
Operating system name : Ubuntu
Operating system version: 20.04
User directory : /home/hexaminate
User id : 1000
User name : hexaminate
User space bitness : 64
Number of processors : 12
Architecture : X86_64
Name : AMD Ryzen 5 5500U with Radeon Graphics
Socket : 0
Vendor : AuthenticAMD
Total physical memory : 7303 MB
Free physical memory : 167 MB
Total virtual memory : 9351 MB
Free virtual memory : 2198 MB
Virtual memory size : 234 MB