fromJson method

  1. @override
TextAlign? fromJson(
  1. String? json
)
override

Implementation

@override
TextAlign? fromJson(String? json) {
  if (json == null) return null;

  switch (json) {
    case 'center':
      return TextAlign.center;

    case 'end':
      return TextAlign.end;

    case 'justify':
      return TextAlign.justify;

    case 'left':
      return TextAlign.left;

    case 'right':
      return TextAlign.right;

    case 'start':
      return TextAlign.start;
  }

  throw 'Unsuported_Json_Value';
}