dragBehavior property

LinearMarkerDragBehavior dragBehavior
final

Specifies the drag behavior for the pointer.

Defaults to LinearMarkerDragBehavior.free.

double _startMarkerValue = 30.0;
double _endMarkerValue = 60.0;

@override
Widget build(BuildContext context) {
  return MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text('Drag behavior'),
      ),
      body: SfLinearGauge(
        markerPointers: [
          LinearShapePointer(
            value: _startMarkerValue,
            dragBehavior: LinearMarkerDragBehavior.constrained,
            onChanged: (double value) {
              setState(() {
                _startMarkerValue = value;
              });
            },
          ),
          LinearShapePointer(
            value: _endMarkerValue,
            onChanged: (double value) {
              setState(() {
                _endMarkerValue = value;
              });
            },
          )
        ],
      ),
    ),
  );
}

Implementation

final LinearMarkerDragBehavior dragBehavior;