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-05-17 07:14:11 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
939868d8a20139226d1a32345fec2d6ded6f5d1f
939868d8
1 parent
e165b937
Fix Wrap break condition
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
6 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/wrap.dart
pdf/pubspec.yaml
pdf/test/widget_wrap_test.dart
test/golden/widgets-wrap.pdf
pdf/CHANGELOG.md
View file @
939868d
# Changelog
## 1.8.1
-
Fix Wrap break condition
## 1.8.0
-
Improve Table.fromTextArray()
...
...
pdf/lib/widgets/wrap.dart
View file @
939868d
...
...
@@ -254,8 +254,6 @@ class Wrap extends MultiChildWidget implements SpanningWidget {
assert
(
childConstraints
!=
null
);
assert
(
mainAxisLimit
!=
null
);
final
double
spacing
=
this
.
spacing
;
final
double
runSpacing
=
this
.
runSpacing
;
final
List
<
_RunMetrics
>
runMetrics
=
<
_RunMetrics
>[];
final
Map
<
Widget
,
int
>
childRunMetrics
=
<
Widget
,
int
>{};
double
mainAxisExtent
=
0.0
;
...
...
@@ -405,7 +403,8 @@ class Wrap extends MultiChildWidget implements SpanningWidget {
}
if
(
crossAxisOffset
<
-.
01
||
crossAxisOffset
+
runCrossAxisExtent
>
containerCrossAxisExtent
)
{
crossAxisOffset
+
runCrossAxisExtent
>
containerCrossAxisExtent
+
.
01
)
{
break
;
}
...
...
pdf/pubspec.yaml
View file @
939868d
...
...
@@ -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.8.
0
version
:
1.8.
1
environment
:
sdk
:
"
>=2.3.0
<3.0.0"
...
...
pdf/test/widget_wrap_test.dart
View file @
939868d
...
...
@@ -290,6 +290,33 @@ void main() {
pdf
.
addPage
(
Page
(
build:
(
Context
context
)
=>
Wrap
()));
});
test
(
'Wrap Widget Columns'
,
()
{
final
math
.
Random
rnd
=
math
.
Random
(
42
);
pdf
.
addPage
(
MultiPage
(
pageFormat:
PdfPageFormat
.
standard
,
build:
(
Context
context
)
=>
<
Widget
>[
Wrap
(
direction:
Axis
.
vertical
,
children:
List
<
Widget
>.
generate
(
50
,
(
int
n
)
=>
Container
(
width:
PdfPageFormat
.
standard
.
availableWidth
/
3
,
padding:
const
EdgeInsets
.
only
(
left:
10
,
right:
10
,
bottom:
5
),
child:
Lorem
(
length:
rnd
.
nextInt
(
30
)
+
10
,
random:
rnd
,
textScaleFactor:
.
7
,
),
),
),
)
],
),
);
});
tearDownAll
(()
{
final
File
file
=
File
(
'widgets-wrap.pdf'
);
file
.
writeAsBytesSync
(
pdf
.
save
());
...
...
test/golden/widgets-wrap.pdf
View file @
939868d
No preview for this file type
Please
register
or
login
to post a comment