saminsohag

textDirection is added

@@ -125,6 +125,7 @@ $hello$ @@ -125,6 +125,7 @@ $hello$
125 scrollDirection: Axis.horizontal, 125 scrollDirection: Axis.horizontal,
126 child: TexMarkdown( 126 child: TexMarkdown(
127 _controller.text, 127 _controller.text,
  128 + textDirection: TextDirection.rtl,
128 onLinkTab: (url, title) { 129 onLinkTab: (url, title) {
129 log(title, name: "title"); 130 log(title, name: "title");
130 log(url, name: "url"); 131 log(url, name: "url");
@@ -479,10 +479,9 @@ packages: @@ -479,10 +479,9 @@ packages:
479 tex_text: 479 tex_text:
480 dependency: transitive 480 dependency: transitive
481 description: 481 description:
482 - name: tex_text  
483 - sha256: d970cdcf16fb38b28f16b6118853434703191c9757117bc264c43c212d554949  
484 - url: "https://pub.dev"  
485 - source: hosted 482 + path: "../../tex_text"
  483 + relative: true
  484 + source: path
486 version: "0.1.8" 485 version: "0.1.8"
487 tuple: 486 tuple:
488 dependency: transitive 487 dependency: transitive
@@ -47,6 +47,7 @@ abstract class MarkdownComponent { @@ -47,6 +47,7 @@ abstract class MarkdownComponent {
47 BuildContext context, 47 BuildContext context,
48 String text, 48 String text,
49 TextStyle? style, 49 TextStyle? style,
  50 + TextDirection textDirection,
50 final void Function(String url, String title)? onLinkTab, 51 final void Function(String url, String title)? onLinkTab,
51 ) { 52 ) {
52 List<InlineSpan> spans = []; 53 List<InlineSpan> spans = [];
@@ -59,6 +60,7 @@ abstract class MarkdownComponent { @@ -59,6 +60,7 @@ abstract class MarkdownComponent {
59 context, 60 context,
60 element.trim(), 61 element.trim(),
61 style, 62 style,
  63 + textDirection,
62 onLinkTab, 64 onLinkTab,
63 )); 65 ));
64 spans.add( 66 spans.add(
@@ -78,7 +80,13 @@ abstract class MarkdownComponent { @@ -78,7 +80,13 @@ abstract class MarkdownComponent {
78 color: style?.color, 80 color: style?.color,
79 ), 81 ),
80 ), 82 ),
81 - each.span(context, element.trim(), style, onLinkTab), 83 + each.span(
  84 + context,
  85 + element.trim(),
  86 + style,
  87 + textDirection,
  88 + onLinkTab,
  89 + ),
82 TextSpan( 90 TextSpan(
83 text: "\n ", 91 text: "\n ",
84 style: TextStyle( 92 style: TextStyle(
@@ -102,6 +110,7 @@ abstract class MarkdownComponent { @@ -102,6 +110,7 @@ abstract class MarkdownComponent {
102 BuildContext context, 110 BuildContext context,
103 String text, 111 String text,
104 TextStyle? style, 112 TextStyle? style,
  113 + TextDirection textDirection,
105 final void Function(String url, String title)? onLinkTab, 114 final void Function(String url, String title)? onLinkTab,
106 ); 115 );
107 116
@@ -119,6 +128,7 @@ abstract class InlineMd extends MarkdownComponent { @@ -119,6 +128,7 @@ abstract class InlineMd extends MarkdownComponent {
119 BuildContext context, 128 BuildContext context,
120 String text, 129 String text,
121 TextStyle? style, 130 TextStyle? style,
  131 + TextDirection textDirection,
122 final void Function(String url, String title)? onLinkTab, 132 final void Function(String url, String title)? onLinkTab,
123 ); 133 );
124 String toHtml(String text); 134 String toHtml(String text);
@@ -133,10 +143,11 @@ abstract class BlockMd extends MarkdownComponent { @@ -133,10 +143,11 @@ abstract class BlockMd extends MarkdownComponent {
133 BuildContext context, 143 BuildContext context,
134 String text, 144 String text,
135 TextStyle? style, 145 TextStyle? style,
  146 + TextDirection textDirection,
136 final void Function(String url, String title)? onLinkTab, 147 final void Function(String url, String title)? onLinkTab,
137 ) { 148 ) {
138 return WidgetSpan( 149 return WidgetSpan(
139 - child: build(context, text, style, onLinkTab), 150 + child: build(context, text, style, textDirection, onLinkTab),
140 alignment: PlaceholderAlignment.middle, 151 alignment: PlaceholderAlignment.middle,
141 ); 152 );
142 } 153 }
@@ -145,6 +156,7 @@ abstract class BlockMd extends MarkdownComponent { @@ -145,6 +156,7 @@ abstract class BlockMd extends MarkdownComponent {
145 BuildContext context, 156 BuildContext context,
146 String text, 157 String text,
147 TextStyle? style, 158 TextStyle? style,
  159 + TextDirection textDirection,
148 final void Function(String url, String title)? onLinkTab, 160 final void Function(String url, String title)? onLinkTab,
149 ); 161 );
150 String toHtml(String text); 162 String toHtml(String text);
@@ -159,13 +171,17 @@ class HTag extends BlockMd { @@ -159,13 +171,17 @@ class HTag extends BlockMd {
159 BuildContext context, 171 BuildContext context,
160 String text, 172 String text,
161 TextStyle? style, 173 TextStyle? style,
  174 + TextDirection textDirection,
162 final void Function(String url, String title)? onLinkTab, 175 final void Function(String url, String title)? onLinkTab,
163 ) { 176 ) {
164 var match = exp.firstMatch(text.trim()); 177 var match = exp.firstMatch(text.trim());
165 - return Text.rich(TextSpan(  
166 - children: [  
167 - WidgetSpan(  
168 - child: TexText("${match?[2]}", 178 + return Text.rich(
  179 + TextSpan(
  180 + children: [
  181 + WidgetSpan(
  182 + child: TexText(
  183 + "${match?[2]}",
  184 + textDirection: textDirection,
169 style: [ 185 style: [
170 Theme.of(context) 186 Theme.of(context)
171 .textTheme 187 .textTheme
@@ -191,22 +207,26 @@ class HTag extends BlockMd { @@ -191,22 +207,26 @@ class HTag extends BlockMd {
191 .textTheme 207 .textTheme
192 .titleSmall 208 .titleSmall
193 ?.copyWith(color: style?.color), 209 ?.copyWith(color: style?.color),
194 - ][match![1]!.length - 1]),  
195 - ),  
196 - if (match[1]!.length == 1) ...[  
197 - const TextSpan(  
198 - text: "\n ",  
199 - style: TextStyle(fontSize: 0, height: 0),  
200 - ),  
201 - WidgetSpan(  
202 - child: CustomDivider(  
203 - height: 2,  
204 - color: style?.color ?? Theme.of(context).colorScheme.outline, 210 + ][match![1]!.length - 1],
  211 + // textDirection: textDirection,
205 ), 212 ),
206 ), 213 ),
  214 + if (match[1]!.length == 1) ...[
  215 + const TextSpan(
  216 + text: "\n ",
  217 + style: TextStyle(fontSize: 0, height: 0),
  218 + ),
  219 + WidgetSpan(
  220 + child: CustomDivider(
  221 + height: 2,
  222 + color: style?.color ?? Theme.of(context).colorScheme.outline,
  223 + ),
  224 + ),
  225 + ],
207 ], 226 ],
208 - ],  
209 - )); 227 + ),
  228 + textDirection: textDirection,
  229 + );
210 } 230 }
211 231
212 @override 232 @override
@@ -225,6 +245,7 @@ class HrLine extends BlockMd { @@ -225,6 +245,7 @@ class HrLine extends BlockMd {
225 BuildContext context, 245 BuildContext context,
226 String text, 246 String text,
227 TextStyle? style, 247 TextStyle? style,
  248 + TextDirection textDirection,
228 final void Function(String url, String title)? onLinkTab, 249 final void Function(String url, String title)? onLinkTab,
229 ) { 250 ) {
230 return CustomDivider( 251 return CustomDivider(
@@ -248,6 +269,7 @@ class CheckBoxMd extends BlockMd { @@ -248,6 +269,7 @@ class CheckBoxMd extends BlockMd {
248 BuildContext context, 269 BuildContext context,
249 String text, 270 String text,
250 TextStyle? style, 271 TextStyle? style,
  272 + TextDirection textDirection,
251 final void Function(String url, String title)? onLinkTab, 273 final void Function(String url, String title)? onLinkTab,
252 ) { 274 ) {
253 var match = exp.firstMatch(text.trim()); 275 var match = exp.firstMatch(text.trim());
@@ -256,6 +278,7 @@ class CheckBoxMd extends BlockMd { @@ -256,6 +278,7 @@ class CheckBoxMd extends BlockMd {
256 child: MdWidget( 278 child: MdWidget(
257 "${match?[2]}", 279 "${match?[2]}",
258 onLinkTab: onLinkTab, 280 onLinkTab: onLinkTab,
  281 + textDirection: textDirection,
259 style: style, 282 style: style,
260 ), 283 ),
261 ); 284 );
@@ -280,6 +303,7 @@ class RadioButtonMd extends BlockMd { @@ -280,6 +303,7 @@ class RadioButtonMd extends BlockMd {
280 BuildContext context, 303 BuildContext context,
281 String text, 304 String text,
282 TextStyle? style, 305 TextStyle? style,
  306 + TextDirection textDirection,
283 final void Function(String url, String title)? onLinkTab, 307 final void Function(String url, String title)? onLinkTab,
284 ) { 308 ) {
285 var match = exp.firstMatch(text.trim()); 309 var match = exp.firstMatch(text.trim());
@@ -288,6 +312,7 @@ class RadioButtonMd extends BlockMd { @@ -288,6 +312,7 @@ class RadioButtonMd extends BlockMd {
288 child: MdWidget( 312 child: MdWidget(
289 "${match?[2]}", 313 "${match?[2]}",
290 onLinkTab: onLinkTab, 314 onLinkTab: onLinkTab,
  315 + textDirection: textDirection,
291 style: style, 316 style: style,
292 ), 317 ),
293 ); 318 );
@@ -312,6 +337,7 @@ class UnOrderedList extends BlockMd { @@ -312,6 +337,7 @@ class UnOrderedList extends BlockMd {
312 BuildContext context, 337 BuildContext context,
313 String text, 338 String text,
314 TextStyle? style, 339 TextStyle? style,
  340 + TextDirection textDirection,
315 final void Function(String url, String title)? onLinkTab, 341 final void Function(String url, String title)? onLinkTab,
316 ) { 342 ) {
317 var match = exp.firstMatch(text.trim()); 343 var match = exp.firstMatch(text.trim());
@@ -320,6 +346,7 @@ class UnOrderedList extends BlockMd { @@ -320,6 +346,7 @@ class UnOrderedList extends BlockMd {
320 child: MdWidget( 346 child: MdWidget(
321 "${match?[2]}", 347 "${match?[2]}",
322 onLinkTab: onLinkTab, 348 onLinkTab: onLinkTab,
  349 + textDirection: textDirection,
323 style: style, 350 style: style,
324 ), 351 ),
325 ); 352 );
@@ -347,6 +374,7 @@ class OrderedList extends BlockMd { @@ -347,6 +374,7 @@ class OrderedList extends BlockMd {
347 BuildContext context, 374 BuildContext context,
348 String text, 375 String text,
349 TextStyle? style, 376 TextStyle? style,
  377 + TextDirection textDirection,
350 final void Function(String url, String title)? onLinkTab, 378 final void Function(String url, String title)? onLinkTab,
351 ) { 379 ) {
352 var match = exp.firstMatch(text.trim()); 380 var match = exp.firstMatch(text.trim());
@@ -356,6 +384,7 @@ class OrderedList extends BlockMd { @@ -356,6 +384,7 @@ class OrderedList extends BlockMd {
356 child: MdWidget( 384 child: MdWidget(
357 "${match?[2]}", 385 "${match?[2]}",
358 onLinkTab: onLinkTab, 386 onLinkTab: onLinkTab,
  387 + textDirection: textDirection,
359 style: style, 388 style: style,
360 ), 389 ),
361 ); 390 );
@@ -378,6 +407,7 @@ class BoldMd extends InlineMd { @@ -378,6 +407,7 @@ class BoldMd extends InlineMd {
378 BuildContext context, 407 BuildContext context,
379 String text, 408 String text,
380 TextStyle? style, 409 TextStyle? style,
  410 + TextDirection textDirection,
381 final void Function(String url, String title)? onLinkTab, 411 final void Function(String url, String title)? onLinkTab,
382 ) { 412 ) {
383 var match = exp.firstMatch(text.trim()); 413 var match = exp.firstMatch(text.trim());
@@ -387,6 +417,7 @@ class BoldMd extends InlineMd { @@ -387,6 +417,7 @@ class BoldMd extends InlineMd {
387 baseline: TextBaseline.alphabetic, 417 baseline: TextBaseline.alphabetic,
388 child: TexText( 418 child: TexText(
389 "${match?[1]}", 419 "${match?[1]}",
  420 + textDirection: textDirection,
390 style: style?.copyWith(fontWeight: FontWeight.bold) ?? 421 style: style?.copyWith(fontWeight: FontWeight.bold) ??
391 const TextStyle(fontWeight: FontWeight.bold), 422 const TextStyle(fontWeight: FontWeight.bold),
392 ), 423 ),
@@ -412,6 +443,7 @@ class ItalicMd extends InlineMd { @@ -412,6 +443,7 @@ class ItalicMd extends InlineMd {
412 BuildContext context, 443 BuildContext context,
413 String text, 444 String text,
414 TextStyle? style, 445 TextStyle? style,
  446 + TextDirection textDirection,
415 final void Function(String url, String title)? onLinkTab, 447 final void Function(String url, String title)? onLinkTab,
416 ) { 448 ) {
417 var match = exp.firstMatch(text.trim()); 449 var match = exp.firstMatch(text.trim());
@@ -420,6 +452,7 @@ class ItalicMd extends InlineMd { @@ -420,6 +452,7 @@ class ItalicMd extends InlineMd {
420 baseline: TextBaseline.alphabetic, 452 baseline: TextBaseline.alphabetic,
421 child: TexText( 453 child: TexText(
422 "${match?[1]}", 454 "${match?[1]}",
  455 + textDirection: textDirection,
423 style: 456 style:
424 (style ?? const TextStyle()).copyWith(fontStyle: FontStyle.italic), 457 (style ?? const TextStyle()).copyWith(fontStyle: FontStyle.italic),
425 ), 458 ),
@@ -444,6 +477,7 @@ class ATagMd extends InlineMd { @@ -444,6 +477,7 @@ class ATagMd extends InlineMd {
444 BuildContext context, 477 BuildContext context,
445 String text, 478 String text,
446 TextStyle? style, 479 TextStyle? style,
  480 + TextDirection textDirection,
447 final void Function(String url, String title)? onLinkTab, 481 final void Function(String url, String title)? onLinkTab,
448 ) { 482 ) {
449 var match = exp.firstMatch(text.trim()); 483 var match = exp.firstMatch(text.trim());
@@ -462,6 +496,7 @@ class ATagMd extends InlineMd { @@ -462,6 +496,7 @@ class ATagMd extends InlineMd {
462 }, 496 },
463 child: TexText( 497 child: TexText(
464 "${match?[1]}", 498 "${match?[1]}",
  499 + textDirection: textDirection,
465 style: (style ?? const TextStyle()).copyWith( 500 style: (style ?? const TextStyle()).copyWith(
466 color: Colors.blueAccent, 501 color: Colors.blueAccent,
467 decorationColor: Colors.blue, 502 decorationColor: Colors.blue,
@@ -489,6 +524,7 @@ class ImageMd extends InlineMd { @@ -489,6 +524,7 @@ class ImageMd extends InlineMd {
489 BuildContext context, 524 BuildContext context,
490 String text, 525 String text,
491 TextStyle? style, 526 TextStyle? style,
  527 + TextDirection textDirection,
492 final void Function(String url, String title)? onLinkTab, 528 final void Function(String url, String title)? onLinkTab,
493 ) { 529 ) {
494 var match = exp.firstMatch(text.trim()); 530 var match = exp.firstMatch(text.trim());
@@ -548,8 +584,13 @@ class ImageMd extends InlineMd { @@ -548,8 +584,13 @@ class ImageMd extends InlineMd {
548 /// Table component 584 /// Table component
549 class TableMd extends BlockMd { 585 class TableMd extends BlockMd {
550 @override 586 @override
551 - Widget build(BuildContext context, String text, TextStyle? style,  
552 - void Function(String url, String title)? onLinkTab) { 587 + Widget build(
  588 + BuildContext context,
  589 + String text,
  590 + TextStyle? style,
  591 + TextDirection textDirection,
  592 + void Function(String url, String title)? onLinkTab,
  593 + ) {
553 final List<Map<int, String>> value = text 594 final List<Map<int, String>> value = text
554 .split('\n') 595 .split('\n')
555 .map<Map<int, String>>( 596 .map<Map<int, String>>(
@@ -571,6 +612,7 @@ class TableMd extends BlockMd { @@ -571,6 +612,7 @@ class TableMd extends BlockMd {
571 } 612 }
572 return Table( 613 return Table(
573 defaultVerticalAlignment: TableCellVerticalAlignment.middle, 614 defaultVerticalAlignment: TableCellVerticalAlignment.middle,
  615 + textDirection: textDirection,
574 border: TableBorder.all( 616 border: TableBorder.all(
575 width: 1, 617 width: 1,
576 color: Theme.of(context).colorScheme.onSurface, 618 color: Theme.of(context).colorScheme.onSurface,
@@ -583,6 +625,7 @@ class TableMd extends BlockMd { @@ -583,6 +625,7 @@ class TableMd extends BlockMd {
583 (index) => Center( 625 (index) => Center(
584 child: MdWidget( 626 child: MdWidget(
585 (e[index] ?? "").trim(), 627 (e[index] ?? "").trim(),
  628 + textDirection: textDirection,
586 onLinkTab: onLinkTab, 629 onLinkTab: onLinkTab,
587 style: style, 630 style: style,
588 ), 631 ),
@@ -634,13 +677,19 @@ class TextMd extends InlineMd { @@ -634,13 +677,19 @@ class TextMd extends InlineMd {
634 final RegExp exp = RegExp(".*"); 677 final RegExp exp = RegExp(".*");
635 678
636 @override 679 @override
637 - InlineSpan span(BuildContext context, String text, TextStyle? style,  
638 - void Function(String url, String title)? onLinkTab) { 680 + InlineSpan span(
  681 + BuildContext context,
  682 + String text,
  683 + TextStyle? style,
  684 + TextDirection textDirection,
  685 + void Function(String url, String title)? onLinkTab,
  686 + ) {
639 return WidgetSpan( 687 return WidgetSpan(
640 alignment: PlaceholderAlignment.baseline, 688 alignment: PlaceholderAlignment.baseline,
641 baseline: TextBaseline.alphabetic, 689 baseline: TextBaseline.alphabetic,
642 child: TexText( 690 child: TexText(
643 text, 691 text,
  692 + textDirection: textDirection,
644 style: style, 693 style: style,
645 )); 694 ));
646 } 695 }
@@ -6,8 +6,13 @@ import 'package:tex_markdown/markdown_component.dart'; @@ -6,8 +6,13 @@ import 'package:tex_markdown/markdown_component.dart';
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, 8 const MdWidget(this.exp,
9 - {super.key, this.style, this.onLinkTab, this.followLinkColor = false}); 9 + {super.key,
  10 + this.style,
  11 + this.textDirection = TextDirection.ltr,
  12 + this.onLinkTab,
  13 + this.followLinkColor = false});
10 final String exp; 14 final String exp;
  15 + final TextDirection textDirection;
11 final TextStyle? style; 16 final TextStyle? style;
12 final void Function(String url, String title)? onLinkTab; 17 final void Function(String url, String title)? onLinkTab;
13 final bool followLinkColor; 18 final bool followLinkColor;
@@ -93,6 +98,7 @@ $value @@ -93,6 +98,7 @@ $value
93 ), 98 ),
94 WidgetSpan( 99 WidgetSpan(
95 child: Table( 100 child: Table(
  101 + textDirection: textDirection,
96 defaultColumnWidth: CustomTableColumnWidth(), 102 defaultColumnWidth: CustomTableColumnWidth(),
97 defaultVerticalAlignment: TableCellVerticalAlignment.middle, 103 defaultVerticalAlignment: TableCellVerticalAlignment.middle,
98 border: TableBorder.all( 104 border: TableBorder.all(
@@ -107,6 +113,7 @@ $value @@ -107,6 +113,7 @@ $value
107 (index) => Center( 113 (index) => Center(
108 child: MdWidget( 114 child: MdWidget(
109 (e[index] ?? "").trim(), 115 (e[index] ?? "").trim(),
  116 + textDirection: textDirection,
110 onLinkTab: onLinkTab, 117 onLinkTab: onLinkTab,
111 style: style, 118 style: style,
112 ), 119 ),
@@ -126,7 +133,12 @@ $value @@ -126,7 +133,12 @@ $value
126 } else { 133 } else {
127 list.addAll( 134 list.addAll(
128 MarkdownComponent.generate( 135 MarkdownComponent.generate(
129 - context, eachLn.trim(), style, onLinkTab), 136 + context,
  137 + eachLn.trim(),
  138 + style,
  139 + textDirection,
  140 + onLinkTab,
  141 + ),
130 ); 142 );
131 } 143 }
132 return ""; 144 return "";
@@ -137,6 +149,7 @@ $value @@ -137,6 +149,7 @@ $value
137 children: list, 149 children: list,
138 style: style, 150 style: style,
139 ), 151 ),
  152 + textDirection: textDirection,
140 ); 153 );
141 } 154 }
142 } 155 }
@@ -11,8 +11,10 @@ class TexMarkdown extends StatelessWidget { @@ -11,8 +11,10 @@ class TexMarkdown extends StatelessWidget {
11 super.key, 11 super.key,
12 this.style, 12 this.style,
13 this.followLinkColor = false, 13 this.followLinkColor = false,
  14 + this.textDirection = TextDirection.ltr,
14 this.onLinkTab, 15 this.onLinkTab,
15 }); 16 });
  17 + final TextDirection textDirection;
16 final String data; 18 final String data;
17 final TextStyle? style; 19 final TextStyle? style;
18 final void Function(String url, String title)? onLinkTab; 20 final void Function(String url, String title)? onLinkTab;
@@ -30,6 +32,7 @@ class TexMarkdown extends StatelessWidget { @@ -30,6 +32,7 @@ class TexMarkdown extends StatelessWidget {
30 return ClipRRect( 32 return ClipRRect(
31 child: MdWidget( 33 child: MdWidget(
32 data.trim(), 34 data.trim(),
  35 + textDirection: textDirection,
33 style: style, 36 style: style,
34 onLinkTab: onLinkTab, 37 onLinkTab: onLinkTab,
35 followLinkColor: followLinkColor, 38 followLinkColor: followLinkColor,
@@ -2,6 +2,7 @@ name: tex_markdown @@ -2,6 +2,7 @@ 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.1.9 3 version: 0.1.9
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 +publish_to: "none"
5 6
6 environment: 7 environment:
7 sdk: '>=3.1.0 <4.0.0' 8 sdk: '>=3.1.0 <4.0.0'
@@ -10,7 +11,9 @@ environment: @@ -10,7 +11,9 @@ environment:
10 dependencies: 11 dependencies:
11 flutter: 12 flutter:
12 sdk: flutter 13 sdk: flutter
13 - tex_text: ^0.1.8 14 + # tex_text: ^0.1.8
  15 + tex_text:
  16 + path: ../tex_text
14 17
15 dev_dependencies: 18 dev_dependencies:
16 flutter_test: 19 flutter_test:
@@ -14,12 +14,17 @@ class MyApp extends StatefulWidget { @@ -14,12 +14,17 @@ class MyApp extends StatefulWidget {
14 } 14 }
15 15
16 class _MyAppState extends State<MyApp> { 16 class _MyAppState extends State<MyApp> {
17 - final TextEditingController _text = TextEditingController(); 17 + final TextEditingController _text = TextEditingController(
  18 + text: r"Some random text and $x^2+y^2=$ some thing");
18 @override 19 @override
19 Widget build(BuildContext context) { 20 Widget build(BuildContext context) {
20 return MaterialApp( 21 return MaterialApp(
21 home: Scaffold( 22 home: Scaffold(
22 - appBar: AppBar(title: const Text("Tex Text.")), 23 + appBar: AppBar(
  24 + title: const Text(
  25 + "Tex Text .",
  26 + textDirection: TextDirection.rtl,
  27 + )),
23 body: Column( 28 body: Column(
24 mainAxisAlignment: MainAxisAlignment.start, 29 mainAxisAlignment: MainAxisAlignment.start,
25 crossAxisAlignment: CrossAxisAlignment.start, 30 crossAxisAlignment: CrossAxisAlignment.start,
@@ -39,6 +44,7 @@ class _MyAppState extends State<MyApp> { @@ -39,6 +44,7 @@ class _MyAppState extends State<MyApp> {
39 child: TexText( 44 child: TexText(
40 // TexText.newEasySyntax(_text.text), 45 // TexText.newEasySyntax(_text.text),
41 _text.text, 46 _text.text,
  47 + textDirection: TextDirection.rtl,
42 style: Theme.of(context) 48 style: Theme.of(context)
43 .textTheme 49 .textTheme
44 .titleLarge 50 .titleLarge
@@ -182,7 +182,7 @@ @@ -182,7 +182,7 @@
182 isa = PBXProject; 182 isa = PBXProject;
183 attributes = { 183 attributes = {
184 LastSwiftUpdateCheck = 0920; 184 LastSwiftUpdateCheck = 0920;
185 - LastUpgradeCheck = 1300; 185 + LastUpgradeCheck = 1430;
186 ORGANIZATIONNAME = ""; 186 ORGANIZATIONNAME = "";
187 TargetAttributes = { 187 TargetAttributes = {
188 33CC10EC2044A3C60003C045 = { 188 33CC10EC2044A3C60003C045 = {
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <Scheme 2 <Scheme
3 - LastUpgradeVersion = "1300" 3 + LastUpgradeVersion = "1430"
4 version = "1.3"> 4 version = "1.3">
5 <BuildAction 5 <BuildAction
6 parallelizeBuildables = "YES" 6 parallelizeBuildables = "YES"
@@ -5,10 +5,10 @@ packages: @@ -5,10 +5,10 @@ packages:
5 dependency: transitive 5 dependency: transitive
6 description: 6 description:
7 name: args 7 name: args
8 - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a 8 + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
9 url: "https://pub.dev" 9 url: "https://pub.dev"
10 source: hosted 10 source: hosted
11 - version: "2.4.1" 11 + version: "2.4.2"
12 async: 12 async:
13 dependency: transitive 13 dependency: transitive
14 description: 14 description:
@@ -45,18 +45,18 @@ packages: @@ -45,18 +45,18 @@ packages:
45 dependency: transitive 45 dependency: transitive
46 description: 46 description:
47 name: collection 47 name: collection
48 - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" 48 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
49 url: "https://pub.dev" 49 url: "https://pub.dev"
50 source: hosted 50 source: hosted
51 - version: "1.17.1" 51 + version: "1.18.0"
52 cupertino_icons: 52 cupertino_icons:
53 dependency: "direct main" 53 dependency: "direct main"
54 description: 54 description:
55 name: cupertino_icons 55 name: cupertino_icons
56 - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 56 + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
57 url: "https://pub.dev" 57 url: "https://pub.dev"
58 source: hosted 58 source: hosted
59 - version: "1.0.5" 59 + version: "1.0.6"
60 fake_async: 60 fake_async:
61 dependency: transitive 61 dependency: transitive
62 description: 62 description:
@@ -74,71 +74,63 @@ packages: @@ -74,71 +74,63 @@ packages:
74 dependency: "direct dev" 74 dependency: "direct dev"
75 description: 75 description:
76 name: flutter_lints 76 name: flutter_lints
77 - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c 77 + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
78 url: "https://pub.dev" 78 url: "https://pub.dev"
79 source: hosted 79 source: hosted
80 - version: "2.0.1" 80 + version: "2.0.3"
81 flutter_math_fork: 81 flutter_math_fork:
82 dependency: transitive 82 dependency: transitive
83 description: 83 description:
84 name: flutter_math_fork 84 name: flutter_math_fork
85 - sha256: a143a3a89131b578043ecbdb5e759c1033a1b3e9174f5cd1b979d93f4a7fb41c 85 + sha256: "94bee4642892a94939af0748c6a7de0ff8318feee588379dcdfea7dc5cba06c8"
86 url: "https://pub.dev" 86 url: "https://pub.dev"
87 source: hosted 87 source: hosted
88 - version: "0.7.1" 88 + version: "0.7.2"
89 flutter_svg: 89 flutter_svg:
90 dependency: transitive 90 dependency: transitive
91 description: 91 description:
92 name: flutter_svg 92 name: flutter_svg
93 - sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f 93 + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c
94 url: "https://pub.dev" 94 url: "https://pub.dev"
95 source: hosted 95 source: hosted
96 - version: "2.0.5" 96 + version: "2.0.9"
97 flutter_test: 97 flutter_test:
98 dependency: "direct dev" 98 dependency: "direct dev"
99 description: flutter 99 description: flutter
100 source: sdk 100 source: sdk
101 version: "0.0.0" 101 version: "0.0.0"
102 - js:  
103 - dependency: transitive  
104 - description:  
105 - name: js  
106 - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3  
107 - url: "https://pub.dev"  
108 - source: hosted  
109 - version: "0.6.7"  
110 lints: 102 lints:
111 dependency: transitive 103 dependency: transitive
112 description: 104 description:
113 name: lints 105 name: lints
114 - sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" 106 + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
115 url: "https://pub.dev" 107 url: "https://pub.dev"
116 source: hosted 108 source: hosted
117 - version: "2.1.0" 109 + version: "2.1.1"
118 matcher: 110 matcher:
119 dependency: transitive 111 dependency: transitive
120 description: 112 description:
121 name: matcher 113 name: matcher
122 - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" 114 + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
123 url: "https://pub.dev" 115 url: "https://pub.dev"
124 source: hosted 116 source: hosted
125 - version: "0.12.15" 117 + version: "0.12.16"
126 material_color_utilities: 118 material_color_utilities:
127 dependency: transitive 119 dependency: transitive
128 description: 120 description:
129 name: material_color_utilities 121 name: material_color_utilities
130 - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 122 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
131 url: "https://pub.dev" 123 url: "https://pub.dev"
132 source: hosted 124 source: hosted
133 - version: "0.2.0" 125 + version: "0.5.0"
134 meta: 126 meta:
135 dependency: transitive 127 dependency: transitive
136 description: 128 description:
137 name: meta 129 name: meta
138 - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" 130 + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
139 url: "https://pub.dev" 131 url: "https://pub.dev"
140 source: hosted 132 source: hosted
141 - version: "1.9.1" 133 + version: "1.10.0"
142 nested: 134 nested:
143 dependency: transitive 135 dependency: transitive
144 description: 136 description:
@@ -167,18 +159,18 @@ packages: @@ -167,18 +159,18 @@ packages:
167 dependency: transitive 159 dependency: transitive
168 description: 160 description:
169 name: petitparser 161 name: petitparser
170 - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 162 + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
171 url: "https://pub.dev" 163 url: "https://pub.dev"
172 source: hosted 164 source: hosted
173 - version: "5.4.0" 165 + version: "6.0.2"
174 provider: 166 provider:
175 dependency: transitive 167 dependency: transitive
176 description: 168 description:
177 name: provider 169 name: provider
178 - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f 170 + sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
179 url: "https://pub.dev" 171 url: "https://pub.dev"
180 source: hosted 172 source: hosted
181 - version: "6.0.5" 173 + version: "6.1.1"
182 sky_engine: 174 sky_engine:
183 dependency: transitive 175 dependency: transitive
184 description: flutter 176 description: flutter
@@ -188,26 +180,26 @@ packages: @@ -188,26 +180,26 @@ packages:
188 dependency: transitive 180 dependency: transitive
189 description: 181 description:
190 name: source_span 182 name: source_span
191 - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 183 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
192 url: "https://pub.dev" 184 url: "https://pub.dev"
193 source: hosted 185 source: hosted
194 - version: "1.9.1" 186 + version: "1.10.0"
195 stack_trace: 187 stack_trace:
196 dependency: transitive 188 dependency: transitive
197 description: 189 description:
198 name: stack_trace 190 name: stack_trace
199 - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 191 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
200 url: "https://pub.dev" 192 url: "https://pub.dev"
201 source: hosted 193 source: hosted
202 - version: "1.11.0" 194 + version: "1.11.1"
203 stream_channel: 195 stream_channel:
204 dependency: transitive 196 dependency: transitive
205 description: 197 description:
206 name: stream_channel 198 name: stream_channel
207 - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 199 + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
208 url: "https://pub.dev" 200 url: "https://pub.dev"
209 source: hosted 201 source: hosted
210 - version: "2.1.1" 202 + version: "2.1.2"
211 string_scanner: 203 string_scanner:
212 dependency: transitive 204 dependency: transitive
213 description: 205 description:
@@ -228,10 +220,10 @@ packages: @@ -228,10 +220,10 @@ packages:
228 dependency: transitive 220 dependency: transitive
229 description: 221 description:
230 name: test_api 222 name: test_api
231 - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb 223 + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
232 url: "https://pub.dev" 224 url: "https://pub.dev"
233 source: hosted 225 source: hosted
234 - version: "0.5.1" 226 + version: "0.6.1"
235 tex_text: 227 tex_text:
236 dependency: "direct dev" 228 dependency: "direct dev"
237 description: 229 description:
@@ -243,34 +235,34 @@ packages: @@ -243,34 +235,34 @@ packages:
243 dependency: transitive 235 dependency: transitive
244 description: 236 description:
245 name: tuple 237 name: tuple
246 - sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" 238 + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151
247 url: "https://pub.dev" 239 url: "https://pub.dev"
248 source: hosted 240 source: hosted
249 - version: "2.0.1" 241 + version: "2.0.2"
250 vector_graphics: 242 vector_graphics:
251 dependency: transitive 243 dependency: transitive
252 description: 244 description:
253 name: vector_graphics 245 name: vector_graphics
254 - sha256: "59a230f8bf37dd8b077335d1d64d895bccef0fb14f50730e3d79e8990bf3ed2b" 246 + sha256: "18f6690295af52d081f6808f2f7c69f0eed6d7e23a71539d75f4aeb8f0062172"
255 url: "https://pub.dev" 247 url: "https://pub.dev"
256 source: hosted 248 source: hosted
257 - version: "1.1.5+1" 249 + version: "1.1.9+2"
258 vector_graphics_codec: 250 vector_graphics_codec:
259 dependency: transitive 251 dependency: transitive
260 description: 252 description:
261 name: vector_graphics_codec 253 name: vector_graphics_codec
262 - sha256: "40781fe91c6d10a617c0289f7ec16cdb2d85a7f3654af2778c6d0adbf3bf45a3" 254 + sha256: "531d20465c10dfac7f5cd90b60bbe4dd9921f1ec4ca54c83ebb176dbacb7bb2d"
263 url: "https://pub.dev" 255 url: "https://pub.dev"
264 source: hosted 256 source: hosted
265 - version: "1.1.5+1" 257 + version: "1.1.9+2"
266 vector_graphics_compiler: 258 vector_graphics_compiler:
267 dependency: transitive 259 dependency: transitive
268 description: 260 description:
269 name: vector_graphics_compiler 261 name: vector_graphics_compiler
270 - sha256: "6ca1298b70edcc3486fdb14032f1a186a593f1b5f6b5e82fb10febddcb1c61bb" 262 + sha256: "03012b0a33775c5530576b70240308080e1d5050f0faf000118c20e6463bc0ad"
271 url: "https://pub.dev" 263 url: "https://pub.dev"
272 source: hosted 264 source: hosted
273 - version: "1.1.5+1" 265 + version: "1.1.9+2"
274 vector_math: 266 vector_math:
275 dependency: transitive 267 dependency: transitive
276 description: 268 description:
@@ -279,14 +271,22 @@ packages: @@ -279,14 +271,22 @@ packages:
279 url: "https://pub.dev" 271 url: "https://pub.dev"
280 source: hosted 272 source: hosted
281 version: "2.1.4" 273 version: "2.1.4"
  274 + web:
  275 + dependency: transitive
  276 + description:
  277 + name: web
  278 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
  279 + url: "https://pub.dev"
  280 + source: hosted
  281 + version: "0.3.0"
282 xml: 282 xml:
283 dependency: transitive 283 dependency: transitive
284 description: 284 description:
285 name: xml 285 name: xml
286 - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" 286 + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
287 url: "https://pub.dev" 287 url: "https://pub.dev"
288 source: hosted 288 source: hosted
289 - version: "6.3.0" 289 + version: "6.5.0"
290 sdks: 290 sdks:
291 - dart: ">=3.0.0 <4.0.0" 291 + dart: ">=3.2.0 <4.0.0"
292 flutter: ">=3.7.0-0" 292 flutter: ">=3.7.0-0"
@@ -18,10 +18,12 @@ class TexText extends StatelessWidget { @@ -18,10 +18,12 @@ class TexText extends StatelessWidget {
18 this.text, { 18 this.text, {
19 super.key, 19 super.key,
20 TextStyle? style, 20 TextStyle? style,
  21 + this.textDirection = TextDirection.ltr,
21 this.mathStyle = MathStyle.text, 22 this.mathStyle = MathStyle.text,
22 }) : _style = style; 23 }) : _style = style;
23 final String text; 24 final String text;
24 final TextStyle? _style; 25 final TextStyle? _style;
  26 + final TextDirection textDirection;
25 final MathStyle mathStyle; 27 final MathStyle mathStyle;
26 // final TexAlignment alignment; 28 // final TexAlignment alignment;
27 29
@@ -130,6 +132,7 @@ class TexText extends StatelessWidget { @@ -130,6 +132,7 @@ class TexText extends StatelessWidget {
130 onErrorFallback: (err) { 132 onErrorFallback: (err) {
131 return Text( 133 return Text(
132 "\$${p0[1]}\$", 134 "\$${p0[1]}\$",
  135 + textDirection: textDirection,
133 style: style?.copyWith( 136 style: style?.copyWith(
134 color: Theme.of(context).colorScheme.error) ?? 137 color: Theme.of(context).colorScheme.error) ??
135 TextStyle(color: Theme.of(context).colorScheme.error), 138 TextStyle(color: Theme.of(context).colorScheme.error),
@@ -154,6 +157,7 @@ class TexText extends StatelessWidget { @@ -154,6 +157,7 @@ class TexText extends StatelessWidget {
154 TextSpan( 157 TextSpan(
155 children: spans, 158 children: spans,
156 ), 159 ),
  160 + textDirection: textDirection,
157 ); 161 );
158 } 162 }
159 163