fromJson static method
Implementation
static FTextStyle fromJson(final Map<String, dynamic> doc) {
return FTextStyle(
fill: doc[DBKeys.fill] != null
? FFill.fromJson(doc[DBKeys.fill] as Map<String, dynamic>)
: const FFill(
type: FFillType.solid,
levels: [FFillElement(color: '000000', stop: 0)],
),
fontSize: doc[DBKeys.fontSize] != null
? FFontSize.fromJson(doc[DBKeys.fontSize])
: const FFontSize(),
fontFamily: doc[DBKeys.fontFamily] as String? ??
doc['family'] as String? ??
'Poppins',
fontWeight: doc[DBKeys.fontWeight] != null
? FFontWeight.fromJson(doc[DBKeys.fontWeight])
: const FFontWeight(),
textDecoration: doc[DBKeys.textDecoration] != null
? FTextDecoration.fromJson(doc[DBKeys.textDecoration] as String)
: const FTextDecoration(),
textAlign: doc[DBKeys.textAlign] != null
? FTextAlign.fromJson(doc[DBKeys.textAlign] as String)
: const FTextAlign(),
fontStyle: doc[DBKeys.fontStyle] != null
? FFontStyle.fromJson(doc[DBKeys.fontStyle])
: const FFontStyle(),
textDirection: doc[DBKeys.textDirection] != null
? FTextDirection.fromJson(doc[DBKeys.textDirection] as String)
: const FTextDirection(),
textStyleModel: doc[DBKeys.textStyleModel] as String?,
letterSpacing: doc[DBKeys.letterSpacing] != null
? FGeneralTypeInput.fromJson(doc[DBKeys.letterSpacing])
: const StaticTypeInput(value: '', type: FGeneralTypeEnum.text),
lineSpacing: doc[DBKeys.lineSpacing] != null
? FGeneralTypeInput.fromJson(doc[DBKeys.lineSpacing])
: const StaticTypeInput(value: '', type: FGeneralTypeEnum.text),
);
}