shouldRebuildWidget method
Whether the specific MathOptions parameters that this node directly depends upon have changed.
Subclasses should override this method. This method is used to determine whether certain widget rebuilds can be bypassed even when the MathOptions have changed.
Rebuild bypass is determined by the following process:
- If
oldOptions
==newOptions
, bypass - If shouldRebuildWidget, force rebuild
- Call buildWidget on children. If the results are identical to the the results returned by buildWidget called last time, then bypass.
Implementation
@override
bool shouldRebuildWidget(MathOptions oldOptions, MathOptions newOptions) =>
oldOptions.color != newOptions.color ||
oldOptions.mathFontOptions != newOptions.mathFontOptions ||
oldOptions.textFontOptions != newOptions.textFontOptions ||
oldOptions.sizeMultiplier != newOptions.sizeMultiplier;