Skip to content

Instantly share code, notes, and snippets.

@lironhl
Last active August 2, 2020 18:27
Show Gist options
  • Save lironhl/afe615485d0cb37b5b3ffeb5f1569656 to your computer and use it in GitHub Desktop.
Save lironhl/afe615485d0cb37b5b3ffeb5f1569656 to your computer and use it in GitHub Desktop.
A proposed fix for https://gist.github.com/slightfoot/094657bb22e986bbb4c9bafd9841cbd8, Dart (Flutter) and Sentry example.
//...
Map<dynamic, dynamic> deviceInfo = {};
if (defaultTargetPlatform == TargetPlatform.android) {
deviceInfo = await DeviceInfoPlugin.channel.invokeMethod('getAndroidDeviceInfo');
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
deviceInfo = await DeviceInfoPlugin.channel.invokeMethod('getIosDeviceInfo');
}
extra['device_info'] = deviceInfo.map((key, value) => MapEntry(key.toString(), value.toString()));
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment