onPanDown method

void onPanDown(
  1. DragDownDetails e,
  2. BoxConstraints constraints
)

Implementation

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