Showing
6 changed files
with
26 additions
and
12 deletions
@@ -31,7 +31,18 @@ class MyHomePage extends StatefulWidget { | @@ -31,7 +31,18 @@ class MyHomePage extends StatefulWidget { | ||
31 | } | 31 | } |
32 | 32 | ||
33 | class _MyHomePageState extends State<MyHomePage> { | 33 | class _MyHomePageState extends State<MyHomePage> { |
34 | - final TextEditingController _controller = TextEditingController(); | 34 | + final TextEditingController _controller = |
35 | + TextEditingController(text: '''# hi how are you? | ||
36 | + | ||
37 | +## hi how are you? | ||
38 | + | ||
39 | +### hi how are you? | ||
40 | + | ||
41 | +#### hi how are you? | ||
42 | + | ||
43 | +##### hi how are you? | ||
44 | + | ||
45 | +###### hi how are you?'''); | ||
35 | @override | 46 | @override |
36 | Widget build(BuildContext context) { | 47 | Widget build(BuildContext context) { |
37 | return Scaffold( | 48 | return Scaffold( |
@@ -204,7 +204,7 @@ packages: | @@ -204,7 +204,7 @@ packages: | ||
204 | path: ".." | 204 | path: ".." |
205 | relative: true | 205 | relative: true |
206 | source: path | 206 | source: path |
207 | - version: "0.0.1" | 207 | + version: "0.0.2" |
208 | tex_text: | 208 | tex_text: |
209 | dependency: transitive | 209 | dependency: transitive |
210 | description: | 210 | description: |
1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
2 | import 'package:tex_text/tex_text.dart'; | 2 | import 'package:tex_text/tex_text.dart'; |
3 | 3 | ||
4 | +/// It creates a markdown widget closed to each other. | ||
4 | class MdWidget extends StatelessWidget { | 5 | class MdWidget extends StatelessWidget { |
5 | MdWidget(String expression, | 6 | MdWidget(String expression, |
6 | {super.key, this.style, this.onLinkTab, this.followLinkColor = false}) | 7 | {super.key, this.style, this.onLinkTab, this.followLinkColor = false}) |
@@ -52,7 +53,6 @@ class MdWidget extends StatelessWidget { | @@ -52,7 +53,6 @@ class MdWidget extends StatelessWidget { | ||
52 | child: MdWidget( | 53 | child: MdWidget( |
53 | e[index] ?? "", | 54 | e[index] ?? "", |
54 | style: style, | 55 | style: style, |
55 | - // alignment: TexAlignment.center, | ||
56 | ), | 56 | ), |
57 | ), | 57 | ), |
58 | ), | 58 | ), |
@@ -67,12 +67,15 @@ class MdWidget extends StatelessWidget { | @@ -67,12 +67,15 @@ class MdWidget extends StatelessWidget { | ||
67 | return TexText( | 67 | return TexText( |
68 | "${match?[2]}", | 68 | "${match?[2]}", |
69 | style: [ | 69 | style: [ |
70 | - Theme.of(context).textTheme.headline1?.copyWith(color: style?.color), | ||
71 | - Theme.of(context).textTheme.headline2?.copyWith(color: style?.color), | ||
72 | - Theme.of(context).textTheme.headline3?.copyWith(color: style?.color), | ||
73 | Theme.of(context).textTheme.headline4?.copyWith(color: style?.color), | 70 | Theme.of(context).textTheme.headline4?.copyWith(color: style?.color), |
74 | Theme.of(context).textTheme.headline5?.copyWith(color: style?.color), | 71 | Theme.of(context).textTheme.headline5?.copyWith(color: style?.color), |
75 | Theme.of(context).textTheme.headline6?.copyWith(color: style?.color), | 72 | Theme.of(context).textTheme.headline6?.copyWith(color: style?.color), |
73 | + Theme.of(context) | ||
74 | + .textTheme | ||
75 | + .titleMedium | ||
76 | + ?.copyWith(color: style?.color), | ||
77 | + Theme.of(context).textTheme.titleSmall?.copyWith(color: style?.color), | ||
78 | + Theme.of(context).textTheme.bodySmall?.copyWith(color: style?.color), | ||
76 | ][match![1]!.length - 1], | 79 | ][match![1]!.length - 1], |
77 | ); | 80 | ); |
78 | } | 81 | } |
@@ -94,10 +97,6 @@ class MdWidget extends StatelessWidget { | @@ -94,10 +97,6 @@ class MdWidget extends StatelessWidget { | ||
94 | "${match?[1]}", | 97 | "${match?[1]}", |
95 | style: style, | 98 | style: style, |
96 | ), | 99 | ), |
97 | - // TexText( | ||
98 | - // "${match?[1]}", | ||
99 | - // style: style, | ||
100 | - // ), | ||
101 | ], | 100 | ], |
102 | ); | 101 | ); |
103 | } | 102 | } |
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; | @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; | ||
4 | 4 | ||
5 | import 'md_widget.dart'; | 5 | import 'md_widget.dart'; |
6 | 6 | ||
7 | -/// A Calculator. | 7 | +/// This widget create a full markdown widget as a column view. |
8 | class TexMarkdown extends StatelessWidget { | 8 | class TexMarkdown extends StatelessWidget { |
9 | const TexMarkdown( | 9 | const TexMarkdown( |
10 | this.data, { | 10 | this.data, { |
1 | name: tex_markdown | 1 | name: tex_markdown |
2 | description: This package is used to create flutter widget that can render markdown and latex formulas. It is very simple to use and uses native flutter components. | 2 | description: This package is used to create flutter widget that can render markdown and latex formulas. It is very simple to use and uses native flutter components. |
3 | -version: 0.0.1 | 3 | +version: 0.0.2 |
4 | homepage: https://github.com/saminsohag/flutter_packages/tree/main/tex_markdown | 4 | homepage: https://github.com/saminsohag/flutter_packages/tree/main/tex_markdown |
5 | 5 | ||
6 | environment: | 6 | environment: |
-
Please register or login to post a comment