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
2019-04-01 19:43:50 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a23ef0691e8e460187e28353ece0ae16fc25aa4d
a23ef069
1 parent
c71e8d4d
Add SizedBox Widget
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/basic.dart
pdf/CHANGELOG.md
View file @
a23ef06
...
...
@@ -2,6 +2,7 @@
*
Add jpeg image loading function
*
Add Theme::copyFrom() method
*
Allow Annotations in TextSpan
*
Add SizedBox Widget
# 1.3.7
*
Add Pdf Creation date
...
...
pdf/lib/widgets/basic.dart
View file @
a23ef06
...
...
@@ -470,3 +470,39 @@ class CustomPaint extends SingleChildWidget {
context
.
canvas
.
restoreContext
();
}
}
/// A box with a specified size.
class
SizedBox
extends
StatelessWidget
{
/// Creates a fixed size box.
SizedBox
({
this
.
width
,
this
.
height
,
this
.
child
});
/// Creates a box that will become as large as its parent allows.
SizedBox
.
expand
({
this
.
child
})
:
width
=
double
.
infinity
,
height
=
double
.
infinity
;
/// Creates a box that will become as small as its parent allows.
SizedBox
.
shrink
({
this
.
child
})
:
width
=
0.0
,
height
=
0.0
;
/// Creates a box with the specified size.
SizedBox
.
fromSize
({
this
.
child
,
PdfPoint
size
})
:
width
=
size
?.
x
,
height
=
size
?.
y
;
/// If non-null, requires the child to have exactly this width.
final
double
width
;
/// If non-null, requires the child to have exactly this height.
final
double
height
;
final
Widget
child
;
@override
Widget
build
(
Context
context
)
{
return
ConstrainedBox
(
child:
child
,
constraints:
BoxConstraints
.
tightFor
(
width:
width
,
height:
height
));
}
}
...
...
Please
register
or
login
to post a comment