initPlatformState method
Implementation
Future<Map<String, dynamic>> initPlatformState() async {
var deviceData = <String, dynamic>{};
try {
if (Platform.isAndroid) {
deviceData =
androidDeviceInfos(await deviceInfoPlugin.androidInfo);
} else if (Platform.isIOS) {
deviceData = iosDeviceInfos(await deviceInfoPlugin.iosInfo);
}
} on PlatformException {
deviceData = <String, dynamic>{
'Error:': 'Failed to get platform version.'
};
}
deviceData["ddvc"] = await getAppVersion();//applicationVersion
//to be updated with release
deviceData["ddv"] = "3.1.0"; //SDK version
deviceData["inte"] = "Flutter-Dio";
_deviceData = deviceData;
return deviceData;
}