onEnter method

void onEnter(
  1. PointerEnterEvent e,
  2. BoxConstraints constraints
)

Implementation

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