init method
Initialize the device info service using the DeviceInfoPlugin.
Implementation
Future<void> init() async {
// early out if already initialized
if (initialized) return;
try {
if (Platform.isAndroid) {
deviceData = _parseAndroidDeviceInfo(
await _deviceInfoPlugin.androidInfo,
);
} else if (Platform.isIOS) {
deviceData = _parseIosDeviceInfo(await _deviceInfoPlugin.iosInfo);
}
} on Exception {
deviceData = {};
}
}