dispatchRect method
Implementation
@override
Uint8List dispatchRect(Uint8List data, int width, int height, Rect rect) {
final newByte = Uint8List.fromList(data);
final random = math.Random();
final rand = random.nextInt(4) + 3;
for (int startH = rect.top; startH < rect.bottom; startH++) {
for (int startW = rect.left; startW < rect.right; startW++) {
final index = startH * width + startW;
newByte[index] = (newByte[index] * rand);
}
}
return newByte;
}