• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'drag_details.dart';
6
7/// Interface for objects that receive updates about drags.
8///
9/// This interface is used in various ways. For example,
10/// [MultiDragGestureRecognizer] uses it to update its clients when it
11/// recognizes a gesture. Similarly, the scrolling infrastructure in the widgets
12/// library uses it to notify the [DragScrollActivity] when the user drags the
13/// scrollable.
14abstract class Drag {
15  /// The pointer has moved.
16  void update(DragUpdateDetails details) { }
17
18  /// The pointer is no longer in contact with the screen.
19  ///
20  /// The velocity at which the pointer was moving when it stopped contacting
21  /// the screen is available in the `details`.
22  void end(DragEndDetails details) { }
23
24  /// The input from the pointer is no longer directed towards this receiver.
25  ///
26  /// For example, the user might have been interrupted by a system-modal dialog
27  /// in the middle of the drag.
28  void cancel() { }
29}
30