fromString static method

BuildPlatform fromString(
  1. String value
)

Creates a build platform from the provided value.

Throws an ArgumentError when the value does not represent a supported build platform.

Implementation

static BuildPlatform fromString(String value) {
  return switch (value.toLowerCase()) {
    'apk' => BuildPlatform.apk,
    'aab' => BuildPlatform.aab,
    'ipa' => BuildPlatform.ipa,
    'web' => BuildPlatform.web,
    _ => throw ArgumentError(
        'Unsupported build platform: $value',
      ),
  };
}