fromInt function

PacketType fromInt(
  1. int value
)

Converts an integer to a PacketType

Implementation

PacketType fromInt(int value) {
  for (PacketType type in PacketType.values) {
    if (type.index == value) return type;
  }
  return PacketType.none;
}