Showing
1 changed file
with
15 additions
and
10 deletions
| @@ -5,16 +5,19 @@ import 'package:gpt_markdown/markdown_component.dart'; | @@ -5,16 +5,19 @@ import 'package:gpt_markdown/markdown_component.dart'; | ||
| 5 | 5 | ||
| 6 | /// It creates a markdown widget closed to each other. | 6 | /// It creates a markdown widget closed to each other. |
| 7 | class MdWidget extends StatelessWidget { | 7 | class MdWidget extends StatelessWidget { |
| 8 | - const MdWidget(this.exp, | ||
| 9 | - {super.key, | ||
| 10 | - this.style, | ||
| 11 | - this.textDirection = TextDirection.ltr, | ||
| 12 | - this.onLinkTab, | ||
| 13 | - this.textAlign, | ||
| 14 | - this.textScaleFactor, | ||
| 15 | - this.latexWorkaround, | ||
| 16 | - this.latexBuilder, | ||
| 17 | - this.followLinkColor = false}); | 8 | + const MdWidget( |
| 9 | + this.exp, { | ||
| 10 | + super.key, | ||
| 11 | + this.style, | ||
| 12 | + this.textDirection = TextDirection.ltr, | ||
| 13 | + this.onLinkTab, | ||
| 14 | + this.textAlign, | ||
| 15 | + this.textScaleFactor, | ||
| 16 | + this.latexWorkaround, | ||
| 17 | + this.latexBuilder, | ||
| 18 | + this.followLinkColor = false, | ||
| 19 | + this.codeBuilder, | ||
| 20 | + }); | ||
| 18 | final String exp; | 21 | final String exp; |
| 19 | final TextDirection textDirection; | 22 | final TextDirection textDirection; |
| 20 | final TextStyle? style; | 23 | final TextStyle? style; |
| @@ -24,6 +27,7 @@ class MdWidget extends StatelessWidget { | @@ -24,6 +27,7 @@ class MdWidget extends StatelessWidget { | ||
| 24 | final String Function(String tex)? latexWorkaround; | 27 | final String Function(String tex)? latexWorkaround; |
| 25 | final Widget Function(BuildContext context, String tex)? latexBuilder; | 28 | final Widget Function(BuildContext context, String tex)? latexBuilder; |
| 26 | final bool followLinkColor; | 29 | final bool followLinkColor; |
| 30 | + final Widget Function(BuildContext context, String tex)? codeBuilder; | ||
| 27 | 31 | ||
| 28 | @override | 32 | @override |
| 29 | Widget build(BuildContext context) { | 33 | Widget build(BuildContext context) { |
| @@ -46,6 +50,7 @@ class MdWidget extends StatelessWidget { | @@ -46,6 +50,7 @@ class MdWidget extends StatelessWidget { | ||
| 46 | onLinkTab, | 50 | onLinkTab, |
| 47 | latexWorkaround, | 51 | latexWorkaround, |
| 48 | latexBuilder, | 52 | latexBuilder, |
| 53 | + codeBuilder, | ||
| 49 | ), | 54 | ), |
| 50 | ); | 55 | ); |
| 51 | return Text.rich( | 56 | return Text.rich( |
-
Please register or login to post a comment