TextAlignment.fromJson constructor

TextAlignment.fromJson(
  1. dynamic data
)

Creates a TextAlignment instance from a JSON representation.

Implementation

TextAlignment.fromJson(dynamic data) {
  switch (data) {
    case "Left":
    case "Center":
    case "Right":
      _value = data;
      break;
    default:
      throw Exception('Unknown enum value to decode: $data');
  }
}