fontWeight property
Implementation
@override
FontWeight get fontWeight {
if (_fontWeight != null) return _fontWeight!;
_ensureLayoutPassInheritedTextCache();
if (_layoutPassInheritedFontWeight != null) {
return _layoutPassInheritedFontWeight!;
}
final FontWeight resolved = parent?.fontWeight ?? FontWeight.w400;
if (_canUseLayoutPassInheritedTextCache) {
_layoutPassInheritedFontWeight = resolved;
}
return resolved;
}
set
fontWeight
(FontWeight? value)
Implementation
set fontWeight(FontWeight? value) {
if (_fontWeight == value) return;
_fontWeight = value;
// Update all the children text with specified style property not set due to style inheritance.
_markChildrenTextNeedsLayout(this, FONT_WEIGHT);
}