onHover method

void onHover(
  1. PointerHoverEvent e,
  2. BoxConstraints constraints
)

Implementation

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