diff --git a/packages/flutter/lib/src/gestures/binding.dart b/packages/flutter/lib/src/gestures/binding.dart index 19b674b680..6005fcb2b0 100644 --- a/packages/flutter/lib/src/gestures/binding.dart +++ b/packages/flutter/lib/src/gestures/binding.dart @@ -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. diff --git a/packages/flutter/lib/src/gestures/monodrag.dart b/packages/flutter/lib/src/gestures/monodrag.dart index 602fff72a0..4509eeb93a 100644 --- a/packages/flutter/lib/src/gestures/monodrag.dart +++ b/packages/flutter/lib/src/gestures/monodrag.dart @@ -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. diff --git a/packages/flutter/lib/src/gestures/resampler.dart b/packages/flutter/lib/src/gestures/resampler.dart index 208a4d99a6..0e3ddcdead 100644 --- a/packages/flutter/lib/src/gestures/resampler.dart +++ b/packages/flutter/lib/src/gestures/resampler.dart @@ -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. diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index ea8f9aa8e8..5bb5cb8e7f 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -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, diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 600c408140..ab4f29eb73 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -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 Function(BuildContext context); class _DropdownMenuPainter extends CustomPainter { diff --git a/packages/flutter/lib/src/painting/debug.dart b/packages/flutter/lib/src/painting/debug.dart index 0ebd0acce9..54692f7b76 100644 --- a/packages/flutter/lib/src/painting/debug.dart +++ b/packages/flutter/lib/src/painting/debug.dart @@ -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 diff --git a/packages/flutter/lib/src/widgets/sliver.dart b/packages/flutter/lib/src/widgets/sliver.dart index 9297d502cd..0c1dff2cfb 100644 --- a/packages/flutter/lib/src/widgets/sliver.dart +++ b/packages/flutter/lib/src/widgets/sliver.dart @@ -213,6 +213,10 @@ class _SaltedValueKey extends ValueKey{ 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.