saminsohag

getRich added to config

... ... @@ -178,8 +178,8 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex
debugPrint(url);
debugPrint(title);
},
// maxLines: 3,
// overflow: TextOverflow.ellipsis,
maxLines: 7,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.justify,
// textScaler: const TextScaler.linear(1.3),
textScaler: const TextScaler.linear(1),
... ...
... ... @@ -58,4 +58,15 @@ class GptMarkdownConfig {
overflow: overflow ?? this.overflow,
);
}
getRich(InlineSpan span) {
return Text.rich(
span,
textDirection: textDirection,
textScaler: textScaler,
textAlign: textAlign,
maxLines: maxLines,
overflow: overflow,
);
}
}
... ...
... ... @@ -194,7 +194,7 @@ class HTag extends BlockMd {
.titleSmall
?.copyWith(color: config.style?.color),
][match![1]!.length - 1]);
return Text.rich(
return config.getRich(
TextSpan(
children: [
...(MarkdownComponent.generate(
... ... @@ -217,9 +217,6 @@ class HTag extends BlockMd {
],
],
),
textDirection: config.textDirection,
overflow: config.overflow,
maxLines: config.maxLines,
);
}
}
... ... @@ -679,7 +676,7 @@ class ATagMd extends InlineMd {
onTap: () {
config.onLinkTab?.call("${match?[2]}", "${match?[1]}");
},
child: Text.rich(
child: config.getRich(
TextSpan(
text: "${match?[1]}",
style: (config.style ?? const TextStyle()).copyWith(
... ... @@ -688,7 +685,6 @@ class ATagMd extends InlineMd {
decoration: TextDecoration.underline,
),
),
textDirection: config.textDirection,
),
),
);
... ...
... ... @@ -33,16 +33,11 @@ class MdWidget extends StatelessWidget {
config,
),
);
return Text.rich(
return config.getRich(
TextSpan(
children: list,
style: config.style?.copyWith(),
),
textDirection: config.textDirection,
textScaler: config.textScaler,
textAlign: config.textAlign,
maxLines: config.maxLines,
overflow: config.overflow,
);
}
}
... ...