payloadTextStyle function

JsonMap payloadTextStyle({
  1. Color? color,
  2. double? fontSize,
  3. FontWeight? fontWeight,
  4. TextDecoration? decoration,
  5. double? height,
  6. double? letterSpacing,
})

Sparse TextStyle payload covering the fields producers emit.

Implementation

JsonMap payloadTextStyle({
  Color? color,
  double? fontSize,
  FontWeight? fontWeight,
  TextDecoration? decoration,
  double? height,
  double? letterSpacing,
}) {
  return {
    if (color != null) 'color': payloadColor(color),
    'fontSize': ?fontSize,
    if (fontWeight != null) 'fontWeight': payloadFontWeight(fontWeight),
    if (decoration != null) 'decoration': payloadTextDecoration(decoration),
    'height': ?height,
    'letterSpacing': ?letterSpacing,
  };
}