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
2024-08-05 06:44:31 +0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c89ea74ac6ba8744c1e8a0071bd8861576283753
c89ea74a
1 parent
3df2c983
getRich added to config
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
14 deletions
gpt_markdown/example/lib/main.dart
gpt_markdown/lib/custom_widgets/markdow_config.dart
gpt_markdown/lib/markdown_component.dart
gpt_markdown/lib/md_widget.dart
gpt_markdown/example/lib/main.dart
View file @
c89ea74
...
...
@@ -178,8 +178,8 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex
debugPrint(url);
debugPrint(title);
},
// maxLines: 3,
// overflow: TextOverflow.ellipsis,
maxLines: 7,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.justify,
// textScaler: const TextScaler.linear(1.3),
textScaler: const TextScaler.linear(1),
...
...
gpt_markdown/lib/custom_widgets/markdow_config.dart
View file @
c89ea74
...
...
@@ -58,4 +58,15 @@ class GptMarkdownConfig {
overflow:
overflow
??
this
.
overflow
,
);
}
getRich
(
InlineSpan
span
)
{
return
Text
.
rich
(
span
,
textDirection:
textDirection
,
textScaler:
textScaler
,
textAlign:
textAlign
,
maxLines:
maxLines
,
overflow:
overflow
,
);
}
}
...
...
gpt_markdown/lib/markdown_component.dart
View file @
c89ea74
...
...
@@ -194,7 +194,7 @@ class HTag extends BlockMd {
.
titleSmall
?.
copyWith
(
color:
config
.
style
?.
color
),
][
match
![
1
]!.
length
-
1
]);
return
Text
.
r
ich
(
return
config
.
getR
ich
(
TextSpan
(
children:
[
...(
MarkdownComponent
.
generate
(
...
...
@@ -217,9 +217,6 @@ class HTag extends BlockMd {
],
],
),
textDirection:
config
.
textDirection
,
overflow:
config
.
overflow
,
maxLines:
config
.
maxLines
,
);
}
}
...
...
@@ -679,7 +676,7 @@ class ATagMd extends InlineMd {
onTap:
()
{
config
.
onLinkTab
?.
call
(
"
${match?[2]}
"
,
"
${match?[1]}
"
);
},
child:
Text
.
r
ich
(
child:
config
.
getR
ich
(
TextSpan
(
text:
"
${match?[1]}
"
,
style:
(
config
.
style
??
const
TextStyle
()).
copyWith
(
...
...
@@ -688,7 +685,6 @@ class ATagMd extends InlineMd {
decoration:
TextDecoration
.
underline
,
),
),
textDirection:
config
.
textDirection
,
),
),
);
...
...
gpt_markdown/lib/md_widget.dart
View file @
c89ea74
...
...
@@ -33,16 +33,11 @@ class MdWidget extends StatelessWidget {
config
,
),
);
return
Text
.
r
ich
(
return
config
.
getR
ich
(
TextSpan
(
children:
list
,
style:
config
.
style
?.
copyWith
(),
),
textDirection:
config
.
textDirection
,
textScaler:
config
.
textScaler
,
textAlign:
config
.
textAlign
,
maxLines:
config
.
maxLines
,
overflow:
config
.
overflow
,
);
}
}
...
...
Please
register
or
login
to post a comment