tap method
Taps the slider at given offset, in logical pixels, along the track.
Returns:
- true if the offset moves the min edge
- false if the offset moves the max edge
- null if the offset did not move either edge
The offset is relative to the origin defined by FSlider.layout.
Implementation
bool? tap(double offset) {
if (interaction == .slide || interaction == .slideThumb) {
return null;
}
if (_value case final value?) {
final min = switch (active) {
(min: true, max: true) when offset < value.pixels.min => true,
(min: true, max: true) when value.pixels.max < offset => false,
(min: true, max: false) => true,
(min: false, max: true) => false,
_ => null,
};
if (min != null) {
this.value = value.move(min: min, to: offset);
}
return min;
}
return null;
}