drag.dart 1.15 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
import 'drag_details.dart';
6

7 8
export 'drag_details.dart' show DragEndDetails, DragUpdateDetails;

9
/// Interface for objects that receive updates about drags.
10
///
11 12 13 14 15 16 17 18
/// 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) { }
19

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

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