StackTextStrutStyle.fromJson constructor

StackTextStrutStyle.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory StackTextStrutStyle.fromJson(Map<String, dynamic> data) {
  return StackTextStrutStyle(
    fontFamily: asNullT<String?>(data['fontFamily']),
    fontFamilyFallback:
        asNullT<String?>(data['fontFamilyFallback'])?.split(','),
    fontSize: asNullT<double?>(data['fontSize']),
    height: asNullT<double?>(data['height']),
    leadingDistribution: ExEnum.tryParse<TextLeadingDistribution>(
        TextLeadingDistribution.values,
        asNullT<String?>(data['leadingDistribution'])),
    leading: asNullT<double?>(data['leading']),
    fontWeight: ExEnum.tryParse<FontWeight>(
        FontWeight.values, asNullT<String?>(data['fontWeight'])),
    fontStyle: ExEnum.tryParse<FontStyle>(
        FontStyle.values, asNullT<String?>(data['fontStyle'])),
    forceStrutHeight: asNullT<bool?>(data['forceStrutHeight']),
  );
}