toJson method
Implementation
@override
Map<String, dynamic>? toJson(TextStyle? object) {
if (object == null) return null;
return <String, dynamic>{
'backgroundColor':
const NullableColorConverter().toJson(object.backgroundColor),
'color': const NullableColorConverter().toJson(object.color),
'decoration':
const NullableTextDecorationConverter().toJson(object.decoration),
'decorationColor':
const NullableColorConverter().toJson(object.decorationColor),
'decorationStyle': const NullableTextDecorationStyleConverter()
.toJson(object.decorationStyle),
'decorationThickness': object.decorationThickness,
'fontFamily': object.fontFamily,
'fontFamilyFallback': object.fontFamilyFallback,
'fontFeatures': object.fontFeatures == null
? null
: object.fontFeatures!
.map(
(object) => const NullableFontFeatureConverter().toJson(object),
)
.toList(),
'fontWeight':
const NullableFontWeightConverter().toJson(object.fontWeight),
'fontSize': object.fontSize,
'fontStyle': const NullableFontStyleConverter().toJson(object.fontStyle),
'height': object.height,
'inherit': object.inherit,
'letterSpacing': object.letterSpacing,
'locale': const NullableLocaleConverter().toJson(object.locale),
'shadows': object.shadows == null
? null
: object.shadows!
.map(
(object) => const NullableShadowConverter().toJson(object),
)
.toList(),
'textBaseline':
const NullableTextBaselineConverter().toJson(object.textBaseline),
'wordSpacing': object.wordSpacing,
};
}