Convert Uint32 into an array of 4 bytes Convert Uint32 into an array of 4 bytes dart dart

Convert Uint32 into an array of 4 bytes


Turns out the way to do so is to convert it into a Uint32List, then retrieve the byte buffer and convert it to the type you want.

int pixel = image.getPixel(x, y);Uint32List list = new Uint32List.fromList([pixel]);Uint8List byte_data = list.buffer.asUint8List();