fromCode function Null safety

  1. @protected
WinEvent fromCode(
  1. int code
)

Returns the WinEvent for the given code.

Implementation

@protected
WinEvent fromCode(int code) {
  switch (code) {
    case 0x0400:
      return WinEvent.select;
    case 0x007b:
      return WinEvent.contextMenu;
    case 0x0200:
      return WinEvent.mouseMove;
    case 0x0201:
      return WinEvent.leftButtonDown;
    case 0x0202:
      return WinEvent.leftButtonUp;
    case 0x0203:
      return WinEvent.leftButtonDoubleClick;
    case 0x0204:
      return WinEvent.rightButtonDown;
    case 0x0205:
      return WinEvent.rightButtonUp;
    case 0x0206:
      return WinEvent.rightButtonDoubleClick;
    case 0x0207:
      return WinEvent.middleButtonDown;
    case 0x0208:
      return WinEvent.middleButtonUp;
    case 0x0209:
      return WinEvent.middleButtonDoubleClick;
  }
  throw ArgumentError.value(code, "code", "Unknown code");
}