textHeightBehavior static method
Returns a TextHeightBehavior from the specified map.
If the map is absent, returns null.
Otherwise (even if it has no keys), the TextHeightBehavior is created
from the following keys: 'applyHeightToFirstAscent(boolean; defaults to true),
applyHeightToLastDescent(boolean, defaults to true), and
leadingDistribution` (enumValue of TextLeadingDistribution, deafults
to TextLeadingDistribution.proportional).
Implementation
static TextHeightBehavior? textHeightBehavior(DataSource source, List<Object> key) {
if (!source.isMap(key)) {
return null;
}
return TextHeightBehavior(
applyHeightToFirstAscent: source.v<bool>([...key, 'applyHeightToFirstAscent']) ?? true,
applyHeightToLastDescent: source.v<bool>([...key, 'applyHeightToLastDescent']) ?? true,
leadingDistribution: enumValue<TextLeadingDistribution>(TextLeadingDistribution.values, source, [...key, 'leadingDistribution']) ?? TextLeadingDistribution.proportional,
);
}