saminsohag

16081_16081 syntex fixed

  1 +## 0.0.10
  2 +
  3 +* $$_$$ syntex fixes.
  4 +
1 ## 0.0.9 5 ## 0.0.9
2 6
3 * $_$ syntex added for latex with a gard condition for \(_\). 7 * $_$ syntex added for latex with a gard condition for \(_\).
1 -import 'dart:developer';  
2 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
3 -import 'package:flutter_math_fork/flutter_math.dart';  
4 import 'package:gpt_markdown/gpt_markdown.dart'; 2 import 'package:gpt_markdown/gpt_markdown.dart';
  3 +import 'package:flutter_math_fork/flutter_math.dart';
5 4
  5 +//
6 void main() { 6 void main() {
7 runApp(const MyApp()); 7 runApp(const MyApp());
8 } 8 }
@@ -46,6 +46,7 @@ class _MyAppState extends State<MyApp> { @@ -46,6 +46,7 @@ class _MyAppState extends State<MyApp> {
46 } 46 }
47 } 47 }
48 48
  49 +//
49 class MyHomePage extends StatefulWidget { 50 class MyHomePage extends StatefulWidget {
50 const MyHomePage({super.key, required this.title, required this.onPressed}); 51 const MyHomePage({super.key, required this.title, required this.onPressed});
51 final VoidCallback? onPressed; 52 final VoidCallback? onPressed;
@@ -136,29 +137,27 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex @@ -136,29 +137,27 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex
136 ), 137 ),
137 child: LayoutBuilder(builder: (context, constraints) { 138 child: LayoutBuilder(builder: (context, constraints) {
138 return Theme( 139 return Theme(
139 - data: Theme.of(context).copyWith(  
140 - textTheme: const TextTheme(  
141 - // For H1.  
142 - headlineLarge: TextStyle(fontSize: 55),  
143 - // For H2.  
144 - headlineMedium: TextStyle(fontSize: 45),  
145 - // For H3.  
146 - headlineSmall: TextStyle(fontSize: 35),  
147 - // For H4.  
148 - titleLarge: TextStyle(fontSize: 25),  
149 - // For H5.  
150 - titleMedium: TextStyle(fontSize: 15),  
151 - // For H6.  
152 - titleSmall: TextStyle(fontSize: 10),  
153 - ),  
154 - ), 140 + data: Theme.of(context),
  141 + // .copyWith(
  142 + // textTheme: const TextTheme(
  143 + // // For H1.
  144 + // headlineLarge: TextStyle(fontSize: 55),
  145 + // // For H2.
  146 + // headlineMedium: TextStyle(fontSize: 45),
  147 + // // For H3.
  148 + // headlineSmall: TextStyle(fontSize: 35),
  149 + // // For H4.
  150 + // titleLarge: TextStyle(fontSize: 25),
  151 + // // For H5.
  152 + // titleMedium: TextStyle(fontSize: 15),
  153 + // // For H6.
  154 + // titleSmall: TextStyle(fontSize: 10),
  155 + // ),
  156 + // ),
155 child: TexMarkdown( 157 child: TexMarkdown(
156 _controller.text, 158 _controller.text,
157 textDirection: _direction, 159 textDirection: _direction,
158 - onLinkTab: (url, title) {  
159 - log(title, name: "title");  
160 - log(url, name: "url");  
161 - }, 160 + onLinkTab: (url, title) {},
162 textAlign: TextAlign.justify, 161 textAlign: TextAlign.justify,
163 // textScaler: const TextScaler.linear(1.3), 162 // textScaler: const TextScaler.linear(1.3),
164 textScaleFactor: 1, 163 textScaleFactor: 1,
@@ -182,7 +182,7 @@ packages: @@ -182,7 +182,7 @@ packages:
182 path: ".." 182 path: ".."
183 relative: true 183 relative: true
184 source: path 184 source: path
185 - version: "0.0.9" 185 + version: "0.0.10"
186 http: 186 http:
187 dependency: transitive 187 dependency: transitive
188 description: 188 description:
@@ -36,6 +36,7 @@ class TexMarkdown extends StatelessWidget { @@ -36,6 +36,7 @@ class TexMarkdown extends StatelessWidget {
36 .replaceAllMapped( 36 .replaceAllMapped(
37 RegExp( 37 RegExp(
38 r"(?<!\\)\$\$(.*?)(?<!\\)\$\$", 38 r"(?<!\\)\$\$(.*?)(?<!\\)\$\$",
  39 + dotAll: true,
39 ), 40 ),
40 (match) => "\\[${match[1] ?? ""}\\]") 41 (match) => "\\[${match[1] ?? ""}\\]")
41 .replaceAllMapped( 42 .replaceAllMapped(
1 name: gpt_markdown 1 name: gpt_markdown
2 description: "The purpose of this package is to render the response of ChatGPT into a Flutter app." 2 description: "The purpose of this package is to render the response of ChatGPT into a Flutter app."
3 -version: 0.0.9 3 +version: 0.0.10
4 homepage: https://github.com/saminsohag/flutter_packages/tree/main/gpt_markdown 4 homepage: https://github.com/saminsohag/flutter_packages/tree/main/gpt_markdown
5 5
6 environment: 6 environment: