Building a custom MaterialProperty

I wanted to look at building a custom material property. It would be similar to the PolylineArrowMaterialProperty. The difference would be that it would draw arrows at both ends.

Looking at the source code for PolylineArrowMaterialProperty, I see the getValue function, which I understand to be the important function. In this case, it looks like it returns a color.

What I am not sure about is where I can find the definition of what the result object should look like. Is the result object standard between all MaterialProperties? Is the result object custom to a specific MaterialProperty?

How is the actual drawing done? Who uses the PolylineArrowMaterialProperty and the result from getValue do draw? Is there a related class to PolylineArrowMaterialProperty that draws the arrow?

Any information about how the code is laid out and the general code paths or important files to know about to look at would be useful.

If there are any blog posts, videos, etc. showing how someone built a custom MaterialProperty, that would be useful as well.