API docs for typedefs. (#67003)

This commit is contained in:
Phil Quitslund 2020-09-30 19:32:02 -07:00 committed by GitHub
parent 25f44bb271
commit d3155658bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 4 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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,

View file

@ -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 {

View file

@ -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

View file

@ -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.