twoByteToInt16 function

int twoByteToInt16(
  1. int v1,
  2. int v2
)

Convert two byte length int values to an int value, for example a byte of [00000001, 00000010] -> 258

Implementation

int twoByteToInt16(int v1, int v2) =>
    Uint8List.fromList([v1, v2]).buffer.asByteData().getUint16(0);