Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
gpt_markdown
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
saminsohag
2022-12-25 21:31:38 +0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2e19bd075ea584cb2fd60a5f9a5bafbf39f209f7
2e19bd07
1 parent
d6df8b49
wrapping and table border color fixed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
51 deletions
tex_markdown/CHANGELOG.md
tex_markdown/example/lib/main.dart
tex_markdown/example/pubspec.lock
tex_markdown/lib/md_widget.dart
tex_markdown/pubspec.yaml
tex_markdown/CHANGELOG.md
View file @
2e19bd0
## 0.0.4
*
Heading, Lists, Checkboxes and RadioButton wrap fixed and Table borer color fixed.
## 0.0.3
*
More support added and heading text style changed.
...
...
tex_markdown/example/lib/main.dart
View file @
2e19bd0
...
...
@@ -7,24 +7,46 @@ void main() {
runApp
(
const
MyApp
());
}
class
MyApp
extends
State
less
Widget
{
class
MyApp
extends
State
ful
Widget
{
const
MyApp
({
super
.
key
});
@override
State
<
MyApp
>
createState
()
=>
_MyAppState
();
}
class
_MyAppState
extends
State
<
MyApp
>
{
ThemeMode
_themeMode
=
ThemeMode
.
light
;
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Flutter Demo'
,
themeMode:
_themeMode
,
theme:
ThemeData
(
useMaterial3:
true
,
brightness:
Brightness
.
light
,
colorSchemeSeed:
Colors
.
blue
,
),
home:
const
MyHomePage
(
title:
'Flutter Demo Home Page'
),
darkTheme:
ThemeData
(
useMaterial3:
true
,
brightness:
Brightness
.
dark
,
colorSchemeSeed:
Colors
.
blue
,
),
home:
MyHomePage
(
title:
'Flutter Demo Home Page'
,
onPressed:
()
{
setState
(()
{
_themeMode
=
ThemeMode
.
values
[(
_themeMode
.
index
+
1
)
%
2
];
});
},
),
);
}
}
class
MyHomePage
extends
StatefulWidget
{
const
MyHomePage
({
super
.
key
,
required
this
.
title
});
const
MyHomePage
({
super
.
key
,
required
this
.
title
,
required
this
.
onPressed
});
final
VoidCallback
?
onPressed
;
final
String
title
;
...
...
@@ -61,6 +83,12 @@ class _MyHomePageState extends State<MyHomePage> {
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
widget
.
title
),
actions:
[
IconButton
(
onPressed:
widget
.
onPressed
,
icon:
const
Icon
(
Icons
.
sunny
),
),
],
),
body:
Column
(
children:
[
...
...
tex_markdown/example/pubspec.lock
View file @
2e19bd0
...
...
@@ -204,7 +204,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.
3
"
version: "0.0.
4
"
tex_text:
dependency: transitive
description:
...
...
tex_markdown/lib/md_widget.dart
View file @
2e19bd0
import
'dart:developer'
;
import
'package:flutter/material.dart'
;
import
'package:tex_text/tex_text.dart'
;
...
...
@@ -47,7 +49,10 @@ class MdWidget extends StatelessWidget {
}
return
Table
(
defaultVerticalAlignment:
TableCellVerticalAlignment
.
middle
,
border:
TableBorder
.
all
(
width:
1
),
border:
TableBorder
.
all
(
width:
1
,
color:
Theme
.
of
(
context
).
colorScheme
.
onSurface
,
),
children:
value
.
map
<
TableRow
>(
(
e
)
=>
TableRow
(
...
...
@@ -72,34 +77,36 @@ class MdWidget extends StatelessWidget {
children:
[
Row
(
children:
[
TexText
(
"
${match?[2]}
"
,
style:
[
Theme
.
of
(
context
)
.
textTheme
.
headlineLarge
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
headlineMedium
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
headlineSmall
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
titleLarge
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
titleMedium
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
titleSmall
?.
copyWith
(
color:
style
?.
color
),
][
match
![
1
]!.
length
-
1
],
Expanded
(
child:
TexText
(
"
${match?[2]}
"
,
style:
[
Theme
.
of
(
context
)
.
textTheme
.
headlineLarge
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
headlineMedium
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
headlineSmall
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
titleLarge
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
titleMedium
?.
copyWith
(
color:
style
?.
color
),
Theme
.
of
(
context
)
.
textTheme
.
titleSmall
?.
copyWith
(
color:
style
?.
color
),
][
match
![
1
]!.
length
-
1
],
),
),
],
),
...
...
@@ -127,10 +134,12 @@ class MdWidget extends StatelessWidget {
fillColor:
ButtonStyleButton
.
allOrNull
(
style
?.
color
),
),
),
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
Expanded
(
child:
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
),
),
],
);
...
...
@@ -150,10 +159,12 @@ class MdWidget extends StatelessWidget {
fillColor:
ButtonStyleButton
.
allOrNull
(
style
?.
color
),
),
),
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
Expanded
(
child:
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
),
),
],
);
...
...
@@ -172,10 +183,12 @@ class MdWidget extends StatelessWidget {
size:
8
,
),
),
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
Expanded
(
child:
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
),
),
],
);
...
...
@@ -194,10 +207,12 @@ class MdWidget extends StatelessWidget {
.
copyWith
(
fontWeight:
FontWeight
.
bold
),
),
),
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
Expanded
(
child:
MdWidget
(
"
${match?[2]}
"
,
onLinkTab:
onLinkTab
,
style:
style
,
),
),
],
);
...
...
@@ -228,7 +243,7 @@ class MdWidget extends StatelessWidget {
if
(
onLinkTab
==
null
)
{
return
;
}
onLinkTab
!(
"
${match?[
1]}
"
,
"
${match?[2
]}
"
);
onLinkTab
!(
"
${match?[
2]}
"
,
"
${match?[1
]}
"
);
},
child:
MdWidget
(
"
${match?[1]}
"
,
...
...
tex_markdown/pubspec.yaml
View file @
2e19bd0
name
:
tex_markdown
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.
version
:
0.0.
3
version
:
0.0.
4
homepage
:
https://github.com/saminsohag/flutter_packages/tree/main/tex_markdown
environment
:
...
...
Please
register
or
login
to post a comment