encodeTextDecoration static method

String? encodeTextDecoration(
  1. TextDecoration? value
)

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

  • lineThrough
  • none
  • overline
  • underline

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

Implementation

static String? encodeTextDecoration(TextDecoration? value) {
  String? result;

  if (value != null) {
    if (value == TextDecoration.lineThrough) {
      result = 'lineThrough';
    } else if (value == TextDecoration.none) {
      result = 'none';
    } else if (value == TextDecoration.overline) {
      result = 'overline';
    } else if (value == TextDecoration.underline) {
      result = 'underline';
    }
  }

  return result;
}