How do I create a zigzag curved line using custom painter?

I am trying to currently create a zig zag curved line using flutter and place item on top of it.
I know that I will have create custom render objects for this. I can work with renderboxes but I am having a hard time drawing the line. I have attached an image of what I am trying to create.

You don’t need a custom render object, that’s a little overkill. CustomPainter + some math should work well enough.