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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ These are the available packages in this repository.
| [multicast_dns](./packages/multicast_dns/) | [![pub package](https://img.shields.io/pub/v/multicast_dns.svg)](https://pub.dev/packages/multicast_dns) |
| [palette_generator](./packages/palette_generator/) | [![pub package](https://img.shields.io/pub/v/palette_generator.svg)](https://pub.dartlang.org/packages/palette_generator) |
| [pigeon](./packages/pigeon/) | [![pub package](https://img.shields.io/pub/v/pigeon.svg)](https://pub.dev/packages/pigeon) |
| [pointer_interceptor](./packages/pointer_interceptor/) | [![pub package](https://img.shields.io/pub/v/pointer_interceptor.svg)](https://pub.dev/packages/pointer_interceptor) |
| [xdg_directories](./packages/xdg_directories/) | [![pub package](https://img.shields.io/pub/v/xdg_directories.svg)](https://pub.dev/packages/xdg_directories) |
4 changes: 4 additions & 0 deletions packages/pointer_interceptor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.0

* Migrates to null safety.

## 0.8.0+2

* Use `ElevatedButton` instead of the deprecated `RaisedButton` in example and docs.
Expand Down
2 changes: 1 addition & 1 deletion packages/pointer_interceptor/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ An example for the PointerInterceptor widget.

## Running tests

`flutter drive --target integration_test/widget_test.dart --driver test_driver/integration_test.dart --show-web-server-device -d web-server`
`flutter drive --target integration_test/widget_test.dart --driver test_driver/integration_test.dart --show-web-server-device -d web-server --web-renderer=html`

The command above will run the integration tests for this package.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.9
import 'dart:html' as html;

// Imports the Flutter Driver API.
Expand All @@ -27,12 +26,12 @@ void main() {
app.main();
await tester.pumpAndSettle();

final html.Element element =
final html.Element? element =
_getHtmlElementFromFinder(clickableButtonFinder, tester);
expect(element.tagName.toLowerCase(), 'flt-platform-view');
expect(element?.tagName.toLowerCase(), 'flt-platform-view');

final html.Element platformViewRoot =
element.shadowRoot.getElementById('background-html-view');
final html.Element? platformViewRoot =
element?.shadowRoot?.getElementById('background-html-view');
expect(platformViewRoot, isNull);
});

Expand All @@ -42,12 +41,12 @@ void main() {
app.main();
await tester.pumpAndSettle();

final html.Element element =
final html.Element? element =
_getHtmlElementFromFinder(nonClickableButtonFinder, tester);
expect(element.tagName.toLowerCase(), 'flt-platform-view');
expect(element?.tagName.toLowerCase(), 'flt-platform-view');

final html.Element platformViewRoot =
element.shadowRoot.getElementById('background-html-view');
final html.Element? platformViewRoot =
element?.shadowRoot?.getElementById('background-html-view');
expect(platformViewRoot, isNotNull);
});
});
Expand All @@ -56,7 +55,7 @@ void main() {
// This functions locates a widget from a Finder, and asks the browser what's the
// DOM element in the center of the coordinates of the widget. (Returns *which*
// DOM element will handle Mouse interactions first at those coordinates.)
html.Element _getHtmlElementFromFinder(Finder finder, WidgetTester tester) {
html.Element? _getHtmlElementFromFinder(Finder finder, WidgetTester tester) {
final Offset point = tester.getCenter(finder);
return html.document.elementFromPoint(point.dx.toInt(), point.dy.toInt());
}
2 changes: 1 addition & 1 deletion packages/pointer_interceptor/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class _MyHomePageState extends State<MyHomePage> {
/// Initialize the videoPlayer, then render the corresponding view...
class HtmlElement extends StatelessWidget {
/// Constructor
const HtmlElement({this.onClick});
const HtmlElement({required this.onClick});

/// A function to run when the element is clicked
final Function onClick;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class webOnlyAssetManager {
/// Shim for getAssetUrl.
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/src/engine/assets.dart#L45
static String getAssetUrl(String asset) {
return null;
return '';
}
}

Expand Down
3 changes: 2 additions & 1 deletion packages/pointer_interceptor/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ publish_to: 'none'
version: 1.0.0

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
flutter: ">=1.26.0-0" # For integration_test from sdk

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/pointer_interceptor/lib/src/mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import 'package:flutter/widgets.dart';
class PointerInterceptor extends StatelessWidget {
/// Create a `PointerInterceptor` wrapping a `child`.
const PointerInterceptor({
@required this.child,
required this.child,
this.debug = false,
Key key,
Key? key,
}) : super(key: key);

/// The `Widget` that is being wrapped by this `PointerInterceptor`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class webOnlyAssetManager {
/// Shim for getAssetUrl.
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/src/engine/assets.dart#L45
static String getAssetUrl(String asset) {
return null;
return '';
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/pointer_interceptor/lib/src/web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ void _registerFactory({bool debug = false}) {
class PointerInterceptor extends StatelessWidget {
/// Creates a PointerInterceptor for the web.
PointerInterceptor({
@required this.child,
required this.child,
this.debug = false,
Key key,
Key? key,
}) : super(key: key) {
if (!_registered) {
_register();
Expand Down
4 changes: 2 additions & 2 deletions packages/pointer_interceptor/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: pointer_interceptor
description: A widget to prevent clicks from being swallowed by underlying HtmlElementViews on the web.
version: 0.8.0+2
repository: https://github.com/flutter/packages
version: 0.9.0

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
flutter: ">=1.17.0"

dependencies:
Expand Down