globalMouse function

HtmlMouse globalMouse(
  1. SyncFn syncFn
)

Returns the globally used HtmlMouse in Html based tests.

Implementation

HtmlMouse globalMouse(SyncFn<dynamic> syncFn) {
  assert(syncFn != null);
  // [SyncFn] may change based on when this function is called.
  // If it does change, we need to create a new [HtmlMouse] since this
  // indicates the scope of the [HtmlMouse] is outdated.
  if (_cachedSyncFn == null || _cachedSyncFn != syncFn) {
    _cachedSyncFn = syncFn;
    _globalMouse = HtmlMouse(_cachedSyncFn!);
  }
  return _globalMouse;
}