From c451af75a4a4b5d96a00acd169990a7b4dd8a965 Mon Sep 17 00:00:00 2001 From: hellohuanlin <41930132+hellohuanlin@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:59:21 -0700 Subject: [PATCH] [pointer_interceptor] Add performance warning on using pointer interceptor on iOS (#7288) Add performance warning to package README on using pointer interceptor on iOS. ## Issues Fixes https://github.com/flutter/flutter/issues/151535 --- packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md | 3 ++- packages/pointer_interceptor/pointer_interceptor/README.md | 2 ++ packages/pointer_interceptor/pointer_interceptor/pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md index 0a47b7de02e5..46a6f15db1bc 100644 --- a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md +++ b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.10.1+2 +* Adds performance warning about using multiple pointer interceptors on iOS. * Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. ## 0.10.1+1 diff --git a/packages/pointer_interceptor/pointer_interceptor/README.md b/packages/pointer_interceptor/pointer_interceptor/README.md index a2033491ae27..ebeb90cc02d5 100644 --- a/packages/pointer_interceptor/pointer_interceptor/README.md +++ b/packages/pointer_interceptor/pointer_interceptor/README.md @@ -6,6 +6,8 @@ `PointerInterceptor` is a widget that prevents mouse events from being captured by an underlying [`HtmlElementView`](https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html) in web, or an underlying [`PlatformView`](https://api.flutter.dev/flutter/widgets/PlatformViewLink-class.html) on iOS. +Using multiple `PointerInterceptor` instances on iOS can be slow and increases memory usage due to the performance overhead of the underlying platform view. + ## What is the problem? When overlaying Flutter widgets on top of `HtmlElementView`/`PlatformView` widgets that respond to mouse gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`/`PlatformView`, and not relayed to Flutter. diff --git a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml index 3e10acce31bb..af3f843cd0c8 100644 --- a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml @@ -2,7 +2,7 @@ name: pointer_interceptor description: A widget to prevent clicks from being swallowed by underlying HtmlElementViews on the web. repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pointer_interceptor%22 -version: 0.10.1+1 +version: 0.10.1+2 environment: sdk: ^3.2.0