getSystemInfo function

Map<String, dynamic> getSystemInfo(
  1. Map<String, dynamic> webViewSystemInfo
)

Implementation

Map<String, dynamic> getSystemInfo(Map<String, dynamic> webViewSystemInfo) {
  final platform = defaultTargetPlatform == TargetPlatform.iOS
      ? 'ios'
      : defaultTargetPlatform == TargetPlatform.android
          ? 'android'
          : 'unknown';
  final screen = getScreenSize();
  return {
    'platform': platform,
    'os': webViewSystemInfo['os'] ?? platform,
    'browser': webViewSystemInfo['browser'] ?? 'WebView',
    'browser_version': webViewSystemInfo['browser_version'],
    'browser_language': webViewSystemInfo['browser_language'],
    'sdk_version': sdkVersion,
    'device': getDeviceType(),
    'screen_size': {'width': screen.width, 'height': screen.height},
  };
}