mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
API docs for typedefs. (#67003)
This commit is contained in:
parent
25f44bb271
commit
d3155658bc
|
@ -19,7 +19,7 @@ import 'pointer_router.dart';
|
|||
import 'pointer_signal_resolver.dart';
|
||||
import 'resampler.dart';
|
||||
|
||||
typedef HandleSampleTimeChangedCallback = void Function();
|
||||
typedef _HandleSampleTimeChangedCallback = void Function();
|
||||
|
||||
// Class that handles resampling of touch events for multiple pointer
|
||||
// devices.
|
||||
|
@ -48,7 +48,7 @@ class _Resampler {
|
|||
final HandleEventCallback _handlePointerEvent;
|
||||
|
||||
// Callback used to handle sample time changes.
|
||||
final HandleSampleTimeChangedCallback _handleSampleTimeChanged;
|
||||
final _HandleSampleTimeChangedCallback _handleSampleTimeChanged;
|
||||
|
||||
// Enqueue `events` for resampling or dispatch them directly if
|
||||
// not a touch event.
|
||||
|
|
|
@ -24,15 +24,18 @@ enum _DragState {
|
|||
/// The velocity at which the pointer was moving when it stopped contacting
|
||||
/// the screen is available in the `details`.
|
||||
///
|
||||
/// See [DragGestureRecognizer.onEnd].
|
||||
/// Used by [DragGestureRecognizer.onEnd].
|
||||
typedef GestureDragEndCallback = void Function(DragEndDetails details);
|
||||
|
||||
/// Signature for when the pointer that previously triggered a
|
||||
/// [GestureDragDownCallback] did not complete.
|
||||
///
|
||||
/// See [DragGestureRecognizer.onCancel].
|
||||
/// Used by [DragGestureRecognizer.onCancel].
|
||||
typedef GestureDragCancelCallback = void Function();
|
||||
|
||||
/// Signature for a function that builds a [VelocityTracker].
|
||||
///
|
||||
/// Used by [DragGestureRecognizer.velocityTrackerBuilder].
|
||||
typedef GestureVelocityTrackerBuilder = VelocityTracker Function(PointerEvent event);
|
||||
|
||||
/// Recognizes movement.
|
||||
|
|
|
@ -6,6 +6,8 @@ import 'dart:collection';
|
|||
|
||||
import 'events.dart';
|
||||
|
||||
/// A callback used by [PointerEventResampler.sample] and
|
||||
/// [PointerEventResampler.stop] to process a resampled `event`.
|
||||
typedef HandleEventCallback = void Function(PointerEvent event);
|
||||
|
||||
/// Class for pointer event resampling.
|
||||
|
|
|
@ -25,7 +25,14 @@ const Curve _modalBottomSheetCurve = decelerateEasing;
|
|||
const double _minFlingVelocity = 700.0;
|
||||
const double _closeProgressThreshold = 0.5;
|
||||
|
||||
/// A callback for when the user begins dragging the bottom sheet.
|
||||
///
|
||||
/// Used by [BottomSheet.onDragStart].
|
||||
typedef BottomSheetDragStartHandler = void Function(DragStartDetails details);
|
||||
|
||||
/// A callback for when the user stops dragging the bottom sheet.
|
||||
///
|
||||
/// Used by [BottomSheet.onDragEnd].
|
||||
typedef BottomSheetDragEndHandler = void Function(
|
||||
DragEndDetails details, {
|
||||
bool isClosing,
|
||||
|
|
|
@ -34,6 +34,9 @@ const EdgeInsets _kUnalignedButtonPadding = EdgeInsets.zero;
|
|||
const EdgeInsets _kAlignedMenuMargin = EdgeInsets.zero;
|
||||
const EdgeInsetsGeometry _kUnalignedMenuMargin = EdgeInsetsDirectional.only(start: 16.0, end: 24.0);
|
||||
|
||||
/// A builder to customize dropdown buttons.
|
||||
///
|
||||
/// Used by [DropdownButton.selectedItemBuilder].
|
||||
typedef DropdownButtonBuilder = List<Widget> Function(BuildContext context);
|
||||
|
||||
class _DropdownMenuPainter extends CustomPainter {
|
||||
|
|
|
@ -31,6 +31,11 @@ typedef HttpClientProvider = HttpClient Function();
|
|||
/// This value is ignored in non-debug builds.
|
||||
HttpClientProvider? debugNetworkImageHttpClientProvider;
|
||||
|
||||
/// Called when the framework is about to paint an [Image] to a [Canvas] with an
|
||||
/// [ImageSizeInfo] that contains the decoded size of the image as well as its
|
||||
/// output size.
|
||||
///
|
||||
/// See: [debugOnPaintImage].
|
||||
typedef PaintImageCallback = void Function(ImageSizeInfo);
|
||||
|
||||
/// Tracks the bytes used by a [dart:ui.Image] compared to the bytes needed to
|
||||
|
|
|
@ -213,6 +213,10 @@ class _SaltedValueKey extends ValueKey<Key>{
|
|||
const _SaltedValueKey(Key key): assert(key != null), super(key);
|
||||
}
|
||||
|
||||
/// Called to find the new index of a child based on its key in case of
|
||||
/// reordering.
|
||||
///
|
||||
/// Used by [SliverChildBuilderDelegate.findChildIndexCallback].
|
||||
typedef ChildIndexGetter = int Function(Key key);
|
||||
|
||||
/// A delegate that supplies children for slivers using a builder callback.
|
||||
|
|
Loading…
Reference in a new issue