Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e10c9d8
initial working commit
LouiseHsu Oct 25, 2023
6d3f6ca
fixed compiler error, move testing factory to runner, remove default …
LouiseHsu Oct 25, 2023
f16a10b
clean up, remove dependency on ios version
LouiseHsu Oct 30, 2023
09fa93f
remove extraneous files in platform interface
LouiseHsu Oct 30, 2023
f04c392
unused exports
LouiseHsu Oct 30, 2023
ee38fa7
Merge branch 'main' into pointer-interceptor-ios
LouiseHsu Oct 30, 2023
6c610b9
update versioning + changelog
LouiseHsu Oct 30, 2023
45a02df
Merge branch 'pointer-interceptor-ios' of github.com:LouiseHsu/packag…
LouiseHsu Oct 30, 2023
736b4b1
fix yaml issue
LouiseHsu Oct 31, 2023
badba67
fix example
LouiseHsu Oct 31, 2023
8c979d2
fix imports
LouiseHsu Oct 31, 2023
7af12bb
some more clean up, formatting
LouiseHsu Oct 31, 2023
276461c
add publish_to none
LouiseHsu Oct 31, 2023
bda6870
remove extra analysis_options
LouiseHsu Oct 31, 2023
29a3cc1
update platform interface pubspec.yaml
LouiseHsu Oct 31, 2023
78aa1e3
add public member comments, renaming
LouiseHsu Oct 31, 2023
b9bc419
remove extraneous analysis files
LouiseHsu Oct 31, 2023
f968902
remove extra test files
LouiseHsu Nov 1, 2023
f9294ab
more linter stuff
LouiseHsu Nov 1, 2023
3854eb9
lower versioning
LouiseHsu Nov 1, 2023
ef7f76f
lower versioning for platform interface
LouiseHsu Nov 1, 2023
819d7d4
version lowering
LouiseHsu Nov 1, 2023
6067505
fixing ios plugin overriding default ios behaviour
LouiseHsu Nov 2, 2023
994a8ae
remove old ios implementation
LouiseHsu Nov 3, 2023
68a4d8c
fix tests
LouiseHsu Nov 7, 2023
2bcdde2
update ios test
LouiseHsu Nov 7, 2023
fbf0e04
formatting
LouiseHsu Nov 7, 2023
85f0899
Merge branch 'main' into pointer-interceptor-ios
LouiseHsu Nov 7, 2023
6c18fa9
pr comments, update changelog/readme
LouiseHsu Nov 8, 2023
e6a8a09
remove empty test dir in example
LouiseHsu Nov 8, 2023
a67da96
rename web.dart to pointer_interceptor_web.dart, remove "intercepting…
LouiseHsu Nov 8, 2023
f38a019
update podspec
LouiseHsu Nov 9, 2023
800fba2
update READMEs, CHANGELOGs, remove extraneous files, various clean up…
LouiseHsu Nov 10, 2023
b73c75c
move pointer_interceptor_ios into part of pointer_interceptor
LouiseHsu Nov 13, 2023
b309e31
remove accidental prints
LouiseHsu Nov 13, 2023
4edc671
add publish to none
LouiseHsu Nov 13, 2023
60ec17b
add ios configuration to example package
LouiseHsu Nov 13, 2023
7092edf
fix licensing and podfile
LouiseHsu Nov 13, 2023
196a9dd
add licensing to swift files
LouiseHsu Nov 13, 2023
d5bf4c9
podfile
LouiseHsu Nov 13, 2023
75a19a8
refactor web into own package, move integration tests, rewrite exampl…
LouiseHsu Nov 14, 2023
b53e4f8
licensing, formatting
LouiseHsu Nov 14, 2023
afb90bd
fix integration test
LouiseHsu Nov 14, 2023
7b4d1be
formatting
LouiseHsu Nov 15, 2023
fa36d02
fix pbxproj
LouiseHsu Nov 15, 2023
d40abd2
fix pbxproj?
LouiseHsu Nov 15, 2023
340bd5c
pbxproj
LouiseHsu Nov 15, 2023
a766eb8
fix ios platform tests, add unit tests
LouiseHsu Nov 15, 2023
1e5c612
pbxproj
LouiseHsu Nov 15, 2023
d8a7fd2
add placeholder integration tests
LouiseHsu Nov 16, 2023
39c0439
formatting
LouiseHsu Nov 16, 2023
0d099f4
update README
LouiseHsu Nov 16, 2023
99bfefa
Merge branch 'main' into pointer-interceptor-ios
LouiseHsu Nov 16, 2023
e8f3445
PR comments
LouiseHsu Nov 16, 2023
836cdb9
Merge branch 'pointer-interceptor-ios' of github.com:LouiseHsu/packag…
LouiseHsu Nov 16, 2023
ba3fd60
fix test
LouiseHsu Nov 16, 2023
a4df634
some pr comments
LouiseHsu Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 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;

import 'package:flutter/widgets.dart';
import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart';

// export 'src/web.dart';

part 'src/pointer_interceptor_widget.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// 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';
part of pointer_interceptor;

/// 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
PointerInterceptor({
required this.child,
this.intercepting = true,
this.debug = false,
this.debug = true,
super.key,
});

Expand All @@ -29,6 +29,7 @@ class PointerInterceptor extends StatelessWidget {

@override
Widget build(BuildContext context) {
return child;
return PointerInterceptorPlatform.instance.buildWidget(
child: child, intercepting: intercepting, debug: debug, key: key);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,34 @@ environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"

flutter:
plugin:
implements: pointer_interceptor_platform_interface
platforms:
web:
pluginClass: PointerInterceptorPlugin
fileName: src/web.dart
ios:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because you're adding this, the CI will require you to add iOS support to the example app for this package. It'll just be the flutter create boilerplate with some minor cleanup.

default_package: pointer_interceptor_ios

dependencies:
flutter:
sdk: flutter
pointer_interceptor_platform_interface:
path: ../pointer_interceptor_platform_interface
pointer_interceptor_ios:
path: ../pointer_interceptor_ios
flutter_web_plugins:
sdk: flutter

# flutter_web_plugins:
# sdk: flutter

dev_dependencies:
flutter_test:
sdk: flutter

topics:
-
- web
- widgets
- widgets
29 changes: 29 additions & 0 deletions packages/pointer_interceptor/pointer_interceptor_ios/.gitignore
Original file line number Diff line number Diff line change
@@ -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/
30 changes: 30 additions & 0 deletions packages/pointer_interceptor/pointer_interceptor_ios/.metadata
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: Add your license here.
15 changes: 15 additions & 0 deletions packages/pointer_interceptor/pointer_interceptor_ios/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# pointer_interceptor_ios

A new Flutter plugin project.

## Getting Started

This project is a starting point for a Flutter
[plug-in package](https://flutter.dev/developing-packages/),
a specialized package that includes platform-specific implementation code for
Android and/or iOS.

For help getting started with Flutter development, view the
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# pointer_interceptor_ios_example

Demonstrates how to use the pointer_interceptor_ios plugin.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// This is a basic Flutter integration test.
//
// Since integration tests run in a full Flutter application, they can interact
// with the host side of a plugin implementation, unlike Dart unit tests.
//
// For more information about Flutter integration tests, please see
// https://docs.flutter.dev/cookbook/testing/integration/introduction


import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

import 'package:pointer_interceptor_ios/pointer_interceptor_ios.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('getPlatformVersion test', (WidgetTester tester) async {
final PointerInterceptorIos plugin = PointerInterceptorIos();
final String? version = await plugin.getPlatformVersion();
// The version string depends on the host platform running the test, so
// just assert that some non-empty string is returned.
expect(version?.isNotEmpty, true);
});
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import Flutter
import UIKit

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)
}

/// Implementing this method is only necessary when the `arguments` in `createWithFrame` is not `nil`.
public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
return FlutterStandardMessageCodec.sharedInstance()
}
}

public class CustomView: UIView {

override public func hitTest(
_ point: CGPoint,
with event: UIEvent?
) -> UIView? {
print("clicked")

viewWithTag(1)?.removeFromSuperview();
return super.hitTest(point, with: event)
}
}

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)
}
}
Loading