parse static method

BuildPlatform parse(
  1. String value
)

Parses a string into a BuildPlatform.

Throws a ValidationException if value does not match a supported platform.

Implementation

static BuildPlatform parse(String value) {
  switch (value.trim().toLowerCase()) {
    case 'android':
      return BuildPlatform.android;
    case 'ios':
      return BuildPlatform.ios;
    case 'all':
      return BuildPlatform.all;
    default:
      throw ValidationException(
        'Unknown or unsupported platform: "$value". Allowed platforms: android, ios, all.',
      );
  }
}