textHeightBehavior static method

Map<String, dynamic>? textHeightBehavior(
  1. TextHeightBehavior? behavior
)

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), andleadingDistribution` (enumValue of TextLeadingDistribution, deafults to TextLeadingDistribution.proportional).

Implementation

static Map<String, dynamic>? textHeightBehavior(
    TextHeightBehavior? behavior) {
  if (behavior == null) return null;
  return NotNullMap.from({
    'applyHeightToFirstAscent': behavior.applyHeightToFirstAscent,
    'applyHeightToLastDescent': behavior.applyHeightToLastDescent,
    'leadingDistribution': enumValue(behavior.leadingDistribution),
  });
}