SystemInfo constructor
SystemInfo()
Empty constructor, this loads all the information from /proc/version
and from /etc/os-release
Implementation
SystemInfo() {
var content = File('/proc/version').readAsStringSync();
kernel_name = content.split(' ')[0];
kernel_version = content.split(' ')[2];
var lines = File('/etc/os-release').readAsLinesSync();
os_release = <String, String>{};
for (var e in lines) {
var data = e.split('=');
os_release[data[0]] = data[1].replaceAll('\"', '');
}
os_name = os_release['NAME'] ?? '';
os_version = os_release['VERSION_ID'] ?? '';
}