strutStyle static method

StrutStyle? strutStyle(
  1. DataSource source,
  2. List<Object> key
)

Returns a StrutStyle from the specified map.

If the map is absent, returns null.

Otherwise (even if it has no keys), the StrutStyle is created from the following keys: 'fontFamily(string),fontFamilyFallback([list] of [string]),fontSize(double),height(double),leadingDistribution([enumValue] of [TextLeadingDistribution]),leading(double),fontWeight([enumValue] of [FontWeight]),fontStyle([enumValue] of [FontStyle]),forceStrutHeight` (boolean).

Implementation

static StrutStyle? strutStyle(DataSource source, List<Object> key) {
  if (!source.isMap(key)) {
    return null;
  }
  return StrutStyle(
    fontFamily: source.v<String>([...key, 'fontFamily']),
    fontFamilyFallback: list<String>(source, [...key, 'fontFamilyFallback'], string),
    fontSize: source.v<double>([...key, 'fontSize']),
    height: source.v<double>([...key, 'height']),
    leadingDistribution: enumValue<TextLeadingDistribution>(TextLeadingDistribution.values, source, [...key, 'leadingDistribution']),
    leading: source.v<double>([...key, 'leading']),
    fontWeight: enumValue<FontWeight>(FontWeight.values, source, [...key, 'fontWeight']),
    fontStyle: enumValue<FontStyle>(FontStyle.values, source, [...key, 'fontStyle']),
    forceStrutHeight: source.v<bool>([...key, 'forceStrutHeight']),
  );
}