Resolves #318 add mobile_app integration
This commit is contained in:
29
lib/device.class.dart
Normal file
29
lib/device.class.dart
Normal file
@ -0,0 +1,29 @@
|
||||
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}";
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user