precache method

  1. @Deprecated('Use FinderBase.tryFind or FinderBase.runCached instead. ' 'Using the FinderBase API allows for more consistent caching behavior and cleaner options for interacting with the widget tree. ' 'This feature was deprecated after v3.13.0-0.2.pre.')
bool precache()
inherited

Attempts to evaluate the finder. Returns whether any elements in the tree matched the finder. If any did, then the result is cached and can be obtained from evaluate.

If this returns true, you must call evaluate before you call precache again.

Implementation

@Deprecated(
  'Use FinderBase.tryFind or FinderBase.runCached instead. '
  'Using the FinderBase API allows for more consistent caching behavior and cleaner options for interacting with the widget tree. '
  'This feature was deprecated after v3.13.0-0.2.pre.'
)
bool precache() {
  assert(_precacheResults == null);
  if (tryEvaluate()) {
    return true;
  }
  _precacheResults = null;
  return false;
}