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-09-07 20:19:47 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
37877101a72ca0b79ff3937532f5621cca19fdc8
37877101
1 parent
31f681a5
Add Watermark widget
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/content.dart
pdf/CHANGELOG.md
View file @
3787710
...
...
@@ -3,6 +3,7 @@
## 1.3.20
-
Fix Transform.rotateBox
-
Add Watermark widget
## 1.3.19
...
...
pdf/lib/widgets/content.dart
View file @
3787710
...
...
@@ -181,3 +181,48 @@ class Bullet extends StatelessWidget {
]));
}
}
class
Watermark
extends
StatelessWidget
{
Watermark
({
@required
this
.
child
,
this
.
fit
=
BoxFit
.
contain
,
this
.
angle
=
0
,
})
:
assert
(
fit
!=
null
),
assert
(
child
!=
null
),
assert
(
angle
!=
null
);
Watermark
.
text
(
String
text
,
{
TextStyle
style
,
this
.
fit
=
BoxFit
.
contain
,
this
.
angle
=
math
.
pi
/
4
,
})
:
assert
(
fit
!=
null
),
assert
(
angle
!=
null
),
child
=
Text
(
text
,
style:
style
??
TextStyle
(
color:
PdfColors
.
grey200
,
fontWeight:
FontWeight
.
bold
,
),
);
final
Widget
child
;
final
double
angle
;
final
BoxFit
fit
;
@override
Widget
build
(
Context
context
)
{
return
SizedBox
.
expand
(
child:
FittedBox
(
fit:
fit
,
child:
Transform
.
rotateBox
(
angle:
angle
,
child:
child
,
),
),
);
}
}
...
...
Please
register
or
login
to post a comment