I want to draw the different pattern in the flutter like this
Although this code is javascript is given in this link
See Question&Answers more detail:osI used ImageShader and used shader property of Paint Function device transform is used to get the device pixel so that it can render the effect This is my paint method look like...
final double devicePixelRatio = ui.window.devicePixelRatio;
@override
void paint(Canvas canvas, Size size) {
final Float64List deviceTransform = new Float64List(16)
..[0] = devicePixelRatio
..[5] = devicePixelRatio
..[10] = 1.0
..[15] = 2.0;
Float64List matrix = new Float64List(16);
print('matrix is $matrix');
print('image is coming in paint $image');
Paint paint = new Paint()
..style = PaintingStyle.stroke
..strokeCap = StrokeCap.round
..shader = ImageShader(
image, TileMode.repeated, TileMode.repeated, deviceTransform)
..strokeWidth = 40.2;
paths.forEach((path) {
canvas.drawPath(path, paint);
});
repaint = false;
}