fromJson method

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

Implementation

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

  switch (json) {
    case 'bottomCenter':
      return Alignment.bottomCenter;

    case 'bottomLeft':
      return Alignment.bottomLeft;

    case 'bottomRight':
      return Alignment.bottomRight;

    case 'center':
      return Alignment.center;

    case 'centerLeft':
      return Alignment.centerLeft;

    case 'centerRight':
      return Alignment.centerRight;

    case 'topCenter':
      return Alignment.topCenter;

    case 'topLeft':
      return Alignment.topLeft;

    case 'topRight':
      return Alignment.topRight;
  }

  throw 'Unsuported_Json_Value';
}