withAutoWatchKeys static method
Register a callback used to generate keys for watch functions.
The function fn
is called with generateWatchKey
in-effect as the
generate watch key function, which is called whenever autoWatchKey
is called within fn
.
Implementation
static void withAutoWatchKeys(GenerateWatchKey generateWatchKey, void Function() fn) {
final previous = _generateWatchKey;
try {
_generateWatchKey = generateWatchKey;
fn();
}
finally {
_generateWatchKey = previous;
}
}