span method

  1. @override
InlineSpan span(
  1. BuildContext context,
  2. String text,
  3. GptMarkdownConfig config
)
override

Implementation

@override
InlineSpan span(
  BuildContext context,
  String text,
  final GptMarkdownConfig config,
) {
  var match = exp.firstMatch(text.trim());
  var conf = config.copyWith(
    style:
        config.style?.copyWith(
          decoration: TextDecoration.lineThrough,
          decorationColor: config.style?.color,
        ) ??
        const TextStyle(decoration: TextDecoration.lineThrough),
  );
  return TextSpan(
    children: MarkdownComponent.generate(context, "${match?[1]}", conf),
    style: conf.style,
  );
}