Uint8List intToUint8List(int i) { var bytes = ByteData(4); bytes.setInt32(0, i, Endian.big); return bytes.buffer.asUint8List(); }