build method
Implementation
@override
Widget build(
BuildContext context,
String text,
TextStyle? style,
final void Function(String url, String title)? onLinkTab,
) {
var match = exp.firstMatch(text.trim());
return Text.rich(TextSpan(
children: [
WidgetSpan(
child: TexText("${match?[2]}",
style: [
Theme.of(context)
.textTheme
.headlineLarge
?.copyWith(color: style?.color),
Theme.of(context)
.textTheme
.headlineMedium
?.copyWith(color: style?.color),
Theme.of(context)
.textTheme
.headlineSmall
?.copyWith(color: style?.color),
Theme.of(context)
.textTheme
.titleLarge
?.copyWith(color: style?.color),
Theme.of(context)
.textTheme
.titleMedium
?.copyWith(color: style?.color),
Theme.of(context)
.textTheme
.titleSmall
?.copyWith(color: style?.color),
][match![1]!.length - 1]),
),
if (match[1]!.length == 1) ...[
const TextSpan(
text: "\n ",
style: TextStyle(fontSize: 0, height: 0),
),
WidgetSpan(
child: CustomDivider(
height: 2,
color: style?.color ?? Theme.of(context).colorScheme.outline,
),
),
],
],
));
}