This repository has been archived on 2023-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/lib/device.class.dart
2019-06-15 18:07:11 +03:00

29 lines
673 B
Dart

part of 'main.dart';
class Device {
static final Device _instance = Device._internal();
factory Device() {
return _instance;
}
String unicDeviceId;
String manufacturer;
String model;
String osName;
String osVersion;
Device._internal();
loadDeviceInfo() {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
deviceInfo.androidInfo.then((androidInfo) {
unicDeviceId = "${androidInfo.model.toLowerCase().replaceAll(' ', '_')}_${androidInfo.androidId}";
manufacturer = "${androidInfo.manufacturer}";
model = "${androidInfo.model}";
osName = "Android";
osVersion = "${androidInfo.version.release}";
});
}
}