notePointerInteraction method

void notePointerInteraction({
  1. bool immediate = false,
})

Call when a pointer interaction starts so rings hide until keyboard nav.

immediate notifies listeners in this event. Press uses a deferred notification so a rebuild cannot cancel an in-progress tap.

Implementation

void notePointerInteraction({bool immediate = false}) {
  if (!_ringsAllowed) {
    return;
  }
  _ringsAllowed = false;
  if (immediate) {
    notifyListeners();
    return;
  }
  if (_notifyPointerScheduled) {
    return;
  }
  _notifyPointerScheduled = true;
  WidgetsBinding.instance.addPostFrameCallback((_) {
    _notifyPointerScheduled = false;
    if (!_ringsAllowed) {
      notifyListeners();
    }
  });
}