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
2022-04-13 08:55:24 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d226704ba424675ae44348886f7a00da7a0662ce
d226704b
1 parent
0cab08c9
PdfPreview supports generic Widgets as actions
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
printing/CHANGELOG.md
printing/lib/src/preview/pdf_preview.dart
printing/pubspec.yaml
printing/CHANGELOG.md
View file @
d226704
# Changelog
## 5.8.0
-
PdfPreview supports generic Widgets as actions
## 5.7.5
-
Update SWIFT code formatter to version 5
...
...
printing/lib/src/preview/pdf_preview.dart
View file @
d226704
...
...
@@ -95,8 +95,8 @@ class PdfPreview extends StatefulWidget {
/// Add a switch to show debug view
final
bool
canDebug
;
/// Additionnal actions to add to the widget
final
List
<
PdfPreviewAction
>?
actions
;
/// Additional actions to add to the widget
final
List
<
Widget
>?
actions
;
/// List of page formats the user can choose
final
Map
<
String
,
PdfPageFormat
>
pageFormats
;
...
...
@@ -107,7 +107,7 @@ class PdfPreview extends StatefulWidget {
/// Called if the user prints the pdf document
final
void
Function
(
BuildContext
context
)?
onPrinted
;
/// Called if an error creating the Pdf occured
/// Called if an error creating the Pdf occur
r
ed
final
void
Function
(
BuildContext
context
,
dynamic
error
)?
onPrintError
;
/// Called if the user shares the pdf document
...
...
@@ -258,7 +258,7 @@ class _PdfPreviewState extends State<PdfPreview> {
final
actions
=
<
Widget
>[];
if
(
widget
.
allowPrinting
&&
info
?.
canPrint
==
true
)
{
if
(
widget
.
useActions
&&
widget
.
allowPrinting
&&
info
?.
canPrint
==
true
)
{
actions
.
add
(
PdfPrintAction
(
jobName:
widget
.
pdfFileName
,
dynamicLayout:
widget
.
dynamicLayout
,
...
...
@@ -270,7 +270,7 @@ class _PdfPreviewState extends State<PdfPreview> {
));
}
if
(
widget
.
allowSharing
&&
info
?.
canShare
==
true
)
{
if
(
widget
.
useActions
&&
widget
.
allowSharing
&&
info
?.
canShare
==
true
)
{
actions
.
add
(
PdfShareAction
(
filename:
widget
.
pdfFileName
,
onShared:
...
...
@@ -278,12 +278,12 @@ class _PdfPreviewState extends State<PdfPreview> {
));
}
if
(
widget
.
canChangePageFormat
)
{
if
(
widget
.
useActions
&&
widget
.
canChangePageFormat
)
{
actions
.
add
(
PdfPageFormatAction
(
pageFormats:
widget
.
pageFormats
,
));
if
(
widget
.
canChangeOrientation
)
{
if
(
widget
.
useActions
&&
widget
.
canChangeOrientation
)
{
// ignore: prefer_const_constructors
actions
.
add
(
PdfPageOrientationAction
());
}
...
...
@@ -335,7 +335,7 @@ class _PdfPreviewState extends State<PdfPreview> {
);
}),
),
if
(
actions
.
isNotEmpty
&&
widget
.
useActions
)
if
(
actions
.
isNotEmpty
)
IconTheme
.
merge
(
data:
IconThemeData
(
color:
iconColor
,
...
...
printing/pubspec.yaml
View file @
d226704
...
...
@@ -6,7 +6,7 @@ description: >
homepage
:
https://github.com/DavBfr/dart_pdf/tree/master/printing
repository
:
https://github.com/DavBfr/dart_pdf
issue_tracker
:
https://github.com/DavBfr/dart_pdf/issues
version
:
5.
7.5
version
:
5.
8.0
environment
:
sdk
:
"
>=2.12.0
<3.0.0"
...
...
Please
register
or
login
to post a comment