getDeviceType method

String getDeviceType(
  1. PointerDeviceKind kind
)

Implementation

String getDeviceType(PointerDeviceKind kind) {
  switch (kind) {
    case PointerDeviceKind.touch:
      return 'touch';//'触摸屏';
    case PointerDeviceKind.mouse:
      return 'mouse';//'鼠标';
    case PointerDeviceKind.stylus:
      return 'stylus';//'触控笔';
    case PointerDeviceKind.unknown:
      return 'unknown';//'未知设备';
    case PointerDeviceKind.invertedStylus:
      return 'invertedStylus';//'反转触控笔';
    default:
      return 'other';//'其他设备';
  }
}