onMarkup method
Implementation
@override
HypertextSpan onMarkup(List<HypertextSpan>? children, MarkupContext ctx) {
final color = optColor(ctx, enableTagAttr: false);
final bgColor = optBgColor(ctx, enableTagAttr: false);
final size = optFontSize(ctx, enableTagAttr: false);
final font = optFontFamily(ctx, enableTagAttr: false);
final fontWeight = optFontWeight(ctx, enableTagAttr: false);
final fontStyle = optFontStyle(ctx, enableTagAttr: false);
final height = ctx.getDouble('height');
final decor = optTextDecoration(
ctx,
attrPrefix: 'decor-',
enableTagAttr: false,
);
TextStyle? style = optStyle(ctx);
if (color != null ||
bgColor != null ||
size != null ||
font != null ||
fontWeight != null ||
fontStyle != null ||
height != null ||
decor != null) {
final overlayStyle = TextStyle(
color: color,
fontSize: size,
fontFamily: font,
fontWeight: fontWeight,
fontStyle: fontStyle,
height: height,
backgroundColor: bgColor,
decoration: decor?.decoration,
decorationColor: decor?.color,
decorationStyle: decor?.style,
decorationThickness: decor?.thickness,
);
style = style?.merge(overlayStyle) ?? overlayStyle;
}
return HypertextTextSpan(children: children, style: style);
}