Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
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
David PHAM-VAN
2020-12-18 08:33:28 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ffd9206f5096d82def88d8b21c17bbab7ee44745
ffd9206f
1 parent
c5845a7f
Fix RichText.maxLines with multiple TextSpan
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/text.dart
pdf/test/widget_text_test.dart
test/golden/widgets-text.pdf
pdf/CHANGELOG.md
View file @
ffd9206
...
...
@@ -17,6 +17,7 @@
-
Add blend mode
-
Add soft mask
-
Remove dependency to the deprecated utf library
-
Fix RichText.maxLines with multiple TextSpan
## 1.12.0
...
...
pdf/lib/widgets/text.dart
View file @
ffd9206
...
...
@@ -629,7 +629,7 @@ class RichText extends Widget {
lines
++;
if
(
maxLines
!=
null
&&
lines
>
maxLines
)
{
break
;
return
false
;
}
offsetX
=
0.0
;
...
...
@@ -693,7 +693,7 @@ class RichText extends Widget {
lines
++;
if
(
maxLines
!=
null
&&
lines
>
maxLines
)
{
break
;
return
false
;
}
offsetX
=
0.0
;
...
...
pdf/test/widget_text_test.dart
View file @
ffd9206
...
...
@@ -270,6 +270,26 @@ void main() {
));
});
test
(
'Text Widgets RichText maxLines'
,
()
{
final
rnd
=
math
.
Random
(
42
);
final
para
=
LoremText
(
random:
rnd
).
paragraph
(
30
);
pdf
.
addPage
(
Page
(
build:
(
Context
context
)
=>
RichText
(
maxLines:
3
,
text:
TextSpan
(
text:
para
,
children:
List
<
TextSpan
>.
generate
(
4
,
(
index
)
=>
TextSpan
(
text:
para
),
),
),
),
),
);
});
tearDownAll
(()
{
final
file
=
File
(
'widgets-text.pdf'
);
file
.
writeAsBytesSync
(
pdf
.
save
());
...
...
test/golden/widgets-text.pdf
View file @
ffd9206
No preview for this file type
Please
register
or
login
to post a comment