update method
Updates the element with a new widget configuration.
This couples the internal CoralCoupler to the new widget's Coral pipeline.
newWidget: The new widget configuration.
Ensures:
- The internal coupler is bound to the new widget's coral.
- If the element is marked dirty, a rebuild is scheduled.
Implementation
@override
void update(covariant CoralWidget newWidget) {
try {
if (_coupler.couple(newWidget.coral) != null) {
_flushDependencies();
}
} catch (error, stackTrace) {
Zone.current.handleUncaughtError(error, stackTrace);
}
super.update(newWidget);
if (dirty) {
rebuild();
}
}