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-13 08:03:57 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
77046656233d8d32e6e574212525d11dfdd1f985
77046656
1 parent
0d16751f
Fix Spacer Widget
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
16 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/flex.dart
pdf/test/widget_flex_test.dart
test/golden/widgets-flex.pdf
pdf/CHANGELOG.md
View file @
7704665
...
...
@@ -7,6 +7,7 @@
-
Fix PdfColors.fromHex()
-
Update Barcode library to 1.9.0
-
Fix exif orientation crash
-
Fix Spacer Widget
## 1.7.1
...
...
pdf/lib/widgets/flex.dart
View file @
7704665
...
...
@@ -582,22 +582,15 @@ class Expanded extends Flexible {
/// Spacer creates an adjustable, empty spacer that can be used to tune the
/// spacing between widgets in a [Flex] container, like [Row] or [Column].
class
Spacer
extends
StatelessWidget
{
Spacer
({
this
.
flex
=
1
})
class
Spacer
extends
Flexible
{
Spacer
({
int
flex
=
1
})
:
assert
(
flex
!=
null
),
assert
(
flex
>
0
),
super
();
/// The flex factor to use in determining how much space to take up.
final
int
flex
;
@override
Widget
build
(
Context
context
)
{
return
Expanded
(
flex:
flex
,
child:
SizedBox
.
shrink
(),
);
}
super
(
flex:
flex
,
fit:
FlexFit
.
tight
,
child:
SizedBox
.
shrink
(),
);
}
typedef
IndexedWidgetBuilder
=
Widget
Function
(
Context
context
,
int
index
);
...
...
pdf/test/widget_flex_test.dart
View file @
7704665
...
...
@@ -75,6 +75,24 @@ void main() {
);
});
test
(
'Flex Widgets Spacer'
,
()
{
pdf
.
addPage
(
Page
(
build:
(
Context
context
)
=>
Column
(
children:
<
Widget
>[
Text
(
'Begin'
),
Spacer
(),
// Defaults to a flex of one.
Text
(
'Middle'
),
// Gives twice the space between Middle and End than Begin and Middle.
Spacer
(
flex:
2
),
// Expanded(flex: 2, child: SizedBox.shrink()),
Text
(
'End'
),
],
),
),
);
});
tearDownAll
(()
{
final
File
file
=
File
(
'widgets-flex.pdf'
);
file
.
writeAsBytesSync
(
pdf
.
save
());
...
...
test/golden/widgets-flex.pdf
View file @
7704665
No preview for this file type
Please
register
or
login
to post a comment