getInfo method
Implementation
Future<Map<String, dynamic>?> getInfo() async {
if (_deviceData != null && _deviceData!.keys.isEmpty == false) {
return _deviceData;
}
Map<String, dynamic>? deviceData;
try {
if (Platform.isAndroid) {
deviceData = _readAndroidBuildData(await deviceInfoPlugin.androidInfo);
} else if (Platform.isIOS) {
deviceData = _readIosDeviceInfo(await deviceInfoPlugin.iosInfo);
}
} on PlatformException {
deviceData = <String, dynamic>{
'Error:': 'Failed to get platform version.'
};
FLog.logThis(
className: runtimeType.toString(),
methodName: "getInfo",
text: "error in getInfo",
type: LogLevel.SEVERE,
exception: PlatformException(code: "code"),
stacktrace: StackTrace.current);
}
_deviceData = deviceData;
return _deviceData;
}