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-18 19:29:01 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e3c394ed3f65d2a6a91370a6918729bd142e14ed
e3c394ed
1 parent
f64e1828
Reorganize the printing class
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
printing/lib/src/printing.dart
printing/lib/src/printing.dart
View file @
e3c394e
...
...
@@ -24,6 +24,7 @@ mixin Printing {
static
Completer
<
List
<
int
>>
_onHtmlRendered
;
static
Completer
<
bool
>
_onCompleted
;
/// Callbacks from platform plugins
static
Future
<
void
>
_handleMethod
(
MethodCall
call
)
async
{
switch
(
call
.
method
)
{
case
'onLayout'
:
...
...
@@ -78,9 +79,10 @@ mixin Printing {
/// Prints a [PdfDocument] or a pdf stream to a local printer using the platform UI
@Deprecated
(
'use Printing.layoutPdf(onLayout: (_) => document.save());'
)
static
Future
<
void
>
printPdf
(
{
@Deprecated
(
'use bytes with document.save()'
)
PdfDocument
document
,
List
<
int
>
bytes
})
async
{
static
Future
<
void
>
printPdf
({
@Deprecated
(
'use bytes with document.save()'
)
PdfDocument
document
,
List
<
int
>
bytes
,
})
async
{
assert
(
document
!=
null
||
bytes
!=
null
);
assert
(!(
document
==
null
&&
bytes
==
null
));
...
...
@@ -90,11 +92,12 @@ mixin Printing {
}
/// Displays a platform popup to share the Pdf document to another application
static
Future
<
void
>
sharePdf
(
{
@Deprecated
(
'use bytes with document.save()'
)
PdfDocument
document
,
List
<
int
>
bytes
,
String
filename
,
Rect
bounds
})
async
{
static
Future
<
void
>
sharePdf
({
@Deprecated
(
'use bytes with document.save()'
)
PdfDocument
document
,
List
<
int
>
bytes
,
String
filename
,
Rect
bounds
,
})
async
{
assert
(
document
!=
null
||
bytes
!=
null
);
assert
(!(
document
==
null
&&
bytes
==
null
));
...
...
@@ -115,6 +118,7 @@ mixin Printing {
return
await
_channel
.
invokeMethod
(
'sharePdf'
,
params
);
}
/// Convert an html document to a pdf data
static
Future
<
List
<
int
>>
convertHtml
(
{
@required
String
html
,
String
baseUrl
,
...
...
Please
register
or
login
to post a comment