encodeAlignmentGeometry static method

dynamic encodeAlignmentGeometry(
  1. AlignmentGeometry? value, {
  2. bool validate = true,
})

Encodes the given value to a String. This delegates to either encodeAlignment or encodeAlignmentDirectional

Implementation

static dynamic encodeAlignmentGeometry(
  AlignmentGeometry? value, {
  bool validate = true,
}) {
  dynamic result;

  if (value != null) {
    if (value is AlignmentDirectional) {
      result = encodeAlignmentDirectional(value);
    } else if (value is Alignment) {
      result = encodeAlignment(value);
    } else {
      throw Exception(
        'Unknown type of AlignmentGeometry encountered: ${value.runtimeType}.',
      );
    }
  }
  return result;
}