getClientPlatform static method

String getClientPlatform()

Returns the current platform identifier.

Possible values: "android", "ios", "macos", "windows", "linux", "web". Web clients (browser) should pass "web" or "mobile_web" manually via custom metadata.

Implementation

static String getClientPlatform() {
  if (kIsWeb) return 'web';
  if (Platform.isAndroid) return 'android';
  if (Platform.isIOS) return 'ios';
  if (Platform.isMacOS) return 'macos';
  if (Platform.isWindows) return 'windows';
  if (Platform.isLinux) return 'linux';
  return 'unknown';
}