setDownInfo method
- PointerEvent event,
- Offset newLocation, {
- int? buttons,
If a custom event is created outside of this class, this function is used to set the isDown.
Implementation
bool setDownInfo(
PointerEvent event,
Offset newLocation, {
int? buttons,
}) {
_location = newLocation;
if (buttons != null) {
_buttons = buttons;
}
switch (event.runtimeType) {
case const (PointerDownEvent):
assert(!isDown);
_isDown = true;
case const (PointerUpEvent):
case const (PointerCancelEvent):
assert(isDown);
_isDown = false;
default:
break;
}
return isDown;
}