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-09-07 08:49:02 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8a5f7c1dcf3a3248ac660cc2d8092f432a10761d
8a5f7c1d
1 parent
59aa20c0
Fix Table.fromTextArray alignments with multi-lines text
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/table.dart
pdf/pubspec.yaml
pdf/CHANGELOG.md
View file @
8a5f7c1
# Changelog
## 1.11.1
-
Fix Table.fromTextArray alignments with multi-lines text
## 1.11.0
-
Fix mixing Arabic with English
[
Anas Altair
]
...
...
pdf/lib/widgets/table.dart
View file @
8a5f7c1
...
...
@@ -286,9 +286,13 @@ class Table extends Widget implements SpanningWidget {
if
(
rowNum
<
headerCount
)
{
for
(
final
dynamic
cell
in
row
)
{
final
Alignment
align
=
headerAlignments
[
tableRow
.
length
]
??
headerAlignment
;
final
TextAlign
textAlign
=
_textAlign
(
align
);
tableRow
.
add
(
Container
(
alignment:
headerAlignments
[
tableRow
.
length
]
??
headerAlignment
,
alignment:
align
,
padding:
headerPadding
,
constraints:
BoxConstraints
(
minHeight:
headerHeight
),
child:
Text
(
...
...
@@ -296,15 +300,19 @@ class Table extends Widget implements SpanningWidget {
?
cell
.
toString
()
:
headerFormat
(
tableRow
.
length
,
cell
),
style:
headerStyle
,
textAlign:
textAlign
,
),
),
);
}
}
else
{
for
(
final
dynamic
cell
in
row
)
{
final
Alignment
align
=
cellAlignments
[
tableRow
.
length
]
??
cellAlignment
;
final
TextAlign
textAlign
=
_textAlign
(
align
);
tableRow
.
add
(
Container
(
alignment:
cellAlignments
[
tableRow
.
length
]
??
cellAlignment
,
alignment:
align
,
padding:
cellPadding
,
constraints:
BoxConstraints
(
minHeight:
cellHeight
),
child:
Text
(
...
...
@@ -312,6 +320,7 @@ class Table extends Widget implements SpanningWidget {
?
cell
.
toString
()
:
cellFormat
(
tableRow
.
length
,
cell
),
style:
isOdd
?
oddCellStyle
:
cellStyle
,
textAlign:
textAlign
,
),
),
);
...
...
@@ -585,4 +594,14 @@ class Table extends Widget implements SpanningWidget {
border
.
paint
(
context
,
box
,
_widths
,
_heights
);
}
}
static
TextAlign
_textAlign
(
Alignment
align
)
{
if
(
align
.
x
==
0
)
{
return
TextAlign
.
center
;
}
else
if
(
align
.
x
<
0
)
{
return
TextAlign
.
left
;
}
else
{
return
TextAlign
.
right
;
}
}
}
...
...
pdf/pubspec.yaml
View file @
8a5f7c1
...
...
@@ -4,7 +4,7 @@ description: A pdf producer for Dart. It can create pdf files for both web or fl
homepage
:
https://github.com/DavBfr/dart_pdf/tree/master/pdf
repository
:
https://github.com/DavBfr/dart_pdf
issue_tracker
:
https://github.com/DavBfr/dart_pdf/issues
version
:
1.11.
0
version
:
1.11.
1
environment
:
sdk
:
"
>=2.3.0
<3.0.0"
...
...
Please
register
or
login
to post a comment