David PHAM-VAN

Add documentation

# 1.3.4
* Fix dart lint warnings
* Add documentation
# 1.3.3
* Update Readme
... ...
... ... @@ -16,6 +16,8 @@
part of printing;
/// Loads an image from a Flutter [ui.Image]
/// into a [PdfImage] instance
Future<PdfImage> pdfImageFromImage(
{@required PdfDocument pdf, @required ui.Image image}) async {
final ByteData bytes =
... ... @@ -27,6 +29,8 @@ Future<PdfImage> pdfImageFromImage(
height: image.height);
}
/// Loads an image from a Flutter [ImageProvider]
/// into a [PdfImage] instance
Future<PdfImage> pdfImageFromImageProvider(
{@required PdfDocument pdf,
@required ImageProvider image,
... ...
... ... @@ -41,6 +41,9 @@ mixin Printing {
}
}
/// Prints a Pdf document to a local printer using the platform UI
/// the Pdf document is re-built in a [LayoutCallback] each time the
/// user changes a setting like the page format or orientation.
static Future<void> layoutPdf(
{@required LayoutCallback onLayout, String name = 'Document'}) async {
_onLayout = onLayout;
... ... @@ -49,6 +52,7 @@ mixin Printing {
await _channel.invokeMethod<void>('printPdf', params);
}
/// Prints a [PdfDocument] or a pdf stream to a local printer using the platform UI
@deprecated
static Future<void> printPdf({PdfDocument document, List<int> bytes}) async {
assert(document != null || bytes != null);
... ... @@ -59,6 +63,7 @@ mixin Printing {
document != null ? document.save() : bytes);
}
/// Displays a platform popup to share the Pdf document to another application
static Future<void> sharePdf(
{PdfDocument document, List<int> bytes, Rect bounds}) async {
assert(document != null || bytes != null);
... ...
... ... @@ -17,6 +17,7 @@
part of printing;
class PdfDoc extends Document {
/// Wrapper for a [Document] with zlib compression enabled by default
PdfDoc({bool compress = true})
: super(deflate: compress ? zlib.encode : null);
}
... ...