Showing
6 changed files
with
11 additions
and
4 deletions
1 | buildscript { | 1 | buildscript { |
2 | - ext.kotlin_version = '1.6.10' | 2 | + ext.kotlin_version = '1.7.20' |
3 | repositories { | 3 | repositories { |
4 | google() | 4 | google() |
5 | mavenCentral() | 5 | mavenCentral() |
@@ -26,6 +26,6 @@ subprojects { | @@ -26,6 +26,6 @@ subprojects { | ||
26 | project.evaluationDependsOn(':app') | 26 | project.evaluationDependsOn(':app') |
27 | } | 27 | } |
28 | 28 | ||
29 | -task clean(type: Delete) { | 29 | +tasks.register("clean", Delete) { |
30 | delete rootProject.buildDir | 30 | delete rootProject.buildDir |
31 | } | 31 | } |
@@ -178,6 +178,7 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex | @@ -178,6 +178,7 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex | ||
178 | debugPrint(url); | 178 | debugPrint(url); |
179 | debugPrint(title); | 179 | debugPrint(title); |
180 | }, | 180 | }, |
181 | + maxLines: null, | ||
181 | textAlign: TextAlign.justify, | 182 | textAlign: TextAlign.justify, |
182 | // textScaler: const TextScaler.linear(1.3), | 183 | // textScaler: const TextScaler.linear(1.3), |
183 | textScaler: const TextScaler.linear(1), | 184 | textScaler: const TextScaler.linear(1), |
@@ -18,6 +18,7 @@ class TexMarkdown extends StatelessWidget { | @@ -18,6 +18,7 @@ class TexMarkdown extends StatelessWidget { | ||
18 | this.onLinkTab, | 18 | this.onLinkTab, |
19 | this.latexBuilder, | 19 | this.latexBuilder, |
20 | this.codeBuilder, | 20 | this.codeBuilder, |
21 | + this.maxLines, | ||
21 | }); | 22 | }); |
22 | final TextDirection textDirection; | 23 | final TextDirection textDirection; |
23 | final String data; | 24 | final String data; |
@@ -26,6 +27,7 @@ class TexMarkdown extends StatelessWidget { | @@ -26,6 +27,7 @@ class TexMarkdown extends StatelessWidget { | ||
26 | final TextScaler? textScaler; | 27 | final TextScaler? textScaler; |
27 | final void Function(String url, String title)? onLinkTab; | 28 | final void Function(String url, String title)? onLinkTab; |
28 | final String Function(String tex)? latexWorkaround; | 29 | final String Function(String tex)? latexWorkaround; |
30 | + final int? maxLines; | ||
29 | final Widget Function( | 31 | final Widget Function( |
30 | BuildContext context, String tex, TextStyle style, bool inline)? | 32 | BuildContext context, String tex, TextStyle style, bool inline)? |
31 | latexBuilder; | 33 | latexBuilder; |
@@ -68,6 +70,7 @@ class TexMarkdown extends StatelessWidget { | @@ -68,6 +70,7 @@ class TexMarkdown extends StatelessWidget { | ||
68 | latexWorkaround: latexWorkaround, | 70 | latexWorkaround: latexWorkaround, |
69 | latexBuilder: latexBuilder, | 71 | latexBuilder: latexBuilder, |
70 | codeBuilder: codeBuilder, | 72 | codeBuilder: codeBuilder, |
73 | + maxLines: maxLines, | ||
71 | )); | 74 | )); |
72 | } | 75 | } |
73 | } | 76 | } |
@@ -10,7 +10,7 @@ import 'md_widget.dart'; | @@ -10,7 +10,7 @@ import 'md_widget.dart'; | ||
10 | 10 | ||
11 | /// Markdown components | 11 | /// Markdown components |
12 | abstract class MarkdownComponent { | 12 | abstract class MarkdownComponent { |
13 | - static List<MarkdownComponent> get components => [ | 13 | + static final List<MarkdownComponent> components = [ |
14 | CodeBlockMd(), | 14 | CodeBlockMd(), |
15 | NewLines(), | 15 | NewLines(), |
16 | TableMd(), | 16 | TableMd(), |
@@ -17,6 +17,7 @@ class MdWidget extends StatelessWidget { | @@ -17,6 +17,7 @@ class MdWidget extends StatelessWidget { | ||
17 | this.latexBuilder, | 17 | this.latexBuilder, |
18 | this.followLinkColor = false, | 18 | this.followLinkColor = false, |
19 | this.codeBuilder, | 19 | this.codeBuilder, |
20 | + this.maxLines, | ||
20 | }); | 21 | }); |
21 | final String exp; | 22 | final String exp; |
22 | final TextDirection textDirection; | 23 | final TextDirection textDirection; |
@@ -31,6 +32,7 @@ class MdWidget extends StatelessWidget { | @@ -31,6 +32,7 @@ class MdWidget extends StatelessWidget { | ||
31 | final bool followLinkColor; | 32 | final bool followLinkColor; |
32 | final Widget Function(BuildContext context, String name, String code)? | 33 | final Widget Function(BuildContext context, String name, String code)? |
33 | codeBuilder; | 34 | codeBuilder; |
35 | + final int? maxLines; | ||
34 | 36 | ||
35 | @override | 37 | @override |
36 | Widget build(BuildContext context) { | 38 | Widget build(BuildContext context) { |
@@ -64,6 +66,7 @@ class MdWidget extends StatelessWidget { | @@ -64,6 +66,7 @@ class MdWidget extends StatelessWidget { | ||
64 | textDirection: textDirection, | 66 | textDirection: textDirection, |
65 | textScaler: textScaler, | 67 | textScaler: textScaler, |
66 | textAlign: textAlign, | 68 | textAlign: textAlign, |
69 | + maxLines: maxLines, | ||
67 | ); | 70 | ); |
68 | } | 71 | } |
69 | } | 72 | } |
-
Please register or login to post a comment