encodeWrapAlignment static method

String? encodeWrapAlignment(
  1. WrapAlignment? value
)

Encodes the given value to the String representation. Supported values are:

  • center
  • end
  • spaceAround
  • spaceBetween
  • spaceEvenly
  • start

All other values, including null, will result in null.

Implementation

static String? encodeWrapAlignment(WrapAlignment? value) {
  String? result;

  if (value != null) {
    switch (value) {
      case WrapAlignment.center:
        result = 'center';
        break;
      case WrapAlignment.end:
        result = 'end';
        break;
      case WrapAlignment.spaceAround:
        result = 'spaceAround';
        break;
      case WrapAlignment.spaceBetween:
        result = 'spaceBetween';
        break;
      case WrapAlignment.spaceEvenly:
        result = 'spaceEvenly';
        break;
      case WrapAlignment.start:
        result = 'start';
        break;
    }
  }

  return result;
}