encodeFontStyle static method

String? encodeFontStyle(
  1. FontStyle? value
)

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

  • italic
  • normal

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

Implementation

static String? encodeFontStyle(FontStyle? value) {
  String? result;

  if (value != null) {
    switch (value) {
      case FontStyle.italic:
        result = 'italic';
        break;

      case FontStyle.normal:
        result = 'normal';
        break;
    }
  }

  return _stripDynamicNull(result);
}