fromStringValue static method

GiphyDirection fromStringValue(
  1. String value
)

Converts a string value to a corresponding GiphyDirection enum value.

Throws an ArgumentError if the given string does not match any GiphyDirection values.

value The string representation of the direction.

Returns the matching GiphyDirection value.

Implementation

static GiphyDirection fromStringValue(String value) {
  switch (value) {
    case 'horizontal':
      return GiphyDirection.horizontal;
    case 'vertical':
      return GiphyDirection.vertical;
    default:
      throw ArgumentError('Unknown GiphyDirection value: $value');
  }
}