decode static method

TextAlign? decode(
  1. dynamic json
)

Implementation

static TextAlign? decode(dynamic json) {
  if (json == null) {
    return null;
  }
  if (json is! String) {
    return null;
  }

  switch (json) {
    case 'NATURAL':
      return TextAlign.NATURAL;
    case 'LEFT':
      return TextAlign.LEFT;
    case 'CENTER':
      return TextAlign.CENTER;
    case 'RIGHT':
      return TextAlign.RIGHT;
    default:
      return TextAlign.UNKNOWN;
  }
}