shaderCallback property

ShaderCallback? shaderCallback
final

Called to get the gradient color for the bar pointer.

Defaults to null.

This snippet shows how to use a shaderCallback to get the colors for bar pointer.


LinearBarPointer(
 shaderCallback: (Rect bounds) {
 return LinearGradient(colors: [
 Color(0xffE8DA5D),
 Color(0xffFB7D55),
 ], stops: <double>[
 0.4,
 0.9
 ]).createShader(bounds);
 )

Implementation

final ShaderCallback? shaderCallback;