Skip to content

Instantly share code, notes, and snippets.

@pstjvn
Created April 22, 2015 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pstjvn/dcb785401fb577d2b6f5 to your computer and use it in GitHub Desktop.
Save pstjvn/dcb785401fb577d2b6f5 to your computer and use it in GitHub Desktop.
How I arrange items in class
PointerAgent.internal(): super.internal() {
_startPoint = new Point(0, 0);
_currentPoint = new Point(0, 0);
_lastPoint = new Point(0, 0);
_longPressDelay = new Delay(1500, _fireLongPress);
_raf = new AnimationFrame(mutate: (_) {_handleAnimationFrame(_);});
_initEventListeners();
}
AnimationFrame _raf;
Set<html.Element> _elements = new Set();
Map<html.Element, Component> _elementToComponentMap = new Map();
Map<html.Element, List<StreamSubscription>> _elementToSubscriptionsMap = new Map();
Delay _longPressDelay;
bool _cancelMoveEvent = false;
List<StreamSubscription> _mouseMoveSubscriptionOnDocument;
html.Element _currentElement;
T _currentComponent;
SourceType _originalEventType = SourceType.UNKNOWN;
html.Element _sourceElement;
Point _startPoint;
Point _currentPoint;
Point _lastPoint;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment