Commit bfe3baca authored by Hixie's avatar Hixie

Merge DisposableArenaMember and GestureArenaMember

Turns out there were no uses of GestureArenaMember other than those that
use DisposableArenaMember.
parent 5ea50bf4
...@@ -21,6 +21,11 @@ abstract class GestureArenaMember { ...@@ -21,6 +21,11 @@ abstract class GestureArenaMember {
/// Called when this member loses the arena for the given key. /// Called when this member loses the arena for the given key.
void rejectGesture(Object key); void rejectGesture(Object key);
/// Release any resources used by the object. Called when the object is no
/// longer needed (e.g. a gesture recogniser is being unregistered from a
/// [GestureDetector]).
void dispose() { }
} }
/// An interface to information to an arena /// An interface to information to an arena
......
...@@ -12,11 +12,7 @@ import 'pointer_router.dart'; ...@@ -12,11 +12,7 @@ import 'pointer_router.dart';
export 'pointer_router.dart' show PointerRouter; export 'pointer_router.dart' show PointerRouter;
abstract class DisposableArenaMember extends GestureArenaMember { abstract class GestureRecognizer extends GestureArenaMember {
void dispose();
}
abstract class GestureRecognizer extends DisposableArenaMember {
GestureRecognizer({ PointerRouter router }) : _router = router { GestureRecognizer({ PointerRouter router }) : _router = router {
assert(_router != null); assert(_router != null);
} }
......
...@@ -182,7 +182,7 @@ class _TapGesture extends _TapTracker { ...@@ -182,7 +182,7 @@ class _TapGesture extends _TapTracker {
/// independently. That is, each pointer sequence that could resolve to a tap /// independently. That is, each pointer sequence that could resolve to a tap
/// does so independently of others: down-1, down-2, up-1, up-2 produces two /// does so independently of others: down-1, down-2, up-1, up-2 produces two
/// taps, on up-1 and up-2. /// taps, on up-1 and up-2.
class MultiTapGestureRecognizer extends DisposableArenaMember { class MultiTapGestureRecognizer extends GestureArenaMember {
MultiTapGestureRecognizer({ MultiTapGestureRecognizer({
this.router, this.router,
this.onTapDown, this.onTapDown,
...@@ -243,7 +243,7 @@ class MultiTapGestureRecognizer extends DisposableArenaMember { ...@@ -243,7 +243,7 @@ class MultiTapGestureRecognizer extends DisposableArenaMember {
} }
class DoubleTapGestureRecognizer extends DisposableArenaMember { class DoubleTapGestureRecognizer extends GestureArenaMember {
DoubleTapGestureRecognizer({ this.router, this.onDoubleTap }); DoubleTapGestureRecognizer({ this.router, this.onDoubleTap });
......
...@@ -217,7 +217,7 @@ class _GestureDetectorState extends State<GestureDetector> { ...@@ -217,7 +217,7 @@ class _GestureDetectorState extends State<GestureDetector> {
} }
} }
DisposableArenaMember _ensureDisposed(DisposableArenaMember recognizer) { GestureArenaMember _ensureDisposed(GestureArenaMember recognizer) {
recognizer?.dispose(); recognizer?.dispose();
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment