onPanUpdate method

void onPanUpdate(
  1. DragUpdateDetails e,
  2. BoxConstraints constraints
)

Implementation

void onPanUpdate(DragUpdateDetails e, BoxConstraints constraints) {
  final percent = e.localPosition.dx / constraints.maxWidth;
  setState(() {
    tapped = true;
    slider = percent.clamp(0.0, 1.0);
  });
}