fromValue static method

SystemSoundID fromValue(
  1. int value
)

Looks up a sound by its raw SystemSoundID.value.

Throws an ArgumentError when unknown; use tryFromValue instead if unknown values should be tolerated.

Implementation

static SystemSoundID fromValue(int value) {
  final sound = tryFromValue(value);
  if (sound == null) {
    throw ArgumentError.value(
      value,
      'value',
      'Unknown SystemSoundID. Use '
          'IosSystemSound().playRawId($value) to play unsupported IDs.',
    );
  }
  return sound;
}