Skip to content

Commit

Permalink
Merge branch 'adil192-fix-flutter-3.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
DavBfr committed Feb 21, 2024
2 parents 406396b + 3a58406 commit 232ed40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 60 deletions.
4 changes: 4 additions & 0 deletions widget_wrapper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.3

- Add compatibility with Flutter 3.19.0

## 1.0.2

- Add compatibility with Flutter 3.18.0-1.0.pre.23
Expand Down
61 changes: 3 additions & 58 deletions widget_wrapper/lib/src/widget_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,9 @@ class WidgetWrapper extends pw.ImageProvider {
child: RenderPositionedBox(
alignment: Alignment.center, child: repaintBoundary),
configuration: ViewConfiguration(
physicalConstraints: BoxConstraints(
maxWidth: computedConstraints.maxWidth,
maxHeight: computedConstraints.maxHeight,
),
logicalConstraints: BoxConstraints(
maxWidth: computedConstraints.maxWidth,
maxHeight: computedConstraints.maxHeight,
size: Size(
computedConstraints.maxWidth,
computedConstraints.maxHeight,
),
devicePixelRatio: view.devicePixelRatio),
view: view,
Expand Down Expand Up @@ -232,54 +228,3 @@ class WidgetWrapper extends pw.ImageProvider {
);
}
}

/// ImageProvider that draws a Flutter Widget on a PDF document
@Deprecated('Use WidgetWrapper instead')
class WidgetWraper extends WidgetWrapper {
WidgetWraper._(
Uint8List bytes,
int width,
int height,
PdfImageOrientation orientation,
double? dpi,
) : super._(bytes, width, height, orientation, dpi);

/// Wrap a Flutter Widget identified by a GlobalKey to an ImageProvider.
@Deprecated('Use WidgetWrapper.fromKey instead')
static Future<WidgetWrapper> fromKey({
required GlobalKey key,
int? width,
int? height,
double pixelRatio = 1.0,
PdfImageOrientation? orientation,
double? dpi,
}) {
return WidgetWrapper.fromKey(
key: key,
width: width,
pixelRatio: pixelRatio,
orientation: orientation,
dpi: dpi,
);
}

/// Wrap a Flutter Widget to an ImageProvider.
@Deprecated('Use WidgetWrapper.fromWidget instead')
static Future<WidgetWrapper> fromWidget({
required BuildContext context,
required Widget widget,
required BoxConstraints constraints,
double pixelRatio = 1.0,
PdfImageOrientation? orientation,
double? dpi,
}) {
return WidgetWrapper.fromWidget(
context: context,
widget: widget,
constraints: constraints,
pixelRatio: pixelRatio,
orientation: orientation,
dpi: dpi,
);
}
}
4 changes: 2 additions & 2 deletions widget_wrapper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ description: >
homepage: https://github.com/DavBfr/dart_pdf/tree/master/widget_wrapper
repository: https://github.com/DavBfr/dart_pdf
issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version: 1.0.2
version: 1.0.3

environment:
sdk: ">=2.18.0 <4.0.0"
flutter: ">=3.19.0-9.0.pre.202"
flutter: ">=3.19.0"

dependencies:
flutter:
Expand Down

0 comments on commit 232ed40

Please sign in to comment.