Add dart-layer input event abstraction
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
@@ -85,7 +85,7 @@ class MineDiggerState extends State<MineDigger> {
|
||||
}
|
||||
|
||||
PointerEventListener _pointerDownHandlerFor(int posX, int posY) {
|
||||
return (ui.PointerEvent event) {
|
||||
return (PointerInputEvent event) {
|
||||
if (event.buttons == 1) {
|
||||
probe(posX, posY);
|
||||
} else if (event.buttons == 2) {
|
||||
@@ -190,7 +190,7 @@ class MineDiggerState extends State<MineDigger> {
|
||||
);
|
||||
}
|
||||
|
||||
void handleToolbarPointerDown(ui.PointerEvent event) {
|
||||
void handleToolbarPointerDown(PointerInputEvent event) {
|
||||
setState(() {
|
||||
resetGame();
|
||||
});
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:math' as math;
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
const double kTwoPi = 2 * math.PI;
|
||||
|
||||
@@ -528,7 +528,7 @@ class RenderSolidColor extends RenderDecoratedSector {
|
||||
deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta);
|
||||
}
|
||||
|
||||
void handleEvent(ui.Event event, HitTestEntry entry) {
|
||||
void handleEvent(InputEvent event, HitTestEntry entry) {
|
||||
if (event.type == 'pointerdown')
|
||||
decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
|
||||
else if (event.type == 'pointerup')
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
class RenderSolidColorBox extends RenderDecoratedBox {
|
||||
final Size desiredSize;
|
||||
@@ -42,7 +41,7 @@ class RenderSolidColorBox extends RenderDecoratedBox {
|
||||
size = constraints.constrain(desiredSize);
|
||||
}
|
||||
|
||||
void handleEvent(ui.Event event, BoxHitTestEntry entry) {
|
||||
void handleEvent(InputEvent event, BoxHitTestEntry entry) {
|
||||
if (event.type == 'pointerdown')
|
||||
decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
|
||||
else if (event.type == 'pointerup')
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
// Material design colors. :p
|
||||
List<Color> kColors = [
|
||||
@@ -24,7 +23,7 @@ class Dot {
|
||||
|
||||
Dot({ Color color }) : _paint = new Paint()..color = color;
|
||||
|
||||
void update(ui.PointerEvent event) {
|
||||
void update(PointerInputEvent event) {
|
||||
position = new Point(event.x, event.y);
|
||||
radius = 5 + (95 * event.pressure);
|
||||
}
|
||||
@@ -39,8 +38,8 @@ class RenderTouchDemo extends RenderBox {
|
||||
|
||||
RenderTouchDemo();
|
||||
|
||||
void handleEvent(ui.Event event, BoxHitTestEntry entry) {
|
||||
if (event is ui.PointerEvent) {
|
||||
void handleEvent(InputEvent event, BoxHitTestEntry entry) {
|
||||
if (event is PointerInputEvent) {
|
||||
switch (event.type) {
|
||||
case 'pointerdown':
|
||||
Color color = kColors[event.pointer.remainder(kColors.length)];
|
||||
|
||||
@@ -8,6 +8,7 @@ library gestures;
|
||||
export 'src/gestures/arena.dart';
|
||||
export 'src/gestures/constants.dart';
|
||||
export 'src/gestures/drag.dart';
|
||||
export 'src/gestures/events.dart';
|
||||
export 'src/gestures/long_press.dart';
|
||||
export 'src/gestures/pointer_router.dart';
|
||||
export 'src/gestures/recognizer.dart';
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'dart:ui' as ui;
|
||||
import 'arena.dart';
|
||||
import 'recognizer.dart';
|
||||
import 'constants.dart';
|
||||
import 'events.dart';
|
||||
|
||||
enum DragState {
|
||||
ready,
|
||||
@@ -24,7 +25,7 @@ typedef void GesturePanEndCallback(ui.Offset velocity);
|
||||
|
||||
typedef void _GesturePolymorphicUpdateCallback<T>(T delta);
|
||||
|
||||
int _eventTime(ui.PointerEvent event) => (event.timeStamp * 1000.0).toInt(); // microseconds
|
||||
int _eventTime(PointerInputEvent event) => (event.timeStamp * 1000.0).toInt(); // microseconds
|
||||
|
||||
bool _isFlingGesture(ui.GestureVelocity velocity) {
|
||||
double velocitySquared = velocity.x * velocity.x + velocity.y * velocity.y;
|
||||
@@ -45,12 +46,12 @@ abstract class _DragGestureRecognizer<T extends dynamic> extends GestureRecogniz
|
||||
T _pendingDragDelta;
|
||||
|
||||
T get _initialPendingDragDelta;
|
||||
T _getDragDelta(ui.PointerEvent event);
|
||||
T _getDragDelta(PointerInputEvent event);
|
||||
bool get _hasSufficientPendingDragDeltaToAccept;
|
||||
|
||||
final ui.VelocityTracker _velocityTracker = new ui.VelocityTracker();
|
||||
|
||||
void addPointer(ui.PointerEvent event) {
|
||||
void addPointer(PointerInputEvent event) {
|
||||
startTrackingPointer(event.pointer);
|
||||
if (_state == DragState.ready) {
|
||||
_state = DragState.possible;
|
||||
@@ -58,7 +59,7 @@ abstract class _DragGestureRecognizer<T extends dynamic> extends GestureRecogniz
|
||||
}
|
||||
}
|
||||
|
||||
void handleEvent(ui.PointerEvent event) {
|
||||
void handleEvent(PointerInputEvent event) {
|
||||
assert(_state != DragState.ready);
|
||||
if (event.type == 'pointermove') {
|
||||
_velocityTracker.addPosition(_eventTime(event), event.pointer, event.x, event.y);
|
||||
@@ -120,7 +121,7 @@ class VerticalDragGestureRecognizer extends _DragGestureRecognizer<double> {
|
||||
}) : super(router: router, onStart: onStart, onUpdate: onUpdate, onEnd: onEnd);
|
||||
|
||||
double get _initialPendingDragDelta => 0.0;
|
||||
double _getDragDelta(ui.PointerEvent event) => event.dy;
|
||||
double _getDragDelta(PointerInputEvent event) => event.dy;
|
||||
bool get _hasSufficientPendingDragDeltaToAccept => _pendingDragDelta.abs() > kTouchSlop;
|
||||
}
|
||||
|
||||
@@ -133,7 +134,7 @@ class HorizontalDragGestureRecognizer extends _DragGestureRecognizer<double> {
|
||||
}) : super(router: router, onStart: onStart, onUpdate: onUpdate, onEnd: onEnd);
|
||||
|
||||
double get _initialPendingDragDelta => 0.0;
|
||||
double _getDragDelta(ui.PointerEvent event) => event.dx;
|
||||
double _getDragDelta(PointerInputEvent event) => event.dx;
|
||||
bool get _hasSufficientPendingDragDeltaToAccept => _pendingDragDelta.abs() > kTouchSlop;
|
||||
}
|
||||
|
||||
@@ -146,7 +147,7 @@ class PanGestureRecognizer extends _DragGestureRecognizer<ui.Offset> {
|
||||
}) : super(router: router, onStart: onStart, onUpdate: onUpdate, onEnd: onEnd);
|
||||
|
||||
ui.Offset get _initialPendingDragDelta => ui.Offset.zero;
|
||||
ui.Offset _getDragDelta(ui.PointerEvent event) => new ui.Offset(event.dx, event.dy);
|
||||
ui.Offset _getDragDelta(PointerInputEvent event) => new ui.Offset(event.dx, event.dy);
|
||||
bool get _hasSufficientPendingDragDeltaToAccept {
|
||||
return _pendingDragDelta.distance > kPanSlop;
|
||||
}
|
||||
|
||||
114
packages/flutter/lib/src/gestures/events.dart
Normal file
114
packages/flutter/lib/src/gestures/events.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
/// Dart-layer version of ui.Event
|
||||
class InputEvent {
|
||||
|
||||
InputEvent({ this.type }) : timeStamp = 0.0;
|
||||
|
||||
factory InputEvent.fromSkyEvent(ui.Event event) {
|
||||
if (event is ui.PointerEvent)
|
||||
return new PointerInputEvent.fromUiEvent(event);
|
||||
|
||||
// Default event
|
||||
InputEvent result = new InputEvent();
|
||||
result.type = event.type;
|
||||
result.timeStamp = event.timeStamp;
|
||||
}
|
||||
|
||||
String type;
|
||||
double timeStamp;
|
||||
}
|
||||
|
||||
/// Dart-layer version of ui.PointerInputEvent
|
||||
class PointerInputEvent extends InputEvent {
|
||||
|
||||
// Map actual input pointer value to a unique value
|
||||
// Since events are serialized we can just use a counter
|
||||
static Map<int, int> _pointerMap = new Map<int, int>();
|
||||
static int _pointerCount = 0;
|
||||
|
||||
PointerInputEvent({
|
||||
String type,
|
||||
this.pointer,
|
||||
this.kind,
|
||||
this.x,
|
||||
this.y,
|
||||
this.dx,
|
||||
this.dy,
|
||||
this.buttons,
|
||||
this.down,
|
||||
this.primary,
|
||||
this.obscured,
|
||||
this.pressure,
|
||||
this.pressureMin,
|
||||
this.pressureMax,
|
||||
this.distance,
|
||||
this.distanceMin,
|
||||
this.distanceMax,
|
||||
this.radiusMajor,
|
||||
this.radiusMinor,
|
||||
this.radiusMin,
|
||||
this.radiusMax,
|
||||
this.orientation,
|
||||
this.tilt
|
||||
}) : super(type: type);
|
||||
|
||||
PointerInputEvent.fromUiEvent(ui.PointerEvent event) {
|
||||
type = event.type;
|
||||
timeStamp = event.timeStamp;
|
||||
|
||||
if (type == 'pointerdown') {
|
||||
pointer = _pointerCount;
|
||||
_pointerMap[event.pointer] = _pointerCount;
|
||||
_pointerCount++;
|
||||
} else {
|
||||
pointer = _pointerMap[event.pointer];
|
||||
}
|
||||
|
||||
kind = event.kind;
|
||||
x = event.x;
|
||||
y = event.y;
|
||||
dx = event.dx;
|
||||
dy = event.dy;
|
||||
buttons = event.buttons;
|
||||
down = event.down;
|
||||
primary = event.primary;
|
||||
obscured = event.obscured;
|
||||
pressure = event.pressure;
|
||||
pressureMin = event.pressureMin;
|
||||
pressureMax = event.pressureMax;
|
||||
distance = event.distance;
|
||||
distanceMin = event.distanceMin;
|
||||
distanceMax = event.distanceMax;
|
||||
radiusMajor = event.radiusMajor;
|
||||
radiusMinor = event.radiusMinor;
|
||||
radiusMin = event.radiusMin;
|
||||
radiusMax = event.radiusMax;
|
||||
orientation = event.orientation;
|
||||
tilt = event.tilt;
|
||||
|
||||
}
|
||||
|
||||
int pointer;
|
||||
String kind;
|
||||
double x;
|
||||
double y;
|
||||
double dx;
|
||||
double dy;
|
||||
int buttons;
|
||||
bool down;
|
||||
bool primary;
|
||||
bool obscured;
|
||||
double pressure;
|
||||
double pressureMin;
|
||||
double pressureMax;
|
||||
double distance;
|
||||
double distanceMin;
|
||||
double distanceMax;
|
||||
double radiusMajor;
|
||||
double radiusMinor;
|
||||
double radiusMin;
|
||||
double radiusMax;
|
||||
double orientation;
|
||||
double tilt;
|
||||
}
|
||||
@@ -2,10 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'arena.dart';
|
||||
import 'constants.dart';
|
||||
import 'events.dart';
|
||||
import 'pointer_router.dart';
|
||||
import 'recognizer.dart';
|
||||
|
||||
@@ -22,7 +21,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
|
||||
onLongPress();
|
||||
}
|
||||
|
||||
void handlePrimaryPointer(ui.PointerEvent event) {
|
||||
void handlePrimaryPointer(PointerInputEvent event) {
|
||||
if (event.type == 'pointerup')
|
||||
resolve(GestureDisposition.rejected);
|
||||
}
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:flutter/src/gestures/events.dart';
|
||||
|
||||
/// A callback that receives a [ui.PointerEvent]
|
||||
typedef void PointerRoute(ui.PointerEvent event);
|
||||
/// A callback that receives a [PointerInputEvent]
|
||||
typedef void PointerRoute(PointerInputEvent event);
|
||||
|
||||
/// A routing table for [ui.PointerEvent] events.
|
||||
/// A routing table for [PointerInputEvent] events.
|
||||
class PointerRouter {
|
||||
final Map<int, List<PointerRoute>> _routeMap = new Map<int, List<PointerRoute>>();
|
||||
|
||||
/// Adds a route to the routing table
|
||||
///
|
||||
/// Whenever this object routes a [ui.PointerEvent] corresponding to
|
||||
/// Whenever this object routes a [PointerInputEvent] corresponding to
|
||||
/// pointer, call route.
|
||||
void addRoute(int pointer, PointerRoute route) {
|
||||
List<PointerRoute> routes = _routeMap.putIfAbsent(pointer, () => new List<PointerRoute>());
|
||||
@@ -23,7 +23,7 @@ class PointerRouter {
|
||||
|
||||
/// Removes a route from the routing table
|
||||
///
|
||||
/// No longer call route when routing a [ui.PointerEvent] corresponding to
|
||||
/// No longer call route when routing a [PointerInputEvent] corresponding to
|
||||
/// pointer. Requires that this route was previously added to the router.
|
||||
void removeRoute(int pointer, PointerRoute route) {
|
||||
assert(_routeMap.containsKey(pointer));
|
||||
@@ -37,7 +37,7 @@ class PointerRouter {
|
||||
/// Call the routes registed for this pointer event.
|
||||
///
|
||||
/// Calls the routes in the order in which they were added to the route.
|
||||
void route(ui.PointerEvent event) {
|
||||
void route(PointerInputEvent event) {
|
||||
List<PointerRoute> routes = _routeMap[event.pointer];
|
||||
if (routes == null)
|
||||
return;
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'dart:ui' as ui;
|
||||
|
||||
import 'arena.dart';
|
||||
import 'constants.dart';
|
||||
import 'events.dart';
|
||||
import 'pointer_router.dart';
|
||||
|
||||
export 'pointer_router.dart' show PointerRouter;
|
||||
@@ -22,9 +23,9 @@ abstract class GestureRecognizer extends GestureArenaMember {
|
||||
final Set<int> _trackedPointers = new Set<int>();
|
||||
|
||||
/// The primary entry point for users of this class.
|
||||
void addPointer(ui.PointerEvent event);
|
||||
void addPointer(PointerInputEvent event);
|
||||
|
||||
void handleEvent(ui.PointerEvent event);
|
||||
void handleEvent(PointerInputEvent event);
|
||||
void acceptGesture(int pointer) { }
|
||||
void rejectGesture(int pointer) { }
|
||||
void didStopTrackingLastPointer(int pointer);
|
||||
@@ -58,7 +59,7 @@ abstract class GestureRecognizer extends GestureArenaMember {
|
||||
didStopTrackingLastPointer(pointer);
|
||||
}
|
||||
|
||||
void stopTrackingIfPointerNoLongerDown(ui.PointerEvent event) {
|
||||
void stopTrackingIfPointerNoLongerDown(PointerInputEvent event) {
|
||||
if (event.type == 'pointerup' || event.type == 'pointercancel')
|
||||
stopTrackingPointer(event.pointer);
|
||||
}
|
||||
@@ -71,7 +72,7 @@ enum GestureRecognizerState {
|
||||
defunct
|
||||
}
|
||||
|
||||
ui.Point _getPoint(ui.PointerEvent event) {
|
||||
ui.Point _getPoint(PointerInputEvent event) {
|
||||
return new ui.Point(event.x, event.y);
|
||||
}
|
||||
|
||||
@@ -86,7 +87,7 @@ abstract class PrimaryPointerGestureRecognizer extends GestureRecognizer {
|
||||
ui.Point initialPosition;
|
||||
Timer _timer;
|
||||
|
||||
void addPointer(ui.PointerEvent event) {
|
||||
void addPointer(PointerInputEvent event) {
|
||||
startTrackingPointer(event.pointer);
|
||||
if (state == GestureRecognizerState.ready) {
|
||||
state = GestureRecognizerState.possible;
|
||||
@@ -97,7 +98,7 @@ abstract class PrimaryPointerGestureRecognizer extends GestureRecognizer {
|
||||
}
|
||||
}
|
||||
|
||||
void handleEvent(ui.PointerEvent event) {
|
||||
void handleEvent(PointerInputEvent event) {
|
||||
assert(state != GestureRecognizerState.ready);
|
||||
if (state == GestureRecognizerState.possible && event.pointer == primaryPointer) {
|
||||
// TODO(abarth): Maybe factor the slop handling out into a separate class?
|
||||
@@ -110,7 +111,7 @@ abstract class PrimaryPointerGestureRecognizer extends GestureRecognizer {
|
||||
}
|
||||
|
||||
/// Override to provide behavior for the primary pointer when the gesture is still possible.
|
||||
void handlePrimaryPointer(ui.PointerEvent event);
|
||||
void handlePrimaryPointer(PointerInputEvent event);
|
||||
|
||||
/// Override to be notified with [deadline] is exceeded.
|
||||
///
|
||||
@@ -143,7 +144,7 @@ abstract class PrimaryPointerGestureRecognizer extends GestureRecognizer {
|
||||
}
|
||||
}
|
||||
|
||||
double _getDistance(ui.PointerEvent event) {
|
||||
double _getDistance(PointerInputEvent event) {
|
||||
ui.Offset offset = _getPoint(event) - initialPosition;
|
||||
return offset.distance;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'dart:ui' as ui;
|
||||
import 'arena.dart';
|
||||
import 'recognizer.dart';
|
||||
import 'constants.dart';
|
||||
import 'events.dart';
|
||||
|
||||
enum ScaleState {
|
||||
ready,
|
||||
@@ -35,7 +36,7 @@ class ScaleGestureRecognizer extends GestureRecognizer {
|
||||
|
||||
double get _scaleFactor => _initialSpan > 0.0 ? _currentSpan / _initialSpan : 1.0;
|
||||
|
||||
void addPointer(ui.PointerEvent event) {
|
||||
void addPointer(PointerInputEvent event) {
|
||||
startTrackingPointer(event.pointer);
|
||||
if (_state == ScaleState.ready) {
|
||||
_state = ScaleState.possible;
|
||||
@@ -45,7 +46,7 @@ class ScaleGestureRecognizer extends GestureRecognizer {
|
||||
}
|
||||
}
|
||||
|
||||
void handleEvent(ui.PointerEvent event) {
|
||||
void handleEvent(PointerInputEvent event) {
|
||||
assert(_state != ScaleState.ready);
|
||||
bool configChanged = false;
|
||||
switch(event.type) {
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'arena.dart';
|
||||
import 'constants.dart';
|
||||
import 'events.dart';
|
||||
import 'recognizer.dart';
|
||||
|
||||
typedef void GestureShowPressCallback();
|
||||
@@ -23,7 +22,7 @@ class ShowPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
|
||||
onShowPress();
|
||||
}
|
||||
|
||||
void handlePrimaryPointer(ui.PointerEvent event) {
|
||||
void handlePrimaryPointer(PointerInputEvent event) {
|
||||
if (event.type == 'pointerup')
|
||||
resolve(GestureDisposition.rejected);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'arena.dart';
|
||||
import 'events.dart';
|
||||
import 'recognizer.dart';
|
||||
|
||||
typedef void GestureTapCallback();
|
||||
@@ -17,7 +16,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
|
||||
GestureTapCallback onTapDown;
|
||||
GestureTapCallback onTapCancel;
|
||||
|
||||
void handlePrimaryPointer(ui.PointerEvent event) {
|
||||
void handlePrimaryPointer(PointerInputEvent event) {
|
||||
if (event.type == 'pointerdown') {
|
||||
if (onTapDown != null)
|
||||
onTapDown();
|
||||
|
||||
@@ -137,7 +137,7 @@ class _RenderInkWell extends RenderProxyBox {
|
||||
TapGestureRecognizer _tap;
|
||||
LongPressGestureRecognizer _longPress;
|
||||
|
||||
void handleEvent(ui.Event event, BoxHitTestEntry entry) {
|
||||
void handleEvent(InputEvent event, BoxHitTestEntry entry) {
|
||||
if (event.type == 'pointerdown' && (_tap != null || _longPress != null)) {
|
||||
_tap?.addPointer(event);
|
||||
_longPress?.addPointer(event);
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@@ -56,7 +55,7 @@ class _MaterialAppState extends State<MaterialApp> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _backHandler(ui.Event event) {
|
||||
void _backHandler(InputEvent event) {
|
||||
assert(mounted);
|
||||
if (event.type == 'back') {
|
||||
NavigatorState navigator = _navigator.currentState;
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'dart:async';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
@@ -82,8 +83,8 @@ class _RenderSwitch extends RenderToggleable {
|
||||
|
||||
RadialReaction _radialReaction;
|
||||
|
||||
void handleEvent(ui.Event event, BoxHitTestEntry entry) {
|
||||
if (event is ui.PointerEvent) {
|
||||
void handleEvent(InputEvent event, BoxHitTestEntry entry) {
|
||||
if (event is PointerInputEvent) {
|
||||
if (event.type == 'pointerdown')
|
||||
_showRadialReaction(entry.localPosition);
|
||||
else if (event.type == 'pointerup')
|
||||
|
||||
@@ -29,7 +29,7 @@ class _PointerState {
|
||||
Point lastPosition;
|
||||
}
|
||||
|
||||
typedef void EventListener(ui.Event event);
|
||||
typedef void EventListener(InputEvent event);
|
||||
|
||||
/// A hit test entry used by [FlutterBinding]
|
||||
class BindingHitTestEntry extends HitTestEntry {
|
||||
@@ -95,11 +95,12 @@ class FlutterBinding extends HitTestTarget {
|
||||
bool removeEventListener(EventListener listener) => _eventListeners.remove(listener);
|
||||
|
||||
void _handleEvent(ui.Event event) {
|
||||
if (event is ui.PointerEvent) {
|
||||
_handlePointerEvent(event);
|
||||
InputEvent ourEvent = new InputEvent.fromSkyEvent(event);
|
||||
if (ourEvent is PointerInputEvent) {
|
||||
_handlePointerInputEvent(ourEvent);
|
||||
} else {
|
||||
for (EventListener listener in _eventListeners)
|
||||
listener(event);
|
||||
listener(ourEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +112,7 @@ class FlutterBinding extends HitTestTarget {
|
||||
/// to hit-test them on each movement.
|
||||
Map<int, _PointerState> _stateForPointer = new Map<int, _PointerState>();
|
||||
|
||||
void _handlePointerEvent(ui.PointerEvent event) {
|
||||
void _handlePointerInputEvent(PointerInputEvent event) {
|
||||
Point position = new Point(event.x, event.y);
|
||||
|
||||
_PointerState state = _stateForPointer[event.pointer];
|
||||
@@ -155,15 +156,15 @@ class FlutterBinding extends HitTestTarget {
|
||||
}
|
||||
|
||||
/// Dispatch the given event to the path of the given hit test result
|
||||
void dispatchEvent(ui.Event event, HitTestResult result) {
|
||||
void dispatchEvent(InputEvent event, HitTestResult result) {
|
||||
assert(result != null);
|
||||
for (HitTestEntry entry in result.path)
|
||||
entry.target.handleEvent(event, entry);
|
||||
}
|
||||
|
||||
void handleEvent(ui.Event e, BindingHitTestEntry entry) {
|
||||
if (e is ui.PointerEvent) {
|
||||
ui.PointerEvent event = e;
|
||||
void handleEvent(InputEvent e, BindingHitTestEntry entry) {
|
||||
if (e is PointerInputEvent) {
|
||||
PointerInputEvent event = e;
|
||||
pointerRouter.route(event);
|
||||
if (event.type == 'pointerdown')
|
||||
GestureArena.instance.close(event.pointer);
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
/// An object that can handle events.
|
||||
abstract class HitTestTarget {
|
||||
/// Override this function to receive events.
|
||||
void handleEvent(ui.Event event, HitTestEntry entry);
|
||||
void handleEvent(InputEvent event, HitTestEntry entry);
|
||||
}
|
||||
|
||||
/// Data collected during a hit test about a specific [HitTestTarget].
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'dart:ui' as ui;
|
||||
import 'dart:ui' show Point, Offset, Size, Rect, Color, Paint, Path;
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
import 'debug.dart';
|
||||
@@ -1071,7 +1072,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
|
||||
// EVENTS
|
||||
|
||||
/// Override this function to handle events that hit this render object
|
||||
void handleEvent(ui.Event event, HitTestEntry entry) {
|
||||
void handleEvent(InputEvent event, HitTestEntry entry) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
import 'box.dart';
|
||||
@@ -1054,7 +1055,7 @@ class RenderCustomPaint extends RenderProxyBox {
|
||||
}
|
||||
}
|
||||
|
||||
typedef void PointerEventListener(ui.PointerEvent e);
|
||||
typedef void PointerEventListener(PointerInputEvent e);
|
||||
|
||||
/// Invokes the callbacks in response to pointer events.
|
||||
class RenderPointerListener extends RenderProxyBox {
|
||||
@@ -1071,7 +1072,7 @@ class RenderPointerListener extends RenderProxyBox {
|
||||
PointerEventListener onPointerUp;
|
||||
PointerEventListener onPointerCancel;
|
||||
|
||||
void handleEvent(ui.Event event, HitTestEntry entry) {
|
||||
void handleEvent(InputEvent event, HitTestEntry entry) {
|
||||
if (onPointerDown != null && event.type == 'pointerdown')
|
||||
return onPointerDown(event);
|
||||
if (onPointerMove != null && event.type == 'pointermove')
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
@@ -37,7 +35,7 @@ abstract class RenderToggleable extends RenderConstrainedBox {
|
||||
|
||||
double get position => _performance.value;
|
||||
|
||||
void handleEvent(ui.Event event, BoxHitTestEntry entry) {
|
||||
void handleEvent(InputEvent event, BoxHitTestEntry entry) {
|
||||
if (event.type == 'pointerdown')
|
||||
_tap.addPointer(event);
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:collection';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
import 'basic.dart';
|
||||
@@ -69,7 +69,7 @@ class Draggable extends StatefulComponent {
|
||||
class _DraggableState extends State<Draggable> {
|
||||
DragRoute _route;
|
||||
|
||||
void _startDrag(ui.PointerEvent event) {
|
||||
void _startDrag(PointerInputEvent event) {
|
||||
if (_route != null)
|
||||
return; // TODO(ianh): once we switch to using gestures, just hand the gesture to the route so it can do everything itself. then we can have multiple drags at the same time.
|
||||
final Point point = new Point(event.x, event.y);
|
||||
@@ -97,7 +97,7 @@ class _DraggableState extends State<Draggable> {
|
||||
config.navigator.push(_route);
|
||||
}
|
||||
|
||||
void _updateDrag(ui.PointerEvent event) {
|
||||
void _updateDrag(PointerInputEvent event) {
|
||||
if (_route != null) {
|
||||
config.navigator.setState(() {
|
||||
_route.update(new Point(event.x, event.y));
|
||||
@@ -105,14 +105,14 @@ class _DraggableState extends State<Draggable> {
|
||||
}
|
||||
}
|
||||
|
||||
void _cancelDrag(ui.PointerEvent event) {
|
||||
void _cancelDrag(PointerInputEvent event) {
|
||||
if (_route != null) {
|
||||
config.navigator.popRoute(_route, DragEndKind.canceled);
|
||||
assert(_route == null);
|
||||
}
|
||||
}
|
||||
|
||||
void _drop(ui.PointerEvent event) {
|
||||
void _drop(PointerInputEvent event) {
|
||||
if (_route != null) {
|
||||
_route.update(new Point(event.x, event.y));
|
||||
config.navigator.popRoute(_route, DragEndKind.dropped);
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
@@ -187,7 +185,7 @@ class _GestureDetectorState extends State<GestureDetector> {
|
||||
return null;
|
||||
}
|
||||
|
||||
void _handlePointerDown(ui.PointerEvent event) {
|
||||
void _handlePointerDown(PointerInputEvent event) {
|
||||
if (_tap != null)
|
||||
_tap.addPointer(event);
|
||||
if (_showPress != null)
|
||||
|
||||
@@ -1,64 +1,9 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
export 'dart:ui' show Point;
|
||||
|
||||
class TestPointerEvent extends ui.PointerEvent {
|
||||
TestPointerEvent({
|
||||
this.type,
|
||||
this.pointer,
|
||||
this.kind,
|
||||
this.x,
|
||||
this.y,
|
||||
this.dx,
|
||||
this.dy,
|
||||
this.velocityX,
|
||||
this.velocityY,
|
||||
this.buttons,
|
||||
this.down,
|
||||
this.primary,
|
||||
this.obscured,
|
||||
this.pressure,
|
||||
this.pressureMin,
|
||||
this.pressureMax,
|
||||
this.distance,
|
||||
this.distanceMin,
|
||||
this.distanceMax,
|
||||
this.radiusMajor,
|
||||
this.radiusMinor,
|
||||
this.radiusMin,
|
||||
this.radiusMax,
|
||||
this.orientation,
|
||||
this.tilt
|
||||
});
|
||||
|
||||
// These are all of the PointerEvent members, but not all of Event.
|
||||
String type;
|
||||
int pointer;
|
||||
String kind;
|
||||
double x;
|
||||
double y;
|
||||
double dx;
|
||||
double dy;
|
||||
double velocityX;
|
||||
double velocityY;
|
||||
int buttons;
|
||||
bool down;
|
||||
bool primary;
|
||||
bool obscured;
|
||||
double pressure;
|
||||
double pressureMin;
|
||||
double pressureMax;
|
||||
double distance;
|
||||
double distanceMin;
|
||||
double distanceMax;
|
||||
double radiusMajor;
|
||||
double radiusMinor;
|
||||
double radiusMin;
|
||||
double radiusMax;
|
||||
double orientation;
|
||||
double tilt;
|
||||
}
|
||||
|
||||
class TestPointer {
|
||||
TestPointer([ this.pointer = 1 ]);
|
||||
|
||||
@@ -66,11 +11,11 @@ class TestPointer {
|
||||
bool isDown = false;
|
||||
ui.Point location;
|
||||
|
||||
ui.PointerEvent down([ui.Point newLocation = ui.Point.origin ]) {
|
||||
PointerInputEvent down([ui.Point newLocation = ui.Point.origin ]) {
|
||||
assert(!isDown);
|
||||
isDown = true;
|
||||
location = newLocation;
|
||||
return new TestPointerEvent(
|
||||
return new PointerInputEvent(
|
||||
type: 'pointerdown',
|
||||
pointer: pointer,
|
||||
x: location.x,
|
||||
@@ -78,11 +23,11 @@ class TestPointer {
|
||||
);
|
||||
}
|
||||
|
||||
ui.PointerEvent move([ui.Point newLocation = ui.Point.origin ]) {
|
||||
PointerInputEvent move([ui.Point newLocation = ui.Point.origin ]) {
|
||||
assert(isDown);
|
||||
ui.Offset delta = newLocation - location;
|
||||
location = newLocation;
|
||||
return new TestPointerEvent(
|
||||
return new PointerInputEvent(
|
||||
type: 'pointermove',
|
||||
pointer: pointer,
|
||||
x: newLocation.x,
|
||||
@@ -92,10 +37,10 @@ class TestPointer {
|
||||
);
|
||||
}
|
||||
|
||||
ui.PointerEvent up() {
|
||||
PointerInputEvent up() {
|
||||
assert(isDown);
|
||||
isDown = false;
|
||||
return new TestPointerEvent(
|
||||
return new PointerInputEvent(
|
||||
type: 'pointerup',
|
||||
pointer: pointer,
|
||||
x: location.x,
|
||||
@@ -103,10 +48,10 @@ class TestPointer {
|
||||
);
|
||||
}
|
||||
|
||||
ui.PointerEvent cancel() {
|
||||
PointerInputEvent cancel() {
|
||||
assert(isDown);
|
||||
isDown = false;
|
||||
return new TestPointerEvent(
|
||||
return new PointerInputEvent(
|
||||
type: 'pointercancel',
|
||||
pointer: pointer,
|
||||
x: location.x,
|
||||
|
||||
@@ -2,16 +2,14 @@ import 'package:quiver/testing/async.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import '../engine/mock_events.dart';
|
||||
|
||||
final TestPointerEvent down = new TestPointerEvent(
|
||||
final PointerInputEvent down = new PointerInputEvent(
|
||||
pointer: 5,
|
||||
type: 'pointerdown',
|
||||
x: 10.0,
|
||||
y: 10.0
|
||||
);
|
||||
|
||||
final TestPointerEvent up = new TestPointerEvent(
|
||||
final PointerInputEvent up = new PointerInputEvent(
|
||||
pointer: 5,
|
||||
type: 'pointerup',
|
||||
x: 11.0,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -8,7 +6,7 @@ import '../engine/mock_events.dart';
|
||||
void main() {
|
||||
test('Should route pointers', () {
|
||||
bool callbackRan = false;
|
||||
void callback(ui.PointerEvent event) {
|
||||
void callback(PointerInputEvent event) {
|
||||
callbackRan = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void main() {
|
||||
|
||||
TestPointer pointer1 = new TestPointer(1);
|
||||
|
||||
ui.PointerEvent down = pointer1.down(new Point(10.0, 10.0));
|
||||
PointerInputEvent down = pointer1.down(new ui.Point(10.0, 10.0));
|
||||
scale.addPointer(down);
|
||||
tap.addPointer(down);
|
||||
|
||||
@@ -55,7 +55,7 @@ void main() {
|
||||
expect(didEndScale, isFalse);
|
||||
expect(didTap, isFalse);
|
||||
|
||||
router.route(pointer1.move(new Point(20.0, 30.0)));
|
||||
router.route(pointer1.move(new ui.Point(20.0, 30.0)));
|
||||
expect(didStartScale, isTrue);
|
||||
didStartScale = false;
|
||||
expect(updatedFocalPoint, new ui.Point(20.0, 30.0));
|
||||
@@ -67,7 +67,7 @@ void main() {
|
||||
|
||||
// Two-finger scaling
|
||||
TestPointer pointer2 = new TestPointer(2);
|
||||
ui.PointerEvent down2 = pointer2.down(new Point(10.0, 20.0));
|
||||
PointerInputEvent down2 = pointer2.down(new ui.Point(10.0, 20.0));
|
||||
scale.addPointer(down2);
|
||||
tap.addPointer(down2);
|
||||
GestureArena.instance.close(2);
|
||||
@@ -80,7 +80,7 @@ void main() {
|
||||
expect(didStartScale, isFalse);
|
||||
|
||||
// Zoom in
|
||||
router.route(pointer2.move(new Point(0.0, 10.0)));
|
||||
router.route(pointer2.move(new ui.Point(0.0, 10.0)));
|
||||
expect(didStartScale, isTrue);
|
||||
didStartScale = false;
|
||||
expect(updatedFocalPoint, new ui.Point(10.0, 20.0));
|
||||
@@ -91,7 +91,7 @@ void main() {
|
||||
expect(didTap, isFalse);
|
||||
|
||||
// Zoom out
|
||||
router.route(pointer2.move(new Point(15.0, 25.0)));
|
||||
router.route(pointer2.move(new ui.Point(15.0, 25.0)));
|
||||
expect(updatedFocalPoint, new ui.Point(17.5, 27.5));
|
||||
updatedFocalPoint = null;
|
||||
expect(updatedScale, 0.5);
|
||||
@@ -100,7 +100,7 @@ void main() {
|
||||
|
||||
// Three-finger scaling
|
||||
TestPointer pointer3 = new TestPointer(3);
|
||||
ui.PointerEvent down3 = pointer3.down(new Point(25.0, 35.0));
|
||||
PointerInputEvent down3 = pointer3.down(new ui.Point(25.0, 35.0));
|
||||
scale.addPointer(down3);
|
||||
tap.addPointer(down3);
|
||||
GestureArena.instance.close(3);
|
||||
@@ -113,7 +113,7 @@ void main() {
|
||||
expect(didStartScale, isFalse);
|
||||
|
||||
// Zoom in
|
||||
router.route(pointer3.move(new Point(55.0, 65.0)));
|
||||
router.route(pointer3.move(new ui.Point(55.0, 65.0)));
|
||||
expect(didStartScale, isTrue);
|
||||
didStartScale = false;
|
||||
expect(updatedFocalPoint, new ui.Point(30.0, 40.0));
|
||||
@@ -124,9 +124,9 @@ void main() {
|
||||
expect(didTap, isFalse);
|
||||
|
||||
// Return to original positions but with different fingers
|
||||
router.route(pointer1.move(new Point(25.0, 35.0)));
|
||||
router.route(pointer2.move(new Point(20.0, 30.0)));
|
||||
router.route(pointer3.move(new Point(15.0, 25.0)));
|
||||
router.route(pointer1.move(new ui.Point(25.0, 35.0)));
|
||||
router.route(pointer2.move(new ui.Point(20.0, 30.0)));
|
||||
router.route(pointer3.move(new ui.Point(15.0, 25.0)));
|
||||
expect(didStartScale, isFalse);
|
||||
expect(updatedFocalPoint, new ui.Point(20.0, 30.0));
|
||||
updatedFocalPoint = null;
|
||||
@@ -144,7 +144,7 @@ void main() {
|
||||
expect(didTap, isFalse);
|
||||
|
||||
// Continue scaling with two fingers
|
||||
router.route(pointer3.move(new Point(10.0, 20.0)));
|
||||
router.route(pointer3.move(new ui.Point(10.0, 20.0)));
|
||||
expect(didStartScale, isTrue);
|
||||
didStartScale = false;
|
||||
expect(updatedFocalPoint, new ui.Point(15.0, 25.0));
|
||||
@@ -161,7 +161,7 @@ void main() {
|
||||
expect(didTap, isFalse);
|
||||
|
||||
// Continue panning with one finger
|
||||
router.route(pointer3.move(new Point(0.0, 0.0)));
|
||||
router.route(pointer3.move(new ui.Point(0.0, 0.0)));
|
||||
expect(didStartScale, isTrue);
|
||||
didStartScale = false;
|
||||
expect(updatedFocalPoint, new ui.Point(0.0, 0.0));
|
||||
|
||||
@@ -32,7 +32,7 @@ void main() {
|
||||
};
|
||||
|
||||
TestPointer pointer = new TestPointer(5);
|
||||
ui.PointerEvent down = pointer.down(new Point(10.0, 10.0));
|
||||
PointerInputEvent down = pointer.down(new ui.Point(10.0, 10.0));
|
||||
pan.addPointer(down);
|
||||
tap.addPointer(down);
|
||||
GestureArena.instance.close(5);
|
||||
@@ -47,7 +47,7 @@ void main() {
|
||||
expect(didEndPan, isFalse);
|
||||
expect(didTap, isFalse);
|
||||
|
||||
router.route(pointer.move(new Point(20.0, 20.0)));
|
||||
router.route(pointer.move(new ui.Point(20.0, 20.0)));
|
||||
expect(didStartPan, isTrue);
|
||||
didStartPan = false;
|
||||
expect(updatedScrollDelta, new ui.Offset(10.0, 10.0));
|
||||
@@ -55,7 +55,7 @@ void main() {
|
||||
expect(didEndPan, isFalse);
|
||||
expect(didTap, isFalse);
|
||||
|
||||
router.route(pointer.move(new Point(20.0, 25.0)));
|
||||
router.route(pointer.move(new ui.Point(20.0, 25.0)));
|
||||
expect(didStartPan, isFalse);
|
||||
expect(updatedScrollDelta, new ui.Offset(0.0, 5.0));
|
||||
updatedScrollDelta = null;
|
||||
|
||||
@@ -2,16 +2,14 @@ import 'package:quiver/testing/async.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import '../engine/mock_events.dart';
|
||||
|
||||
final TestPointerEvent down = new TestPointerEvent(
|
||||
final PointerInputEvent down = new PointerInputEvent(
|
||||
pointer: 5,
|
||||
type: 'pointerdown',
|
||||
x: 10.0,
|
||||
y: 10.0
|
||||
);
|
||||
|
||||
final TestPointerEvent up = new TestPointerEvent(
|
||||
final PointerInputEvent up = new PointerInputEvent(
|
||||
pointer: 5,
|
||||
type: 'pointerup',
|
||||
x: 11.0,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import '../engine/mock_events.dart';
|
||||
|
||||
void main() {
|
||||
test('Should recognize tap', () {
|
||||
PointerRouter router = new PointerRouter();
|
||||
@@ -13,7 +11,7 @@ void main() {
|
||||
tapRecognized = true;
|
||||
};
|
||||
|
||||
TestPointerEvent down = new TestPointerEvent(
|
||||
PointerInputEvent down = new PointerInputEvent(
|
||||
pointer: 5,
|
||||
type: 'pointerdown',
|
||||
x: 10.0,
|
||||
@@ -26,7 +24,7 @@ void main() {
|
||||
router.route(down);
|
||||
expect(tapRecognized, isFalse);
|
||||
|
||||
TestPointerEvent up = new TestPointerEvent(
|
||||
PointerInputEvent up = new PointerInputEvent(
|
||||
pointer: 5,
|
||||
type: 'pointerup',
|
||||
x: 11.0,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:quiver/testing/async.dart';
|
||||
@@ -159,13 +158,13 @@ class WidgetTester {
|
||||
_dispatchEvent(p.up(), result);
|
||||
}
|
||||
|
||||
void dispatchEvent(ui.Event event, Point location) {
|
||||
void dispatchEvent(InputEvent event, Point location) {
|
||||
_dispatchEvent(event, _hitTest(location));
|
||||
}
|
||||
|
||||
HitTestResult _hitTest(Point location) => WidgetFlutterBinding.instance.hitTest(location);
|
||||
|
||||
void _dispatchEvent(ui.Event event, HitTestResult result) {
|
||||
void _dispatchEvent(InputEvent event, HitTestResult result) {
|
||||
WidgetFlutterBinding.instance.dispatchEvent(event, result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user