Skip to content

Commit

Permalink
Deprecate the document argument in Printing.sharePdf()
Browse files Browse the repository at this point in the history
  • Loading branch information
DavBfr committed May 17, 2019
1 parent 5115814 commit 1bda9db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pdf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.3.10
* Deprecate the document argument in Printing.sharePdf()

# 1.3.9
* Fix Transform Widget alignment
* Fix CustomPaint Widget size
Expand Down
2 changes: 1 addition & 1 deletion pdf/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A pdf producer for Dart. It can create pdf files for both web or fl
homepage: https://github.com/DavBfr/dart_pdf/tree/master/pdf
repository: https://github.com/DavBfr/dart_pdf
issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version: 1.3.9
version: 1.3.10

environment:
sdk: ">=2.1.0 <3.0.0"
Expand Down
1 change: 1 addition & 0 deletions printing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 2.0.3
* Add file save and view to example application
* Convert print screen example to Widgets
* Deprecate the document argument in Printing.sharePdf()

# 2.0.2
* Fix example application
Expand Down
8 changes: 5 additions & 3 deletions printing/lib/src/printing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ mixin Printing {
}

/// 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 {
@Deprecated('use Printing.layoutPdf(onLayout: (_) => document.save());')
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));

Expand All @@ -64,7 +66,7 @@ mixin Printing {

/// Displays a platform popup to share the Pdf document to another application
static Future<void> sharePdf(
{PdfDocument document,
{@Deprecated('use bytes with document.save()') PdfDocument document,
List<int> bytes,
String filename,
Rect bounds}) async {
Expand Down

0 comments on commit 1bda9db

Please sign in to comment.