saminsohag

new line support added

  1 +## 0.0.4
  2 +
  3 +* New line support added.
  4 +
1 ## 0.0.3 5 ## 0.0.3
2 6
3 * Equation alignment fixed. 7 * Equation alignment fixed.
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
4 import 'package:flutter_math_fork/flutter_math.dart'; 4 import 'package:flutter_math_fork/flutter_math.dart';
5 export 'package:flutter_math_fork/flutter_math.dart'; 5 export 'package:flutter_math_fork/flutter_math.dart';
6 6
7 -/// A Calculator. 7 +/// A LaTex text view.
8 class TexText extends StatelessWidget { 8 class TexText extends StatelessWidget {
9 const TexText(this.text, 9 const TexText(this.text,
10 {super.key, 10 {super.key,
@@ -18,11 +18,16 @@ class TexText extends StatelessWidget { @@ -18,11 +18,16 @@ class TexText extends StatelessWidget {
18 18
19 @override 19 @override
20 Widget build(BuildContext context) { 20 Widget build(BuildContext context) {
  21 + return Column(
  22 + mainAxisSize: MainAxisSize.min,
  23 + crossAxisAlignment: CrossAxisAlignment.values[alignment.index % 3],
  24 + children: text.split('\n').map<Widget>(
  25 + (e) {
21 return Wrap( 26 return Wrap(
22 alignment: alignment, 27 alignment: alignment,
23 crossAxisAlignment: WrapCrossAlignment.center, 28 crossAxisAlignment: WrapCrossAlignment.center,
24 spacing: 4, 29 spacing: 4,
25 - children: text 30 + children: e
26 .split("<m>") 31 .split("<m>")
27 .asMap() 32 .asMap()
28 .map<int, List<Widget>>( 33 .map<int, List<Widget>>(
@@ -41,13 +46,12 @@ class TexText extends StatelessWidget { @@ -41,13 +46,12 @@ class TexText extends StatelessWidget {
41 } 46 }
42 return MapEntry( 47 return MapEntry(
43 index, 48 index,
44 - e  
45 - .split(" ")  
46 - .map<Widget>((e) => Text( 49 + e.split(" ").map<Widget>((e) {
  50 + return Text(
47 e, 51 e,
48 style: style, 52 style: style,
49 - ))  
50 - .toList(), 53 + );
  54 + }).toList(),
51 ); 55 );
52 }, 56 },
53 ) 57 )
@@ -56,5 +60,8 @@ class TexText extends StatelessWidget { @@ -56,5 +60,8 @@ class TexText extends StatelessWidget {
56 .expand<Widget>((element) => element) 60 .expand<Widget>((element) => element)
57 .toList(), 61 .toList(),
58 ); 62 );
  63 + },
  64 + ).toList(),
  65 + );
59 } 66 }
60 } 67 }
1 name: tex_text 1 name: tex_text
2 description: This package for Flutter allows you to show text on a Flutter app with LaTex math formula and normal text from string. It is vary easy to use and works for all of the platforms. 2 description: This package for Flutter allows you to show text on a Flutter app with LaTex math formula and normal text from string. It is vary easy to use and works for all of the platforms.
3 -version: 0.0.3 3 +version: 0.0.4
4 homepage: https://github.com/saminsohag/flutter_packages/tree/main/tex_text 4 homepage: https://github.com/saminsohag/flutter_packages/tree/main/tex_text
5 5
6 environment: 6 environment: