platform property

String get platform

android or ios. Throws for unsupported platforms.

Implementation

String get platform {
  if (targetPlatform.startsWith('android')) return 'android';
  if (targetPlatform == 'ios') return 'ios';
  throw StateError(
    'Unsupported Flutter target platform "$targetPlatform" for device $id.',
  );
}