define<O> method

void define<O>(
  1. String key,
  2. O instantiator(), [
  3. bool cacheValidator(
    1. Object o
    )?
])

Defines instantiator and cache-validator for key.

Implementation

void define<O>(String key, O Function() instantiator,
    [bool Function(Object o)? cacheValidator]) {
  _cacheInstantiators[key] = instantiator;
  if (cacheValidator != null) {
    _cacheValidators[key] = cacheValidator;
  }
}