drag.dart 1.08 KB
Newer Older
1 2 3 4
// Copyright 2015 The Chromium Authors. All rights reserved.
// 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
/// Interface for objects that receive updates about drags.
8
///
9 10 11 12 13 14 15 16
/// 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) { }
17

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

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