saminsohag

Example improved

@@ -62,22 +62,23 @@ class MyHomePage extends StatefulWidget { @@ -62,22 +62,23 @@ class MyHomePage extends StatefulWidget {
62 class _MyHomePageState extends State<MyHomePage> { 62 class _MyHomePageState extends State<MyHomePage> {
63 TextDirection _direction = TextDirection.ltr; 63 TextDirection _direction = TextDirection.ltr;
64 final TextEditingController _controller = TextEditingController(text: r''' 64 final TextEditingController _controller = TextEditingController(text: r'''
65 -# hi how are you?$my is^2$  
66 -## hi how are you$(\frac ab)^2$?  
67 -### hi how are you?  
68 -#### hi how are you?  
69 -##### hi how are you?$my name is x^2$  
70 -###### hi how are you?$x^2$  
71 -hello 65 +# This is H1
  66 +## This is H2
  67 +### This is H3
  68 +#### This is H4
  69 +##### This is H5
  70 +###### This is H6
  71 +
  72 +This are just regular text.
72 --- 73 ---
73 -my name is 74 +This is a image.
74 ![300](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/800px-Image_created_with_a_mobile_phone.png) 75 ![300](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/800px-Image_created_with_a_mobile_phone.png)
75 -**bold$x^2\cfrac a{\cfrac ab}$ text**  
76 -*Italic text$x^2\cfrac a{b}$* 76 +**bold $x^2\cfrac a{\cfrac ab}$ text**
  77 +*Italic text $x^2\cfrac a{b}$*
77 **hello** 78 **hello**
78 $hello$ 79 $hello$
79 80
80 -$sdf\frac a{\frac ab}$ 81 +$sdf \frac a{\frac ab}$
81 $hello$ 82 $hello$
82 [Link]() 83 [Link]()
83 - unordered list 84 - unordered list
@@ -135,16 +136,36 @@ $hello$ @@ -135,16 +136,36 @@ $hello$
135 reverse: _direction == TextDirection.rtl, 136 reverse: _direction == TextDirection.rtl,
136 child: SizedBox( 137 child: SizedBox(
137 width: 400, 138 width: 400,
138 - child: TexMarkdown(  
139 - _controller.text,  
140 - textDirection: _direction,  
141 - onLinkTab: (url, title) {  
142 - log(title, name: "title");  
143 - log(url, name: "url");  
144 - },  
145 - style: const TextStyle(  
146 - // color: Colors.green,  
147 - ), 139 + child: Theme(
  140 + data: Theme.of(context).copyWith(
  141 + textTheme: const TextTheme(
  142 + // For H1.
  143 + headlineLarge: TextStyle(fontSize: 55),
  144 + // For H2.
  145 + headlineMedium: TextStyle(fontSize: 45),
  146 + // For H3.
  147 + headlineSmall: TextStyle(fontSize: 35),
  148 + // For H4.
  149 + titleLarge: TextStyle(fontSize: 25),
  150 + // For H5.
  151 + titleMedium: TextStyle(fontSize: 15),
  152 + // For H6.
  153 + titleSmall: TextStyle(fontSize: 10),
  154 + ),
  155 + ),
  156 + child: TexMarkdown(
  157 + _controller.text,
  158 + textDirection: _direction,
  159 + onLinkTab: (url, title) {
  160 + log(title, name: "title");
  161 + log(url, name: "url");
  162 + },
  163 + style: const TextStyle(
  164 + // Regular text font size here.
  165 + fontSize: 15,
  166 + ),
  167 + ),
  168 + // child: const Text("Hello"),
148 ), 169 ),
149 ), 170 ),
150 ); 171 );
@@ -475,14 +475,15 @@ packages: @@ -475,14 +475,15 @@ packages:
475 path: ".." 475 path: ".."
476 relative: true 476 relative: true
477 source: path 477 source: path
478 - version: "0.1.9" 478 + version: "0.1.10"
479 tex_text: 479 tex_text:
480 dependency: transitive 480 dependency: transitive
481 description: 481 description:
482 - path: "../../tex_text"  
483 - relative: true  
484 - source: path  
485 - version: "0.1.8" 482 + name: tex_text
  483 + sha256: c1069b0f08aa8fbb9f6a670f2ed27328311e0e0b5445417cab710f30c0c28084
  484 + url: "https://pub.dev"
  485 + source: hosted
  486 + version: "0.1.9"
486 tuple: 487 tuple:
487 dependency: transitive 488 dependency: transitive
488 description: 489 description: