Resolves #318 add mobile_app integration

This commit is contained in:
estevez-dev
2019-06-15 18:07:11 +03:00
parent e1d9d9f304
commit 5b99ade088
8 changed files with 168 additions and 47 deletions

29
lib/device.class.dart Normal file
View 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}";
});
}
}