Showing
6 changed files
with
22 additions
and
3 deletions
| @@ -165,6 +165,9 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex | @@ -165,6 +165,9 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex | ||
| 165 | log(title, name: "title"); | 165 | log(title, name: "title"); |
| 166 | log(url, name: "url"); | 166 | log(url, name: "url"); |
| 167 | }, | 167 | }, |
| 168 | + textAlign: TextAlign.justify, | ||
| 169 | + textScaler: | ||
| 170 | + MediaQuery.textScalerOf(context), | ||
| 168 | style: const TextStyle( | 171 | style: const TextStyle( |
| 169 | // Regular text font size here. | 172 | // Regular text font size here. |
| 170 | fontSize: 15, | 173 | fontSize: 15, |
| @@ -182,7 +182,7 @@ packages: | @@ -182,7 +182,7 @@ packages: | ||
| 182 | path: ".." | 182 | path: ".." |
| 183 | relative: true | 183 | relative: true |
| 184 | source: path | 184 | source: path |
| 185 | - version: "0.0.1" | 185 | + version: "0.0.2" |
| 186 | http: | 186 | http: |
| 187 | dependency: transitive | 187 | dependency: transitive |
| 188 | description: | 188 | description: |
| @@ -12,11 +12,15 @@ class TexMarkdown extends StatelessWidget { | @@ -12,11 +12,15 @@ class TexMarkdown extends StatelessWidget { | ||
| 12 | this.style, | 12 | this.style, |
| 13 | this.followLinkColor = false, | 13 | this.followLinkColor = false, |
| 14 | this.textDirection = TextDirection.ltr, | 14 | this.textDirection = TextDirection.ltr, |
| 15 | + this.textAlign, | ||
| 16 | + this.textScaler, | ||
| 15 | this.onLinkTab, | 17 | this.onLinkTab, |
| 16 | }); | 18 | }); |
| 17 | final TextDirection textDirection; | 19 | final TextDirection textDirection; |
| 18 | final String data; | 20 | final String data; |
| 19 | final TextStyle? style; | 21 | final TextStyle? style; |
| 22 | + final TextAlign? textAlign; | ||
| 23 | + final TextScaler? textScaler; | ||
| 20 | final void Function(String url, String title)? onLinkTab; | 24 | final void Function(String url, String title)? onLinkTab; |
| 21 | final bool followLinkColor; | 25 | final bool followLinkColor; |
| 22 | 26 | ||
| @@ -28,6 +32,8 @@ class TexMarkdown extends StatelessWidget { | @@ -28,6 +32,8 @@ class TexMarkdown extends StatelessWidget { | ||
| 28 | textDirection: textDirection, | 32 | textDirection: textDirection, |
| 29 | style: style, | 33 | style: style, |
| 30 | onLinkTab: onLinkTab, | 34 | onLinkTab: onLinkTab, |
| 35 | + textAlign: textAlign, | ||
| 36 | + textScaler: textScaler, | ||
| 31 | followLinkColor: followLinkColor, | 37 | followLinkColor: followLinkColor, |
| 32 | )); | 38 | )); |
| 33 | } | 39 | } |
| @@ -10,10 +10,14 @@ class MdWidget extends StatelessWidget { | @@ -10,10 +10,14 @@ class MdWidget extends StatelessWidget { | ||
| 10 | this.style, | 10 | this.style, |
| 11 | this.textDirection = TextDirection.ltr, | 11 | this.textDirection = TextDirection.ltr, |
| 12 | this.onLinkTab, | 12 | this.onLinkTab, |
| 13 | + this.textAlign, | ||
| 14 | + this.textScaler, | ||
| 13 | this.followLinkColor = false}); | 15 | this.followLinkColor = false}); |
| 14 | final String exp; | 16 | final String exp; |
| 15 | final TextDirection textDirection; | 17 | final TextDirection textDirection; |
| 16 | final TextStyle? style; | 18 | final TextStyle? style; |
| 19 | + final TextAlign? textAlign; | ||
| 20 | + final TextScaler? textScaler; | ||
| 17 | final void Function(String url, String title)? onLinkTab; | 21 | final void Function(String url, String title)? onLinkTab; |
| 18 | final bool followLinkColor; | 22 | final bool followLinkColor; |
| 19 | 23 | ||
| @@ -122,9 +126,11 @@ class MdWidget extends StatelessWidget { | @@ -122,9 +126,11 @@ class MdWidget extends StatelessWidget { | ||
| 122 | return Text.rich( | 126 | return Text.rich( |
| 123 | TextSpan( | 127 | TextSpan( |
| 124 | children: list, | 128 | children: list, |
| 125 | - style: style, | 129 | + style: style?.copyWith(), |
| 126 | ), | 130 | ), |
| 127 | textDirection: textDirection, | 131 | textDirection: textDirection, |
| 132 | + textScaler: textScaler, | ||
| 133 | + textAlign: textAlign, | ||
| 128 | ); | 134 | ); |
| 129 | } | 135 | } |
| 130 | } | 136 | } |
| 1 | name: gpt_markdown | 1 | name: gpt_markdown |
| 2 | description: "The purpose of this package is to render the response of ChatGPT into a Flutter app." | 2 | description: "The purpose of this package is to render the response of ChatGPT into a Flutter app." |
| 3 | -version: 0.0.1 | 3 | +version: 0.0.2 |
| 4 | homepage: https://github.com/saminsohag/flutter_packages/tree/main/gpt_markdown | 4 | homepage: https://github.com/saminsohag/flutter_packages/tree/main/gpt_markdown |
| 5 | 5 | ||
| 6 | environment: | 6 | environment: |
-
Please register or login to post a comment