initialFontSize method
Returns the font size of the first non-empty text in the span, or
defaultValue
if none.
Implementation
double initialFontSize(double defaultValue) {
return valueOfFirstDescendantOf(
this,
where: (s) => s is TextSpan && (s.text?.isNotEmpty ?? false),
defaultValue: defaultValue,
getValue: (s) => s is TextSpan ? s.style?.fontSize : null,
childrenOf: (s) => s is TextSpan ? s.children : null,
) ??
defaultValue;
}