build method

  1. @override
Widget build(
  1. BuildContext context,
  2. String text,
  3. GptMarkdownConfig config
)
override

Implementation

@override
Widget build(
  BuildContext context,
  String text,
  final GptMarkdownConfig config,
) {
  [
    r"\\\[(.*?)\\\]",
    r"\\\((.*?)\\\)",
    r"(?<!\\)\$((?:\\.|[^$])*?)\$(?!\\)",
  ].join("|");
  var match = exp.firstMatch(text);
  int spaces = (match?[1] ?? "").length;
  return UnorderedListView(
    bulletColor: config.style?.color,
    padding: spaces * 5,
    bulletSize: 0,
    textDirection: config.textDirection,
    child: RichText(
        text: TextSpan(
      children: MarkdownComponent.generate(
        context,
        "${match?[2]}",
        config,
      ),
    )),
  );
}