exportTextStyle function

Map<String, dynamic>? exportTextStyle(
  1. TextStyle? textStyle
)

Implementation

Map<String, dynamic>? exportTextStyle(TextStyle? textStyle) {
  if (textStyle == null) {
    return null;
  }

  return <String, dynamic>{
    "color": textStyle.color != null
        ? textStyle.color!.value.toRadixString(16)
        : null,
    "debugLabel": textStyle.debugLabel,
    "decoration": exportTextDecoration(textStyle.decoration),
    "fontSize": textStyle.fontSize,
    "fontFamily": textStyle.fontFamily,
    "fontStyle": FontStyle.italic == textStyle.fontStyle ? "italic" : "normal",
    "fontWeight": exportFontWeight(textStyle.fontWeight),
  };
}