encodePointerDeviceKind static method

String? encodePointerDeviceKind(
  1. PointerDeviceKind? value
)

Encodes the value to a String. Supported values are:

  • invertedStylus
  • mouse
  • stylus
  • touch
  • trackpad
  • unknown

Implementation

static String? encodePointerDeviceKind(PointerDeviceKind? value) {
  String? result;

  if (value != null) {
    switch (value) {
      case PointerDeviceKind.invertedStylus:
        result = 'invertedStylus';
        break;
      case PointerDeviceKind.mouse:
        result = 'mouse';
        break;
      case PointerDeviceKind.stylus:
        result = 'stylus';
        break;
      case PointerDeviceKind.touch:
        result = 'touch';
        break;
      case PointerDeviceKind.trackpad:
        result = 'trackpad';
        break;
      case PointerDeviceKind.unknown:
        result = 'unknown';
        break;
    }
  }

  return result;
}