resetForTest static method

  1. @visibleForTesting
void resetForTest()

Resets singleton state for widget tests. Call from addTearDown.

Implementation

@visibleForTesting
static void resetForTest() {
  instance._notifyPointerScheduled = false;
  instance._ringsAllowed = false;
  // Re-bind key handler in case the test binding cleared handlers.
  HardwareKeyboard.instance.removeHandler(instance._handleKeyEvent);
  HardwareKeyboard.instance.addHandler(instance._handleKeyEvent);
  instance.notifyListeners();
}