runWithComponent<T> static method
Implementation
static T runWithComponent<T>(Component component, T Function() fn) {
final previous = _currentComponent;
_currentComponent = component;
try {
return fn();
} finally {
_currentComponent = previous;
}
// NOTE: DON'T touch _runtime, keep parent context
}