diff --git a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md index b6d9709b6f05..a74334b34629 100644 --- a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md +++ b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.0 + +* Adds iOS implementation. + ## 0.9.3+7 * Updates metadata to point to new source folder diff --git a/packages/pointer_interceptor/pointer_interceptor/README.md b/packages/pointer_interceptor/pointer_interceptor/README.md index 6da163fc5d1a..29139dac0742 100644 --- a/packages/pointer_interceptor/pointer_interceptor/README.md +++ b/packages/pointer_interceptor/pointer_interceptor/README.md @@ -1,24 +1,25 @@ # pointer_interceptor -`PointerInterceptor` is a widget that prevents mouse events (in web) from being captured by an underlying [`HtmlElementView`](https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html). +| | iOS | Web | +|-------------|---------|-----| +| **Support** | iOS 11+ | Any | -You can use this widget in a cross-platform app freely. In mobile, where the issue that this plugin fixes does not exist, the widget acts as a pass-through of its `children`, without adding anything to the render tree. +`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. ## What is the problem? -When overlaying Flutter widgets on top of `HtmlElementView` widgets that respond to mouse gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`, and not relayed to Flutter. +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. -The result is that Flutter widget's `onTap` (and other) handlers won't fire as expected, but they'll affect the underlying webview. +The result is that Flutter widget's `onTap` (and other) handlers won't fire as expected, but they'll affect the underlying native platform view. |The problem...| |:-:| |![Depiction of problematic areas](https://raw.githubusercontent.com/flutter/packages/main/packages/pointer_interceptor/doc/img/affected-areas.png)| |_In the dashed areas, mouse events won't work as expected. The `HtmlElementView` will consume them before Flutter sees them._| - ## How does this work? -`PointerInterceptor` creates a platform view consisting of an empty HTML element. The element has the size of its `child` widget, and is inserted in the layer tree _behind_ its child in paint order. +In web, `PointerInterceptor` creates a platform view consisting of an empty HTML element, while on iOS it creates an empty `UIView` instead. The element has the size of its `child` widget, and is inserted in the layer tree _behind_ its child in paint order. This empty platform view doesn't do anything with mouse events, other than preventing them from reaching other platform views underneath it. diff --git a/packages/pointer_interceptor/pointer_interceptor/example/.gitignore b/packages/pointer_interceptor/pointer_interceptor/example/.gitignore index 0fa6b675c0a5..a1345d017cf7 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/.gitignore +++ b/packages/pointer_interceptor/pointer_interceptor/example/.gitignore @@ -32,7 +32,6 @@ /build/ # Web related -lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols diff --git a/packages/pointer_interceptor/pointer_interceptor/example/.metadata b/packages/pointer_interceptor/pointer_interceptor/example/.metadata index d2885b8e359e..45df7cb6cc4d 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/.metadata +++ b/packages/pointer_interceptor/pointer_interceptor/example/.metadata @@ -4,7 +4,27 @@ # This file should be version controlled and should not be manually edited. version: - revision: e6bd95bc5caa5e34c5b0285a559673984374b7ea - channel: master + revision: "969911d1d09d6c4f145e9ce27c08093e8c285561" + channel: "main" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + - platform: ios + create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart b/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart index c8d5d6f52b74..4d35073287d4 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart +++ b/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart @@ -4,176 +4,13 @@ // ignore_for_file: avoid_print -import 'dart:html' as html; - -// Imports the Flutter Driver API. -import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'package:pointer_interceptor_example/main.dart' as app; - -final Finder nonClickableButtonFinder = - find.byKey(const Key('transparent-button')); -final Finder clickableWrappedButtonFinder = - find.byKey(const Key('wrapped-transparent-button')); -final Finder clickableButtonFinder = find.byKey(const Key('clickable-button')); -final Finder backgroundFinder = - find.byKey(const ValueKey('background-widget')); - void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - group('Without semantics', () { - testWidgets( - 'on wrapped elements, the browser does not hit the background-html-view', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAtCenter(clickableButtonFinder, tester); - - expect(element.id, isNot('background-html-view')); - }, semanticsEnabled: false); - - testWidgets( - 'on wrapped elements with intercepting set to false, the browser hits the background-html-view', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); - - expect(element.id, 'background-html-view'); - }, semanticsEnabled: false); - - testWidgets( - 'on unwrapped elements, the browser hits the background-html-view', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAtCenter(nonClickableButtonFinder, tester); - - expect(element.id, 'background-html-view'); - }, semanticsEnabled: false); - - testWidgets('on background directly', (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); - - expect(element.id, 'background-html-view'); - }, semanticsEnabled: false); - }); - - group('With semantics', () { - testWidgets('finds semantics of wrapped widgets', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - if (!_newSemanticsAvailable()) { - print('Skipping test: Needs flutter > 2.10'); - return; - } - - final html.Element element = - _getHtmlElementAtCenter(clickableButtonFinder, tester); - - expect(element.tagName.toLowerCase(), 'flt-semantics'); - expect(element.getAttribute('aria-label'), 'Works As Expected'); - }); - - testWidgets( - 'finds semantics of wrapped widgets with intercepting set to false', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - if (!_newSemanticsAvailable()) { - print('Skipping test: Needs flutter > 2.10'); - return; - } - - final html.Element element = - _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); - - expect(element.tagName.toLowerCase(), 'flt-semantics'); - expect(element.getAttribute('aria-label'), - 'Never calls onPressed transparent'); - }); - - testWidgets('finds semantics of unwrapped elements', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - if (!_newSemanticsAvailable()) { - print('Skipping test: Needs flutter > 2.10'); - return; - } - - final html.Element element = - _getHtmlElementAtCenter(nonClickableButtonFinder, tester); - - expect(element.tagName.toLowerCase(), 'flt-semantics'); - expect(element.getAttribute('aria-label'), 'Never calls onPressed'); - }); - - // Notice that, when hit-testing the background platform view, instead of - // finding a semantics node, the platform view itself is found. This is - // because the platform view does not add interactive semantics nodes into - // the framework's semantics tree. Instead, its semantics is determined by - // the HTML content of the platform view itself. Flutter's semantics tree - // simply allows the hit test to land on the platform view by making itself - // hit test transparent. - testWidgets('on background directly', (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); - - expect(element.id, 'background-html-view'); - }); - }); -} - -// Calls [_getHtmlElementAt] passing it the center of the widget identified by -// the `finder`. -html.Element _getHtmlElementAtCenter(Finder finder, WidgetTester tester) { - final Offset point = tester.getCenter(finder); - return _getHtmlElementAt(point); -} - -// Locates the DOM element at the given `point` using `elementFromPoint`. -// -// `elementFromPoint` is an approximate proxy for a hit test, although it's -// sensitive to the presence of shadow roots and browser quirks (not all -// browsers agree on what it should return in all situations). Since this test -// runs only in Chromium, it relies on Chromium's behavior. -html.Element _getHtmlElementAt(Offset point) { - // Probe at the shadow so the browser reports semantics nodes in addition to - // platform view elements. If probed from `html.document` the browser hides - // the contents of as an implementation detail. - final html.ShadowRoot glassPaneShadow = - html.document.querySelector('flt-glass-pane')!.shadowRoot!; - return glassPaneShadow.elementFromPoint(point.dx.toInt(), point.dy.toInt())!; -} - -// TODO(dit): Remove this after flutter master (2.13) lands into stable. -// This detects that we can do new semantics assertions by looking at the 'id' -// attribute on flt-semantics elements (it is now set in 2.13 and up). -bool _newSemanticsAvailable() { - final html.ShadowRoot glassPaneShadow = - html.document.querySelector('flt-glass-pane')!.shadowRoot!; - final List elements = - glassPaneShadow.querySelectorAll('flt-semantics[id]'); - return elements.isNotEmpty; + // TODO(louisehsu): given the difficulty of making the same integration tests + // work for both web and ios implementations, please find tests in their respective + // platform implementation packages. + testWidgets('placeholder test', (WidgetTester tester) async {}); } diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor/example/ios/.gitignore new file mode 100644 index 000000000000..7a7f9873ad7d --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/AppFrameworkInfo.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000000..9625e105df39 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Debug.xcconfig b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000000..ec97fc6f3021 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Release.xcconfig b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000000..c4855bfe2000 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Podfile b/packages/pointer_interceptor/pointer_interceptor/example/ios/Podfile new file mode 100644 index 000000000000..88359b225fa1 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.pbxproj b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..c0b3e74c2e16 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,559 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + F25BFF892B037A720088B2C7 /* DummyPlatformViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25BFF882B037A6C0088B2C7 /* DummyPlatformViewFactory.swift */; }; + F7B3FF2A19BF60DCE2927CCE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABC6D95C6CA2BCA05B3C28FD /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 095E300DCC1C42BD0A014AAC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 53AC91685EB02A84FAE15CFA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + ABC6D95C6CA2BCA05B3C28FD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EBBA6242570F249EF7490E9D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + F25BFF882B037A6C0088B2C7 /* DummyPlatformViewFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyPlatformViewFactory.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F7B3FF2A19BF60DCE2927CCE /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1C9A5A1A7487CB72068132AF /* Pods */ = { + isa = PBXGroup; + children = ( + EBBA6242570F249EF7490E9D /* Pods-Runner.debug.xcconfig */, + 095E300DCC1C42BD0A014AAC /* Pods-Runner.release.xcconfig */, + 53AC91685EB02A84FAE15CFA /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 1C9A5A1A7487CB72068132AF /* Pods */, + FC5EF6E923E6BF75C542BDC7 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + F25BFF882B037A6C0088B2C7 /* DummyPlatformViewFactory.swift */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + FC5EF6E923E6BF75C542BDC7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ABC6D95C6CA2BCA05B3C28FD /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 4B32A7E5952A8E40E6FE6E6C /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + D271A2AAEBA84769C4A17920 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1430; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 4B32A7E5952A8E40E6FE6E6C /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + D271A2AAEBA84769C4A17920 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F25BFF892B037A720088B2C7 /* DummyPlatformViewFactory.swift in Sources */, + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = PZ83UV676J; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.pointerinterceptorios; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = PZ83UV676J; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = PZ83UV676J; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..919434a6254f --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..87131a09bea5 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000000..41be7b255972 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,25 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + + weak var registrar = self.registrar(forPlugin: "DummyPlatform"); + + let factory = DummyPlatformViewFactory(messenger: registrar!.messenger()) + self.registrar(forPlugin: "")!.register( + factory, + withId: "dummy_platform_view") + + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..d36b1fab2d9d --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000000..dc9ada4725e9 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000000..7353c41ecf9c Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000000..797d452e4589 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000000..6ed2d933e112 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000000..4cd7b0099ca8 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000000..fe730945a01f Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000000..321773cd857a Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000000..797d452e4589 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000000..502f463a9bc8 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000000..0ec303439225 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000000..0ec303439225 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000000..e9f5fea27c70 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000000..84ac32ae7d98 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000000..8953cba09064 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000000..0467bf12aa4d Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000000..0bedcf2fd467 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..f2e259c7c939 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/Main.storyboard b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..f3c28516fb38 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift new file mode 100644 index 000000000000..5ea634fa9226 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift @@ -0,0 +1,91 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import Flutter +import UIKit + +/** + * A simple factory that creates a dummy platform view for testing. + */ +public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { + private var messenger: FlutterBinaryMessenger + + init(messenger: FlutterBinaryMessenger) { + self.messenger = messenger + super.init() + } + + public func create( + withFrame frame: CGRect, + viewIdentifier viewId: Int64, + arguments args: Any? + ) -> FlutterPlatformView { + return DummyPlatformView( + frame: frame, + viewIdentifier: viewId, + arguments: args, + binaryMessenger: messenger) + } + + public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { + return FlutterStandardMessageCodec.sharedInstance() + } +} + +/** + * A native view that will remove it's tag if clicked. + */ +public class CustomView: UIView { + + var timesClicked = 0; + var nativeLabel = UILabel() + + override public func hitTest( + _ point: CGPoint, + with event: UIEvent? + ) -> UIView? { + if (viewWithTag(1) != nil) { + viewWithTag(1)?.removeFromSuperview(); + createNativeView(view: self); + } + timesClicked += 1; + nativeLabel.text = "Traversed \(timesClicked) subviews" + return super.hitTest(point, with: event) + } + + func createNativeView(view _view: CustomView){ + nativeLabel.text = "Traversed \(timesClicked) subviews" + nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) + _view.addSubview(nativeLabel) + } +} +/** + * A flutter platform view that displays a simple native view. + */ +class DummyPlatformView: NSObject, FlutterPlatformView { + private var _view: CustomView; + + init( + frame: CGRect, + viewIdentifier viewId: Int64, + arguments args: Any?, + binaryMessenger messenger: FlutterBinaryMessenger? + ) { + _view = CustomView() + super.init() + createNativeView(view: _view) + } + + func view() -> UIView { + return _view + } + + func createNativeView(view _view: CustomView){ + let nativeLabel = UILabel() + nativeLabel.tag = 1; + nativeLabel.text = "Native View Not Clicked" + nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) + _view.addSubview(nativeLabel) + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Info.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Info.plist new file mode 100644 index 000000000000..f15383a8587d --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Runner-Bridging-Header.h b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000000..eb7e8ba8052f --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1,5 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "GeneratedPluginRegistrant.h" diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart index 74f632a60236..f62f5ad5ea06 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart +++ b/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart @@ -3,49 +3,15 @@ // found in the LICENSE file. // ignore: avoid_web_libraries_in_flutter -import 'dart:html' as html; -import 'dart:ui_web' as ui_web; import 'package:flutter/material.dart'; import 'package:pointer_interceptor/pointer_interceptor.dart'; +import 'native_widget.dart'; -const String _htmlElementViewType = '_htmlElementViewType'; const double _videoWidth = 640; const double _videoHeight = 480; -/// The html.Element that will be rendered underneath the flutter UI. -html.Element htmlElement = html.DivElement() - ..style.width = '100%' - ..style.height = '100%' - ..style.backgroundColor = '#fabada' - ..style.cursor = 'auto' - ..id = 'background-html-view'; - -// See other examples commented out below... - -// html.Element htmlElement = html.VideoElement() -// ..style.width = '100%' -// ..style.height = '100%' -// ..style.cursor = 'auto' -// ..style.backgroundColor = 'black' -// ..id = 'background-html-view' -// ..src = 'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4' -// ..poster = 'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217' -// ..controls = true; - -// html.Element htmlElement = html.IFrameElement() -// ..width = '100%' -// ..height = '100%' -// ..id = 'background-html-view' -// ..src = 'https://www.youtube.com/embed/IyFZznAk69U' -// ..style.border = 'none'; - void main() { - ui_web.platformViewRegistry.registerViewFactory( - _htmlElementViewType, - (int viewId) => htmlElement, - ); - runApp(const MyApp()); } @@ -114,13 +80,13 @@ class _MyHomePageState extends State { child: Stack( alignment: Alignment.center, children: [ - HtmlElement( + NativeWidget( key: const ValueKey('background-widget'), onClick: () { - _clickedOn('html-element'); + _clickedOn('native-element'); }, ), - Row( + Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ ElevatedButton( @@ -197,23 +163,3 @@ class _MyHomePageState extends State { ); } } - -/// Initialize the videoPlayer, then render the corresponding view... -class HtmlElement extends StatelessWidget { - /// Constructor - const HtmlElement({super.key, required this.onClick}); - - /// A function to run when the element is clicked - final VoidCallback onClick; - - @override - Widget build(BuildContext context) { - htmlElement.onClick.listen((_) { - onClick(); - }); - - return const HtmlElementView( - viewType: _htmlElementViewType, - ); - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/native_widget.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/native_widget.dart new file mode 100644 index 000000000000..37dc7b2a349a --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/lib/native_widget.dart @@ -0,0 +1,6 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +export 'platforms/native_widget_ios.dart' + if (dart.library.html) 'platforms/native_widget_web.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_ios.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_ios.dart new file mode 100644 index 000000000000..1ce481d4544e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_ios.dart @@ -0,0 +1,29 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +/// A widget representing an underlying platform view. +class NativeWidget extends StatelessWidget { + /// Constructor + const NativeWidget({super.key, required this.onClick}); + + /// Placeholder param to allow web example to work - + /// onClick functionality for iOS is in the PlatformView + final VoidCallback onClick; + + @override + Widget build(BuildContext context) { + const String viewType = 'dummy_platform_view'; + final Map creationParams = {}; + + return UiKitView( + viewType: viewType, + layoutDirection: TextDirection.ltr, + creationParams: creationParams, + creationParamsCodec: const StandardMessageCodec(), + ); + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_web.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_web.dart new file mode 100644 index 000000000000..5b9458796c5e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_web.dart @@ -0,0 +1,62 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:html' as html; +import 'dart:ui_web' as ui_web; + +import 'package:flutter/material.dart'; + +/// The html.Element that will be rendered underneath the flutter UI. +html.Element htmlElement = html.DivElement() + ..style.width = '100%' + ..style.height = '100%' + ..style.backgroundColor = '#fabada' + ..style.cursor = 'auto' + ..id = 'background-html-view'; + +// See other examples commented out below... + +// html.Element htmlElement = html.VideoElement() +// ..style.width = '100%' +// ..style.height = '100%' +// ..style.cursor = 'auto' +// ..style.backgroundColor = 'black' +// ..id = 'background-html-view' +// ..src = 'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4' +// ..poster = 'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217' +// ..controls = true; + +// html.Element htmlElement = html.IFrameElement() +// ..width = '100%' +// ..height = '100%' +// ..id = 'background-html-view' +// ..src = 'https://www.youtube.com/embed/IyFZznAk69U' +// ..style.border = 'none'; + +const String _htmlElementViewType = '_htmlElementViewType'; + +/// A widget representing an underlying html view +class NativeWidget extends StatelessWidget { + /// Constructor + const NativeWidget({super.key, required this.onClick}); + + /// A function to run when the element is clicked + final VoidCallback onClick; + + @override + Widget build(BuildContext context) { + htmlElement.onClick.listen((_) { + onClick(); + }); + + ui_web.platformViewRegistry.registerViewFactory( + _htmlElementViewType, + (int viewId) => htmlElement, + ); + + return const HtmlElementView( + viewType: _htmlElementViewType, + ); + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart b/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart index 4ca1499d3bdb..ba15650c46ed 100644 --- a/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart +++ b/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart @@ -4,4 +4,5 @@ library pointer_interceptor; -export 'src/mobile.dart' if (dart.library.html) 'src/web.dart'; +export 'package:pointer_interceptor/src/pointer_interceptor.dart'; +export 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor/lib/src/mobile.dart b/packages/pointer_interceptor/pointer_interceptor/lib/src/pointer_interceptor.dart similarity index 74% rename from packages/pointer_interceptor/pointer_interceptor/lib/src/mobile.dart rename to packages/pointer_interceptor/pointer_interceptor/lib/src/pointer_interceptor.dart index 8d645ffbcfe3..c561e1403b9b 100644 --- a/packages/pointer_interceptor/pointer_interceptor/lib/src/mobile.dart +++ b/packages/pointer_interceptor/pointer_interceptor/lib/src/pointer_interceptor.dart @@ -3,8 +3,9 @@ // found in the LICENSE file. import 'package:flutter/widgets.dart'; +import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; -/// A [Widget] that prevents clicks from being swallowed by [HtmlElementView]s. +/// A [Widget] that prevents clicks from being swallowed by PlatformViews. class PointerInterceptor extends StatelessWidget { /// Create a `PointerInterceptor` wrapping a `child`. // ignore: prefer_const_constructors_in_immutables @@ -29,6 +30,10 @@ class PointerInterceptor extends StatelessWidget { @override Widget build(BuildContext context) { - return child; + if (!intercepting) { + return child; + } + return PointerInterceptorPlatform.instance + .buildWidget(child: child, debug: debug, key: key); } } diff --git a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml index 63bfccb53922..08b7bc6ae866 100644 --- a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml @@ -1,16 +1,34 @@ 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 +repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pointer_interceptor%22 -version: 0.9.3+7 +version: 0.9.4 +publish_to: none environment: sdk: ">=3.1.0 <4.0.0" flutter: ">=3.13.0" +flutter: + plugin: + implements: pointer_interceptor_platform_interface + platforms: + web: + default_package: pointer_interceptor_web + ios: + default_package: pointer_interceptor_ios + dependencies: flutter: sdk: flutter + flutter_web_plugins: + sdk: flutter + pointer_interceptor_ios: + path: ../pointer_interceptor_ios + pointer_interceptor_platform_interface: + path: ../pointer_interceptor_platform_interface + pointer_interceptor_web: + path: ../pointer_interceptor_web dev_dependencies: flutter_test: diff --git a/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart b/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart index cc32e6c72f1e..5aa7115caa08 100644 --- a/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart +++ b/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart @@ -9,8 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { test('Tell the user where to find the real tests', () { print('---'); - print('This package uses integration_test for its tests.'); - print('See `example/README.md` for more info.'); + print('Please find platform tests in their respective packages.'); print('---'); }); } diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/.gitignore new file mode 100644 index 000000000000..ac5aa9893e48 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/.gitignore @@ -0,0 +1,29 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +build/ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/.metadata b/packages/pointer_interceptor/pointer_interceptor_ios/.metadata new file mode 100644 index 000000000000..88292defa87f --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "969911d1d09d6c4f145e9ce27c08093e8c285561" + channel: "main" + +project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + - platform: ios + create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_ios/CHANGELOG.md new file mode 100644 index 000000000000..4033d9196e35 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.10.0 + +* Initial release. + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/LICENSE b/packages/pointer_interceptor/pointer_interceptor_ios/LICENSE new file mode 100644 index 000000000000..c6823b81eb84 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/LICENSE @@ -0,0 +1,25 @@ +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/README.md b/packages/pointer_interceptor/pointer_interceptor_ios/README.md new file mode 100644 index 000000000000..ca30d6d9defa --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/README.md @@ -0,0 +1,15 @@ +# pointer\_interceptor\_ios + +The iOS implementation of [`pointer interceptor`][1]. + +## Usage + +This package is [endorsed][2], which means you can simply use `pointer_interceptor` +normally. This package will be automatically included in your app when you do, +so you do not need to add it to your `pubspec.yaml`. + +However, if you `import` this package to use any of its APIs directly, you +should add it to your `pubspec.yaml` as usual. + +[1]: https://pub.dev/packages/pointer_interceptor +[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/example/.gitignore new file mode 100644 index 000000000000..29a3a5017f04 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/README.md b/packages/pointer_interceptor/pointer_interceptor_ios/example/README.md new file mode 100644 index 000000000000..96b8bb17dbff --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/README.md @@ -0,0 +1,9 @@ +# Platform Implementation Test App + +This is a test app for manual testing and automated integration testing +of this platform implementation. It is not intended to demonstrate actual use of +this package, since the intent is that plugin clients use the app-facing +package. + +Unless you are making changes to this implementation package, this example is +very unlikely to be relevant. diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/integration_test/pointer_interceptor_test.dart b/packages/pointer_interceptor/pointer_interceptor_ios/example/integration_test/pointer_interceptor_test.dart new file mode 100644 index 000000000000..3bb4e68e8710 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/integration_test/pointer_interceptor_test.dart @@ -0,0 +1,15 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + // Integration tests for iOS requires a native platform view and thus + // can not be tested in Dart. These tests can instead + // be found in the XCUITests + testWidgets('placeholder test', (WidgetTester tester) async {}); +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/.gitignore new file mode 100644 index 000000000000..7a7f9873ad7d --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/AppFrameworkInfo.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000000..f219bde3ddf9 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + dev.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Debug.xcconfig b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000000..ec97fc6f3021 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Release.xcconfig b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000000..c4855bfe2000 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Podfile b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Podfile new file mode 100644 index 000000000000..fdcc671eb341 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.pbxproj b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..26c357f3507e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,875 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 46643191504C316CD4ABDB75 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7324BF52939888500E1D0F3 /* Pods_RunnerTests.framework */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + E168ED82D399C1A9329D0876 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1F367B2EDD332D4B9230AF1 /* Pods_Runner.framework */; }; + F21CDFA32B056EBD0017C279 /* RunnerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F21CDFA22B056EBD0017C279 /* RunnerUITests.swift */; }; + F21CDFAD2B0591E30017C279 /* DummyPlatformViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F21CDFAC2B0591E30017C279 /* DummyPlatformViewFactory.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; + F21CDFA62B056EBD0017C279 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0572F01CACAE4D575F1A1128 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 2DD5F6BD11575A75FA2A0EBC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 37A897E52BBF8D001E20DCBE /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4231BCCD2D6A3407E2AA20F2 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B65B5543E4E11276FC0745D9 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + CDA7125E540D71A7A056DCE6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + F1F367B2EDD332D4B9230AF1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F21CDF922B056DB70017C279 /* RunnerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerUITests.swift; sourceTree = ""; }; + F21CDFA02B056EBD0017C279 /* RunnerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + F21CDFA22B056EBD0017C279 /* RunnerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerUITests.swift; sourceTree = ""; }; + F21CDFAC2B0591E30017C279 /* DummyPlatformViewFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DummyPlatformViewFactory.swift; sourceTree = ""; }; + F7324BF52939888500E1D0F3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 92C054B3F5E4DE78794EA034 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 46643191504C316CD4ABDB75 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E168ED82D399C1A9329D0876 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F21CDF9D2B056EBD0017C279 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + F21CDF912B056DB70017C279 /* RunnerUITests */, + F21CDFA12B056EBD0017C279 /* RunnerUITests */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + DBD25E199A731479B0BACE39 /* Pods */, + ACDADE5C43240D66CC8F6502 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + F21CDFA02B056EBD0017C279 /* RunnerUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + F21CDFAC2B0591E30017C279 /* DummyPlatformViewFactory.swift */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + ACDADE5C43240D66CC8F6502 /* Frameworks */ = { + isa = PBXGroup; + children = ( + F1F367B2EDD332D4B9230AF1 /* Pods_Runner.framework */, + F7324BF52939888500E1D0F3 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + DBD25E199A731479B0BACE39 /* Pods */ = { + isa = PBXGroup; + children = ( + 2DD5F6BD11575A75FA2A0EBC /* Pods-Runner.debug.xcconfig */, + CDA7125E540D71A7A056DCE6 /* Pods-Runner.release.xcconfig */, + 0572F01CACAE4D575F1A1128 /* Pods-Runner.profile.xcconfig */, + 37A897E52BBF8D001E20DCBE /* Pods-RunnerTests.debug.xcconfig */, + 4231BCCD2D6A3407E2AA20F2 /* Pods-RunnerTests.release.xcconfig */, + B65B5543E4E11276FC0745D9 /* Pods-RunnerTests.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + F21CDF912B056DB70017C279 /* RunnerUITests */ = { + isa = PBXGroup; + children = ( + F21CDF922B056DB70017C279 /* RunnerUITests.swift */, + ); + path = RunnerUITests; + sourceTree = ""; + }; + F21CDFA12B056EBD0017C279 /* RunnerUITests */ = { + isa = PBXGroup; + children = ( + F21CDFA22B056EBD0017C279 /* RunnerUITests.swift */, + ); + path = RunnerUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + DB9D75B7E0C58FFA3FAAD55B /* [CP] Check Pods Manifest.lock */, + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + 92C054B3F5E4DE78794EA034 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + C53E3297221374298B80F1DF /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + EBA0739E77CF3B079516C7F7 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; + F21CDF9F2B056EBD0017C279 /* RunnerUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F21CDFA82B056EBD0017C279 /* Build configuration list for PBXNativeTarget "RunnerUITests" */; + buildPhases = ( + F21CDF9C2B056EBD0017C279 /* Sources */, + F21CDF9D2B056EBD0017C279 /* Frameworks */, + F21CDF9E2B056EBD0017C279 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F21CDFA72B056EBD0017C279 /* PBXTargetDependency */, + ); + name = RunnerUITests; + productName = RunnerUITests; + productReference = F21CDFA02B056EBD0017C279 /* RunnerUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1430; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + F21CDF9F2B056EBD0017C279 = { + CreatedOnToolsVersion = 15.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + F21CDF9F2B056EBD0017C279 /* RunnerUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F21CDF9E2B056EBD0017C279 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + C53E3297221374298B80F1DF /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + DB9D75B7E0C58FFA3FAAD55B /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + EBA0739E77CF3B079516C7F7 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F21CDFAD2B0591E30017C279 /* DummyPlatformViewFactory.swift in Sources */, + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F21CDF9C2B056EBD0017C279 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F21CDFA32B056EBD0017C279 /* RunnerUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; + F21CDFA72B056EBD0017C279 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = F21CDFA62B056EBD0017C279 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = PZ83UV676J; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 37A897E52BBF8D001E20DCBE /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4231BCCD2D6A3407E2AA20F2 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B65B5543E4E11276FC0745D9 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = PZ83UV676J; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = PZ83UV676J; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + F21CDFA92B056EBD0017C279 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_TARGET_NAME = Runner; + }; + name = Debug; + }; + F21CDFAA2B056EBD0017C279 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TEST_TARGET_NAME = Runner; + }; + name = Release; + }; + F21CDFAB2B056EBD0017C279 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TEST_TARGET_NAME = Runner; + }; + name = Profile; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F21CDFA82B056EBD0017C279 /* Build configuration list for PBXNativeTarget "RunnerUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F21CDFA92B056EBD0017C279 /* Debug */, + F21CDFAA2B056EBD0017C279 /* Release */, + F21CDFAB2B056EBD0017C279 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..919434a6254f --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..5b9439af8869 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000000..41be7b255972 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,25 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + + weak var registrar = self.registrar(forPlugin: "DummyPlatform"); + + let factory = DummyPlatformViewFactory(messenger: registrar!.messenger()) + self.registrar(forPlugin: "")!.register( + factory, + withId: "dummy_platform_view") + + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..d36b1fab2d9d --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000000..dc9ada4725e9 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000000..7353c41ecf9c Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000000..797d452e4589 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000000..6ed2d933e112 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000000..4cd7b0099ca8 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000000..fe730945a01f Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000000..321773cd857a Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000000..797d452e4589 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000000..502f463a9bc8 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000000..0ec303439225 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000000..0ec303439225 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000000..e9f5fea27c70 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000000..84ac32ae7d98 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000000..8953cba09064 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000000..0467bf12aa4d Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000000..0bedcf2fd467 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..f2e259c7c939 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/Main.storyboard b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..6220510d3fbc --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift new file mode 100644 index 000000000000..71b1bff63b14 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift @@ -0,0 +1,79 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import Flutter +import UIKit + +/** + * A simple factory that creates a dummy platform view for testing. + */ +public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { + private var messenger: FlutterBinaryMessenger + + init(messenger: FlutterBinaryMessenger) { + self.messenger = messenger + super.init() + } + + public func create( + withFrame frame: CGRect, + viewIdentifier viewId: Int64, + arguments args: Any? + ) -> FlutterPlatformView { + return DummyPlatformView( + frame: frame, + viewIdentifier: viewId, + arguments: args, + binaryMessenger: messenger) + } + + public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { + return FlutterStandardMessageCodec.sharedInstance() + } +} + +/** + * A native view that will remove its tag if clicked. + */ +public class CustomView: UIView { + + override public func hitTest( + _ point: CGPoint, + with event: UIEvent? + ) -> UIView? { + viewWithTag(1)?.removeFromSuperview(); + return super.hitTest(point, with: event) + } +} + +/** + * A flutter platform view that displays a simple native view. + */ +class DummyPlatformView: NSObject, FlutterPlatformView { + private var _view: CustomView; + + init( + frame: CGRect, + viewIdentifier viewId: Int64, + arguments args: Any?, + binaryMessenger messenger: FlutterBinaryMessenger? + ) { + _view = CustomView() + super.init() + createNativeView(view: _view) + } + + func view() -> UIView { + return _view + } + + func createNativeView(view _view: CustomView){ + let nativeLabel = UILabel() + _view.isUserInteractionEnabled = true + nativeLabel.tag = 1; + nativeLabel.text = "Not Clicked" + nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) + _view.addSubview(nativeLabel) + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Info.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Info.plist new file mode 100644 index 000000000000..f2156aa24df3 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Pointer Interceptor Ios + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + pointer_interceptor_ios_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Runner-Bridging-Header.h b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000000..eb7e8ba8052f --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1,5 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "GeneratedPluginRegistrant.h" diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerTests/RunnerTests.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000000..04da94504ddf --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,25 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import Flutter +import UIKit +import XCTest + +@testable import pointer_interceptor_ios + +class RunnerTests: XCTestCase { + func testNonDebugMode() { + let view = PointerInterceptorView(frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: false); + + let debugView = view.view(); + XCTAssertTrue(debugView.backgroundColor == UIColor.clear) + } + + func testDebugMode() { + let view = PointerInterceptorView(frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: true); + + let debugView = view.view(); + XCTAssertTrue(debugView.backgroundColor == UIColor(red: 1, green: 0, blue: 0, alpha: 0.5)) + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerUITests/RunnerUITests.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerUITests/RunnerUITests.swift new file mode 100644 index 000000000000..3fb1578d9e7e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerUITests/RunnerUITests.swift @@ -0,0 +1,44 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import XCTest + +final class RunnerUITests: XCTestCase { + + override func setUp() { + continueAfterFailure = false + } + + func testPointerInterceptorBlocksGesturesFromFlutter() { + let app = XCUIApplication() + app.launch() + + let fabInitial = app.buttons["Initial"] + if (!(fabInitial.waitForExistence(timeout: 30))){ + print(app.debugDescription); + XCTFail("Could not find Flutter button to click on") + return + } + + fabInitial.tap(); + + let fabAfter = app.buttons["Tapped"] + if (!(fabAfter.waitForExistence(timeout: 30))){ + print(app.debugDescription); + XCTFail("Flutter button did not change on tap") + return + } + + let exp = expectation(description: "Check platform view not clicked after 3 seconds") + let result = XCTWaiter.wait(for: [exp], timeout: 3.0) + if result == XCTWaiter.Result.timedOut { + let dummyButton = app.staticTexts["Not Clicked"] + if (!(dummyButton.waitForExistence(timeout: 30))){ + print(app.debugDescription); + XCTFail("Pointer interceptor did not block gesture from hitting platform view") + return + } + } + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/lib/main.dart b/packages/pointer_interceptor/pointer_interceptor_ios/example/lib/main.dart new file mode 100644 index 000000000000..1e947b4cedba --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/lib/main.dart @@ -0,0 +1,68 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:pointer_interceptor/pointer_interceptor.dart'; + +void main() { + runApp(const MaterialApp(home: PointerInterceptorIOSExample())); +} + +class _DummyPlatformView extends StatelessWidget { + const _DummyPlatformView(); + + @override + Widget build(BuildContext context) { + const String viewType = 'dummy_platform_view'; + final Map creationParams = {}; + + return UiKitView( + viewType: viewType, + layoutDirection: TextDirection.ltr, + creationParams: creationParams, + creationParamsCodec: const StandardMessageCodec(), + ); + } +} + +/// Example flutter app with a button overlaying the native view. +class PointerInterceptorIOSExample extends StatefulWidget { + /// Constructor + const PointerInterceptorIOSExample({super.key}); + + @override + State createState() { + return _PointerInterceptorIOSExampleState(); + } +} + +class _PointerInterceptorIOSExampleState + extends State { + bool _buttonTapped = false; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Stack( + alignment: AlignmentDirectional.center, + children: [ + const _DummyPlatformView(), + PointerInterceptor( + child: TextButton( + style: TextButton.styleFrom(foregroundColor: Colors.red), + child: _buttonTapped + ? const Text('Tapped') + : const Text('Initial'), + onPressed: () { + setState(() { + _buttonTapped = !_buttonTapped; + }); + })), + ], + ), + )); + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_ios/example/pubspec.yaml new file mode 100644 index 000000000000..344f981e24c5 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/pubspec.yaml @@ -0,0 +1,26 @@ +name: pointer_interceptor_ios_example +description: "Demonstrates how to use the pointer_interceptor_ios plugin." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: '>=3.1.0-134.0.dev <4.0.0' + +dependencies: + cupertino_icons: ^1.0.2 + flutter: + sdk: flutter + pointer_interceptor: + path: ../../pointer_interceptor + +dev_dependencies: + flutter_lints: ^2.0.0 + flutter_test: + sdk: flutter + integration_test: + sdk: flutter + +flutter: + uses-material-design: true + diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/test_driver/integration_test.dart b/packages/pointer_interceptor/pointer_interceptor_ios/example/test_driver/integration_test.dart new file mode 100644 index 000000000000..f26b6a310cfe --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/test_driver/integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/ios/.gitignore new file mode 100644 index 000000000000..0c885071e36b --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/ios/.gitignore @@ -0,0 +1,38 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Assets/.gitkeep b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Assets/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorFactory.swift b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorFactory.swift new file mode 100644 index 000000000000..9c3ee01ff269 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorFactory.swift @@ -0,0 +1,15 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import Flutter + +class PointerInterceptorFactory: NSObject, FlutterPlatformViewFactory { + func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView { + let debug = (args as? [String: Any])?["debug"] as? Bool ?? false + return PointerInterceptorView(frame: frame, debug: debug) + } + + public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { + return FlutterStandardMessageCodec.sharedInstance() + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorIosPlugin.swift b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorIosPlugin.swift new file mode 100644 index 000000000000..04c7f6fc089e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorIosPlugin.swift @@ -0,0 +1,11 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import Flutter +import UIKit + +public class PointerInterceptorIosPlugin: NSObject, FlutterPlugin { + public static func register(with registrar: FlutterPluginRegistrar) { + registrar.register(PointerInterceptorFactory(), withId: "plugins.flutter.dev/pointer_interceptor_ios") + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorView.swift b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorView.swift new file mode 100644 index 000000000000..98730b73f6e3 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorView.swift @@ -0,0 +1,19 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import Flutter +import UIKit + +public class PointerInterceptorView: NSObject, FlutterPlatformView { + + let interceptorView: UIView + + init(frame:CGRect, debug:Bool) { + interceptorView = UIView(frame:frame) + interceptorView.backgroundColor = debug ? UIColor(red: 1, green: 0, blue: 0, alpha: 0.5) : UIColor.clear + } + + public func view() -> UIView { + return interceptorView; + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/pointer_interceptor_ios.podspec b/packages/pointer_interceptor/pointer_interceptor_ios/ios/pointer_interceptor_ios.podspec new file mode 100644 index 000000000000..301ed379505f --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/ios/pointer_interceptor_ios.podspec @@ -0,0 +1,26 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint pointer_interceptor_ios.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'pointer_interceptor_ios' + s.version = '0.0.1' + s.summary = 'Implementation of pointer_interceptor for iOS.' + s.description = <<-DESC +This Flutter plugin provides means to prevent gestures from being swallowed by PlatformView on iOS. + DESC + s.homepage = 'https://github.com/flutter/packages' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_ios' } + s.source_files = 'Classes/**/*' + s.dependency 'Flutter' + s.platform = :ios, '11.0' + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' + s.xcconfig = { + 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + } +end diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/lib/pointer_interceptor_ios.dart b/packages/pointer_interceptor/pointer_interceptor_ios/lib/pointer_interceptor_ios.dart new file mode 100644 index 000000000000..f92e8faaec0e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/lib/pointer_interceptor_ios.dart @@ -0,0 +1,30 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; + +/// The iOS implementation of the [PointerInterceptorPlatform]. +class PointerInterceptorIOS extends PointerInterceptorPlatform { + /// Register plugin as iOS version. + static void registerWith() { + PointerInterceptorPlatform.instance = PointerInterceptorIOS(); + } + + @override + Widget buildWidget({required Widget child, bool debug = false, Key? key}) { + return Stack(alignment: Alignment.center, children: [ + Positioned.fill( + child: UiKitView( + viewType: 'plugins.flutter.dev/pointer_interceptor_ios', + creationParams: { + 'debug': debug, + }, + creationParamsCodec: const StandardMessageCodec(), + )), + child + ]); + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_ios/pubspec.yaml new file mode 100644 index 000000000000..4d1b37591507 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/pubspec.yaml @@ -0,0 +1,29 @@ +name: pointer_interceptor_ios +description: iOS implementation of the pointer_interceptor plugin. +repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_ios +issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen++label%3A%22p%3A+pointer_interceptor%22 +version: 0.10.0 +publish_to: none + +environment: + sdk: '>=3.1.0' + flutter: '>=3.13.0' + +flutter: + plugin: + implements: pointer_interceptor + platforms: + ios: + pluginClass: PointerInterceptorIosPlugin + dartPluginClass: PointerInterceptorIOS + +dependencies: + flutter: + sdk: flutter + plugin_platform_interface: ^2.1.6 + pointer_interceptor_platform_interface: + path: ../pointer_interceptor_platform_interface + +dev_dependencies: + flutter_test: + sdk: flutter \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/test/pointer_interceptor_ios_test.dart b/packages/pointer_interceptor/pointer_interceptor_ios/test/pointer_interceptor_ios_test.dart new file mode 100644 index 000000000000..35671246ea5b --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_ios/test/pointer_interceptor_ios_test.dart @@ -0,0 +1,49 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:pointer_interceptor_ios/pointer_interceptor_ios.dart'; + +class TestApp extends StatefulWidget { + const TestApp({super.key}); + + @override + State createState() { + return TestAppState(); + } +} + +class TestAppState extends State { + String _buttonText = 'Test Button'; + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + body: const Text('Body'), + floatingActionButton: FloatingActionButton( + onPressed: () {}, + child: PointerInterceptorIOS().buildWidget( + child: TextButton( + onPressed: () => setState(() { + _buttonText = 'Clicked'; + }), + child: Text(_buttonText), + ))), + )); + } +} + +void main() { + testWidgets( + 'Button remains clickable and is added to ' + 'hierarchy after being wrapped in pointer interceptor', + (WidgetTester tester) async { + await tester.pumpWidget(const TestApp()); + await tester.tap(find.text('Test Button')); + await tester.pump(); + expect(find.text('Clicked'), findsOneWidget); + }); +} diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/.gitignore b/packages/pointer_interceptor/pointer_interceptor_platform_interface/.gitignore new file mode 100644 index 000000000000..ac5aa9893e48 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/.gitignore @@ -0,0 +1,29 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +build/ diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/.metadata b/packages/pointer_interceptor/pointer_interceptor_platform_interface/.metadata new file mode 100644 index 000000000000..88292defa87f --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "969911d1d09d6c4f145e9ce27c08093e8c285561" + channel: "main" + +project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + - platform: ios + create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_platform_interface/CHANGELOG.md new file mode 100644 index 000000000000..f4c3d3e1bc4e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.10.0 + +* Initial release from migration to federated architecture. diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/LICENSE b/packages/pointer_interceptor/pointer_interceptor_platform_interface/LICENSE new file mode 100644 index 000000000000..c6823b81eb84 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/LICENSE @@ -0,0 +1,25 @@ +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/README.md b/packages/pointer_interceptor/pointer_interceptor_platform_interface/README.md new file mode 100644 index 000000000000..6d9558441396 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/README.md @@ -0,0 +1,26 @@ +# pointer_interceptor_platform_interface + +A common platform interface for the [`pointer_interceptor`][1] plugin. + +This interface allows platform-specific implementations of the `pointer_interceptor` +plugin, as well as the plugin itself, to ensure they are supporting the +same interface. + +# Usage + +To implement a new platform-specific implementation of `pointer_interceptor`, extend +[`PointerInterceptorPlatform`][2] with an implementation that performs the +platform-specific behavior, and when you register your plugin, set the default +`PointerInterceptorPlatform` by calling +`PointerInterceptorPlatform.instance = MyPointerInterceptorPlatform()`. + +# Note on breaking changes + +Strongly prefer non-breaking changes (such as adding a method to the interface) +over breaking changes for this package. + +See https://flutter.dev/go/platform-interface-breaking-changes for a discussion +on why a less-clean interface is preferable to a breaking change. + +[1]: ../pointer_interceptor +[2]: lib/pointer_interceptor_platform_interface.dart \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/pointer_interceptor_platform_interface.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/pointer_interceptor_platform_interface.dart new file mode 100644 index 000000000000..dfdace230f1e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/pointer_interceptor_platform_interface.dart @@ -0,0 +1,7 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +library pointer_interceptor; + +export 'src/pointer_interceptor_platform.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/default_pointer_interceptor.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/default_pointer_interceptor.dart new file mode 100644 index 000000000000..0c935e6ab1f8 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/default_pointer_interceptor.dart @@ -0,0 +1,21 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: avoid_print + +import 'package:flutter/widgets.dart'; + +import 'pointer_interceptor_platform.dart'; + +/// A default implementation of [PointerInterceptorPlatform]. +class DefaultPointerInterceptor extends PointerInterceptorPlatform { + @override + Widget buildWidget({ + required Widget child, + bool debug = false, + Key? key, + }) { + return child; + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/pointer_interceptor_platform.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/pointer_interceptor_platform.dart new file mode 100644 index 000000000000..59b558a7b1f3 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/pointer_interceptor_platform.dart @@ -0,0 +1,45 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/widgets.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +import 'default_pointer_interceptor.dart'; + +/// Platform-specific implementations should set this with their own +/// platform-specific class that extends [PointerInterceptorPlatform] when +/// they register themselves. +abstract class PointerInterceptorPlatform extends PlatformInterface { + /// Constructs a PointerInterceptorPlatform. + PointerInterceptorPlatform() : super(token: _token); + + static final Object _token = Object(); + + static PointerInterceptorPlatform _instance = DefaultPointerInterceptor(); + + static set instance(PointerInterceptorPlatform? instance) { + if (instance == null) { + throw AssertionError( + 'Platform interfaces can only be set to a non-null instance'); + } + + PlatformInterface.verify(instance, _token); + _instance = instance; + } + + /// The default instance of [PointerInterceptorPlatform] to use. + /// + /// Defaults to [DefaultPointerInterceptor], which does not do anything + static PointerInterceptorPlatform get instance => _instance; + + /// Platform-specific implementations should override this function their own + /// implementation of a pointer interceptor widget. + Widget buildWidget({ + required Widget child, + bool debug = false, + Key? key, + }) { + throw UnimplementedError('buildWidget() has not been implemented.'); + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_platform_interface/pubspec.yaml new file mode 100644 index 000000000000..5a20f7ecdaae --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_platform_interface/pubspec.yaml @@ -0,0 +1,18 @@ +name: pointer_interceptor_platform_interface +description: "A common platform interface for the pointer_interceptor plugin." +version: 1.0.0 +publish_to: none + +environment: + sdk: '>=3.1.0' + flutter: '>=3.13.0' + +dependencies: + flutter: + sdk: flutter + plugin_platform_interface: ^2.1.0 + +dev_dependencies: + flutter_test: + sdk: flutter + diff --git a/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md new file mode 100644 index 000000000000..ff399443424e --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.10.0 + +* Moved web implementation to own package. + diff --git a/packages/pointer_interceptor/pointer_interceptor_web/LICENSE b/packages/pointer_interceptor/pointer_interceptor_web/LICENSE new file mode 100644 index 000000000000..c6823b81eb84 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/LICENSE @@ -0,0 +1,25 @@ +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/pointer_interceptor/pointer_interceptor_web/README.md b/packages/pointer_interceptor/pointer_interceptor_web/README.md new file mode 100644 index 000000000000..45db9bdcbc7d --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/README.md @@ -0,0 +1,15 @@ +# pointer\_interceptor\_web + +The web implementation of [`pointer interceptor`][1]. + +## Usage + +This package is [endorsed][2], which means you can simply use `pointer_interceptor` +normally. This package will be automatically included in your app when you do, +so you do not need to add it to your `pubspec.yaml`. + +However, if you `import` this package to use any of its APIs directly, you +should add it to your `pubspec.yaml` as usual. + +[1]: https://pub.dev/packages/pointer_interceptor +[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/README.md b/packages/pointer_interceptor/pointer_interceptor_web/example/README.md new file mode 100644 index 000000000000..96b8bb17dbff --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/README.md @@ -0,0 +1,9 @@ +# Platform Implementation Test App + +This is a test app for manual testing and automated integration testing +of this platform implementation. It is not intended to demonstrate actual use of +this package, since the intent is that plugin clients use the app-facing +package. + +Unless you are making changes to this implementation package, this example is +very unlikely to be relevant. diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/integration_test/widget_test.dart b/packages/pointer_interceptor/pointer_interceptor_web/example/integration_test/widget_test.dart new file mode 100644 index 000000000000..22a2528f7d15 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/integration_test/widget_test.dart @@ -0,0 +1,179 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: avoid_print + +import 'dart:html' as html; + +// Imports the Flutter Driver API. +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +import 'package:pointer_interceptor_web_example/main.dart' as app; + +final Finder nonClickableButtonFinder = + find.byKey(const Key('transparent-button')); +final Finder clickableWrappedButtonFinder = + find.byKey(const Key('wrapped-transparent-button')); +final Finder clickableButtonFinder = find.byKey(const Key('clickable-button')); +final Finder backgroundFinder = + find.byKey(const ValueKey('background-widget')); + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + group('Without semantics', () { + testWidgets( + 'on wrapped elements, the browser does not hit the background-html-view', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAtCenter(clickableButtonFinder, tester); + + expect(element.id, isNot('background-html-view')); + }, semanticsEnabled: false); + + testWidgets( + 'on wrapped elements with intercepting set to false, the browser hits the background-html-view', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); + + expect(element.id, 'background-html-view'); + }, semanticsEnabled: false); + + testWidgets( + 'on unwrapped elements, the browser hits the background-html-view', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAtCenter(nonClickableButtonFinder, tester); + + expect(element.id, 'background-html-view'); + }, semanticsEnabled: false); + + testWidgets('on background directly', (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); + + expect(element.id, 'background-html-view'); + }, semanticsEnabled: false); + }); + + group('With semantics', () { + testWidgets('finds semantics of wrapped widgets', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + if (!_newSemanticsAvailable()) { + print('Skipping test: Needs flutter > 2.10'); + return; + } + + final html.Element element = + _getHtmlElementAtCenter(clickableButtonFinder, tester); + + expect(element.tagName.toLowerCase(), 'flt-semantics'); + expect(element.getAttribute('aria-label'), 'Works As Expected'); + }); + + testWidgets( + 'finds semantics of wrapped widgets with intercepting set to false', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + if (!_newSemanticsAvailable()) { + print('Skipping test: Needs flutter > 2.10'); + return; + } + + final html.Element element = + _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); + + expect(element.tagName.toLowerCase(), 'flt-semantics'); + expect(element.getAttribute('aria-label'), + 'Never calls onPressed transparent'); + }); + + testWidgets('finds semantics of unwrapped elements', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + if (!_newSemanticsAvailable()) { + print('Skipping test: Needs flutter > 2.10'); + return; + } + + final html.Element element = + _getHtmlElementAtCenter(nonClickableButtonFinder, tester); + + expect(element.tagName.toLowerCase(), 'flt-semantics'); + expect(element.getAttribute('aria-label'), 'Never calls onPressed'); + }); + + // Notice that, when hit-testing the background platform view, instead of + // finding a semantics node, the platform view itself is found. This is + // because the platform view does not add interactive semantics nodes into + // the framework's semantics tree. Instead, its semantics is determined by + // the HTML content of the platform view itself. Flutter's semantics tree + // simply allows the hit test to land on the platform view by making itself + // hit test transparent. + testWidgets('on background directly', (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); + + expect(element.id, 'background-html-view'); + }); + }); +} + +// Calls [_getHtmlElementAt] passing it the center of the widget identified by +// the `finder`. +html.Element _getHtmlElementAtCenter(Finder finder, WidgetTester tester) { + final Offset point = tester.getCenter(finder); + return _getHtmlElementAt(point); +} + +// Locates the DOM element at the given `point` using `elementFromPoint`. +// +// `elementFromPoint` is an approximate proxy for a hit test, although it's +// sensitive to the presence of shadow roots and browser quirks (not all +// browsers agree on what it should return in all situations). Since this test +// runs only in Chromium, it relies on Chromium's behavior. +html.Element _getHtmlElementAt(Offset point) { + // Probe at the shadow so the browser reports semantics nodes in addition to + // platform view elements. If probed from `html.document` the browser hides + // the contents of as an implementation detail. + final html.ShadowRoot glassPaneShadow = + html.document.querySelector('flt-glass-pane')!.shadowRoot!; + return glassPaneShadow.elementFromPoint(point.dx.toInt(), point.dy.toInt())!; +} + +// TODO(dit): Remove this after flutter master (2.13) lands into stable. +// This detects that we can do new semantics assertions by looking at the 'id' +// attribute on flt-semantics elements (it is now set in 2.13 and up). +bool _newSemanticsAvailable() { + final html.ShadowRoot glassPaneShadow = + html.document.querySelector('flt-glass-pane')!.shadowRoot!; + final List elements = + glassPaneShadow.querySelectorAll('flt-semantics[id]'); + return elements.isNotEmpty; +} diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/lib/main.dart b/packages/pointer_interceptor/pointer_interceptor_web/example/lib/main.dart new file mode 100644 index 000000000000..12718cfe2e09 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/lib/main.dart @@ -0,0 +1,218 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore: avoid_web_libraries_in_flutter +import 'dart:html' as html; +import 'dart:ui_web' as ui_web; + +import 'package:flutter/material.dart'; +import 'package:pointer_interceptor/pointer_interceptor.dart'; + +const String _htmlElementViewType = '_htmlElementViewType'; +const double _videoWidth = 640; +const double _videoHeight = 480; + +/// The html.Element that will be rendered underneath the flutter UI. +html.Element htmlElement = html.DivElement() + ..style.width = '100%' + ..style.height = '100%' + ..style.backgroundColor = '#fabada' + ..style.cursor = 'auto' + ..id = 'background-html-view'; + +// See other examples commented out below... + +// html.Element htmlElement = html.VideoElement() +// ..style.width = '100%' +// ..style.height = '100%' +// ..style.cursor = 'auto' +// ..style.backgroundColor = 'black' +// ..id = 'background-html-view' +// ..src = 'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4' +// ..poster = 'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217' +// ..controls = true; + +// html.Element htmlElement = html.IFrameElement() +// ..width = '100%' +// ..height = '100%' +// ..id = 'background-html-view' +// ..src = 'https://www.youtube.com/embed/IyFZznAk69U' +// ..style.border = 'none'; + +void main() { + ui_web.platformViewRegistry.registerViewFactory( + _htmlElementViewType, + (int viewId) => htmlElement, + ); + runApp(const MyApp()); +} + +/// Main app +class MyApp extends StatelessWidget { + /// Creates main app. + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return const MaterialApp( + title: 'Stopping Clicks with PointerInterceptor', + home: MyHomePage(), + ); + } +} + +/// First page +class MyHomePage extends StatefulWidget { + /// Creates first page. + const MyHomePage({super.key}); + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + String _lastClick = 'none'; + + void _clickedOn(String key) { + setState(() { + _lastClick = key; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('PointerInterceptor demo'), + actions: [ + PointerInterceptor( + // debug: true, + child: IconButton( + icon: const Icon(Icons.add_alert), + tooltip: 'AppBar Icon', + onPressed: () { + _clickedOn('appbar-icon'); + }, + ), + ), + ], + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Last click on: $_lastClick', + key: const Key('last-clicked'), + ), + Container( + color: Colors.black, + width: _videoWidth, + height: _videoHeight, + child: Stack( + alignment: Alignment.center, + children: [ + HtmlElement( + key: const ValueKey('background-widget'), + onClick: () { + _clickedOn('html-element'); + }, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ElevatedButton( + key: const Key('transparent-button'), + child: const Text('Never calls onPressed'), + onPressed: () { + _clickedOn('transparent-button'); + }, + ), + PointerInterceptor( + intercepting: false, + child: ElevatedButton( + key: const Key('wrapped-transparent-button'), + child: + const Text('Never calls onPressed transparent'), + onPressed: () { + _clickedOn('wrapped-transparent-button'); + }, + ), + ), + PointerInterceptor( + child: ElevatedButton( + key: const Key('clickable-button'), + child: const Text('Works As Expected'), + onPressed: () { + _clickedOn('clickable-button'); + }, + ), + ), + ], + ), + ], + ), + ), + ], + ), + ), + floatingActionButton: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + PointerInterceptor( + // debug: true, + child: FloatingActionButton( + child: const Icon(Icons.navigation), + onPressed: () { + _clickedOn('fab-1'); + }, + ), + ), + ], + ), + drawer: Drawer( + child: PointerInterceptor( + // debug: true, // Enable this to "see" the interceptor covering the column. + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ListTile( + title: const Text('Item 1'), + onTap: () { + _clickedOn('drawer-item-1'); + }, + ), + ListTile( + title: const Text('Item 2'), + onTap: () { + _clickedOn('drawer-item-2'); + }, + ), + ], + ), + ), + ), + ); + } +} + +/// Initialize the videoPlayer, then render the corresponding view... +class HtmlElement extends StatelessWidget { + /// Constructor + const HtmlElement({super.key, required this.onClick}); + + /// A function to run when the element is clicked + final VoidCallback onClick; + + @override + Widget build(BuildContext context) { + htmlElement.onClick.listen((_) { + onClick(); + }); + + return const HtmlElementView( + viewType: _htmlElementViewType, + ); + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml new file mode 100644 index 000000000000..aef1717d1e66 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml @@ -0,0 +1,26 @@ +name: pointer_interceptor_web_example +description: "Demonstrates how to use the pointer_interceptor_web plugin." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: '>=3.1.0-134.0.dev <4.0.0' + +dependencies: + cupertino_icons: ^1.0.2 + flutter: + sdk: flutter + pointer_interceptor: + path: ../../pointer_interceptor + +dev_dependencies: + flutter_lints: ^2.0.0 + flutter_test: + sdk: flutter + integration_test: + sdk: flutter + +flutter: + uses-material-design: true + diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/test_driver/integration_test.dart b/packages/pointer_interceptor/pointer_interceptor_web/example/test_driver/integration_test.dart new file mode 100644 index 000000000000..f26b6a310cfe --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/test_driver/integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/favicon.png b/packages/pointer_interceptor/pointer_interceptor_web/example/web/favicon.png new file mode 100644 index 000000000000..8aaa46ac1ae2 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_web/example/web/favicon.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-192.png b/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-192.png new file mode 100644 index 000000000000..b749bfef0747 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-192.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-512.png b/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-512.png new file mode 100644 index 000000000000..88cfd48dff11 Binary files /dev/null and b/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-512.png differ diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/index.html b/packages/pointer_interceptor/pointer_interceptor_web/example/web/index.html new file mode 100644 index 000000000000..a53f5677b573 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/web/index.html @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + example + + + + + + + + diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/manifest.json b/packages/pointer_interceptor/pointer_interceptor_web/example/web/manifest.json new file mode 100644 index 000000000000..8c012917dab7 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/packages/pointer_interceptor/pointer_interceptor/lib/src/web.dart b/packages/pointer_interceptor/pointer_interceptor_web/lib/pointer_interceptor_web.dart similarity index 66% rename from packages/pointer_interceptor/pointer_interceptor/lib/src/web.dart rename to packages/pointer_interceptor/pointer_interceptor_web/lib/pointer_interceptor_web.dart index e0dbcf904ff5..6ebcc256b6b6 100644 --- a/packages/pointer_interceptor/pointer_interceptor/lib/src/web.dart +++ b/packages/pointer_interceptor/pointer_interceptor_web/lib/pointer_interceptor_web.dart @@ -7,6 +7,9 @@ import 'dart:html' as html; import 'dart:ui_web' as ui_web; import 'package:flutter/widgets.dart'; +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; + +import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; const String _viewType = '__webPointerInterceptorViewType__'; const String _debug = 'debug__'; @@ -33,35 +36,14 @@ void _registerFactory({bool debug = false}) { /// The web implementation of the `PointerInterceptor` widget. /// /// A `Widget` that prevents clicks from being swallowed by [HtmlElementView]s. -class PointerInterceptor extends StatelessWidget { - /// Creates a PointerInterceptor for the web. - PointerInterceptor({ - required this.child, - this.intercepting = true, - this.debug = false, - super.key, - }) { - if (!_registered) { - _register(); - } - } - - /// The `Widget` that is being wrapped by this `PointerInterceptor`. - final Widget child; - - /// Whether or not this `PointerInterceptor` should intercept pointer events. - final bool intercepting; - - /// When true, the widget renders with a semi-transparent red background, for debug purposes. - /// - /// This is useful when rendering this as a "layout" widget, like the root child - /// of a [Drawer]. - final bool debug; - - // Keeps track if this widget has already registered its view factories or not. +class PointerInterceptorWeb extends PointerInterceptorPlatform { static bool _registered = false; - // Registers the view factories for the interceptor widgets. + /// Register the plugin + static void registerWith(Registrar? registrar) { + PointerInterceptorPlatform.instance = PointerInterceptorWeb(); + } + static void _register() { assert(!_registered); @@ -72,12 +54,17 @@ class PointerInterceptor extends StatelessWidget { } @override - Widget build(BuildContext context) { - if (!intercepting) { - return child; + Widget buildWidget({ + required Widget child, + bool debug = false, + Key? key, + }) { + final String viewType = _getViewType(debug: debug); + + if (!_registered) { + _register(); } - final String viewType = _getViewType(debug: debug); return Stack( alignment: Alignment.center, children: [ diff --git a/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml new file mode 100644 index 000000000000..9430956e25c8 --- /dev/null +++ b/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml @@ -0,0 +1,31 @@ +name: pointer_interceptor_web +description: Web implementation of the pointer_interceptor plugin. +repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_web +issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen++label%3A%22p%3A+pointer_interceptor%22 +version: 2.3.1 +publish_to: none + +environment: + sdk: '>=3.1.0' + flutter: '>=3.13.0' + +flutter: + plugin: + implements: pointer_interceptor + platforms: + web: + pluginClass: PointerInterceptorWeb + fileName: pointer_interceptor_web.dart + +dependencies: + flutter: + sdk: flutter + flutter_web_plugins: + sdk: flutter + plugin_platform_interface: ^2.1.6 + pointer_interceptor_platform_interface: + path: ../pointer_interceptor_platform_interface + +dev_dependencies: + flutter_test: + sdk: flutter \ No newline at end of file