drag method

void drag(
  1. DragInfo dragInfo
)

Implementation

void drag(DragInfo dragInfo) {
  if (!AutoTrackConfigManager.instance.autoTrackEnable) {
    return;
  }
  if (!AutoTrackConfigManager.instance.dragEnable) {
    return;
  }
  Map<String, dynamic> params = {};
  params['manual_key'] = 'drag';
  params['begin'] = {
    'x': dragInfo.beginOffset.dx,
    'y': dragInfo.beginOffset.dy,
  };
  params['end'] = {
    'x': dragInfo.endOffset.dx,
    'y': dragInfo.endOffset.dy,
  };
  params['drag_duration'] = dragInfo.duration;
  params['drag_direction'] = dragInfo.direction;

  _appendPageInfo(params, dragInfo.pageInfo);
  _TrackPlugin.drag(params);
  AutoTrackLogger.getInstance().debug('track drag => $params');

}