Added test cases for Custom markdown working

This commit is contained in:
Chinmay
2024-03-02 18:36:47 +05:30
parent 7e2f9e1144
commit 0a8b75b9fd
2 changed files with 30 additions and 5 deletions

View File

@ -9,9 +9,12 @@ class CustomMarkdown extends StatelessWidget {
super.key,
required this.data,
this.padding = const EdgeInsets.all(16.0),
this.onTapLink,
});
final String data;
final EdgeInsets padding;
final void Function(String text, String? href, String title)? onTapLink;
@override
Widget build(BuildContext context) {
@ -25,9 +28,10 @@ class CustomMarkdown extends StatelessWidget {
data: data,
selectable: true,
extensionSet: md.ExtensionSet.gitHubFlavored,
onTapLink: (text, href, title) {
launchUrl(Uri.parse(href ?? ""));
},
onTapLink: onTapLink ??
(text, href, title) {
launchUrl(Uri.parse(href ?? ""));
},
builders: {
"inlineButton": InlineButton(),
},