getDeviceInfo method
Implementation
Future<String> getDeviceInfo() async {
String info = "";
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
info += androidInfo.isPhysicalDevice.toString();
info += androidInfo.brand.toString();
info += androidInfo.bootloader.toString();
info += androidInfo.model.toString();
info += androidInfo.displayMetrics.toString();
info += androidInfo.version.toString();
info += androidInfo.host.toString();
info += androidInfo.board.toString();
}
if (Platform.isIOS) {
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
info += iosInfo.isPhysicalDevice.toString();
info += iosInfo.utsname.toString();
info += iosInfo.name.toString();
info += iosInfo.model.toString();
info += iosInfo.identifierForVendor.toString();
info += iosInfo.systemVersion.toString();
}
if (Platform.isWindows) {
WindowsDeviceInfo windowsDeviceInfo = await deviceInfo.windowsInfo;
info += windowsDeviceInfo.productName.toString();
info += windowsDeviceInfo.buildLab.toString();
info += windowsDeviceInfo.computerName.toString();
info += windowsDeviceInfo.csdVersion.toString();
info += windowsDeviceInfo.productType.toString();
info += windowsDeviceInfo.userName.toString();
info += windowsDeviceInfo.systemMemoryInMegabytes.toString();
info += windowsDeviceInfo.releaseId.toString();
}
return info;
}