encodeShowValueIndicator static method

String? encodeShowValueIndicator(
  1. ShowValueIndicator? value
)

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

  • always
  • never
  • onlyForContinuous
  • onlyForDiscrete

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

Implementation

static String? encodeShowValueIndicator(ShowValueIndicator? value) {
  String? result;

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

      case ShowValueIndicator.never:
        result = 'never';
        break;

      case ShowValueIndicator.onlyForContinuous:
        result = 'onlyForContinuous';
        break;

      case ShowValueIndicator.onlyForDiscrete:
        result = 'onlyForDiscrete';
        break;
    }
  }

  return _stripDynamicNull(result);
}