Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 11.20.1
- **FIX**: Resolve issue where DeferPointer shows an error when the hero animations is running for the text layers from the custom screens.

## 11.20.0
- **FEAT**(main-editor): Add the flag `enableSubEditorPage` which allows sub-editors to be opened with the same constraints as the editor itself. More details in PR [#752](https://github.com/hm21/pro_image_editor/pull/752).

Expand Down
7 changes: 6 additions & 1 deletion lib/plugins/defer_pointer/defer_pointer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ class DeferPointer extends StatelessWidget {

@override
Widget build(BuildContext context) {
final link = this.link ?? DeferredPointerHandler.of(context).link;
final link = this.link ?? DeferredPointerHandler.maybeOf(context)?.link;

if (link == null) {
return child;
}

return _DeferPointerRenderObjectWidget(
link: link,
deferPaint: paintOnTop,
Expand Down
17 changes: 12 additions & 5 deletions lib/plugins/defer_pointer/deferred_pointer_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ class DeferredPointerHandler extends StatefulWidget {
DeferredPointerHandlerState createState() => DeferredPointerHandlerState();

/// The state from the closest instance of this class that encloses the given
/// context.
static DeferredPointerHandlerState of(BuildContext context) {
/// context, or null if there is no instance in the tree.
static DeferredPointerHandlerState? maybeOf(BuildContext context) {
final inherited = context
.dependOnInheritedWidgetOfExactType<_InheritedDeferredPaintSurface>();
assert(inherited != null,
'DeferredPaintSurface was not found on this context.');
return inherited!.state;
return inherited?.state;
}

/// The state from the closest instance of this class that encloses the given
/// context.
static DeferredPointerHandlerState of(BuildContext context) {
final DeferredPointerHandlerState? result = maybeOf(context);
assert(
result != null, 'DeferredPaintSurface was not found on this context.');
return result!;
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pro_image_editor
description: "A Flutter image editor: Seamlessly enhance your images with user-friendly editing features."
version: 11.20.0
version: 11.20.1
homepage: https://github.com/hm21/pro_image_editor/
repository: https://github.com/hm21/pro_image_editor/
documentation: https://github.com/hm21/pro_image_editor/
Expand Down