drag.dart 1.08 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5

6
import 'drag_details.dart';
7

8
/// Interface for objects that receive updates about drags.
9
///
10 11 12 13 14 15 16 17
/// This interface is used in various ways. For example,
/// [MultiDragGestureRecognizer] uses it to update its clients when it
/// recognizes a gesture. Similarly, the scrolling infrastructure in the widgets
/// library uses it to notify the [DragScrollActivity] when the user drags the
/// scrollable.
abstract class Drag {
  /// The pointer has moved.
  void update(DragUpdateDetails details) { }
18

19
  /// The pointer is no longer in contact with the screen.
20
  ///
21 22 23
  /// The velocity at which the pointer was moving when it stopped contacting
  /// the screen is available in the `details`.
  void end(DragEndDetails details) { }
24

25
  /// The input from the pointer is no longer directed towards this receiver.
26
  ///
27 28 29
  /// For example, the user might have been interrupted by a system-modal dialog
  /// in the middle of the drag.
  void cancel() { }
30
}