opt init recognizer

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-09 09:44:41 +08:00
parent 0cb07aef1c
commit 32cd3209d0
11 changed files with 28 additions and 27 deletions

View File

@@ -114,7 +114,7 @@ class PageView<T extends HorizontalDragGestureRecognizer>
required this.horizontalDragGestureRecognizer,
}) : childrenDelegate = SliverChildListDelegate(children);
final T horizontalDragGestureRecognizer;
final GestureRecognizerFactoryConstructor<T> horizontalDragGestureRecognizer;
/// Creates a scrollable list that works page by page using widgets that are
/// created on demand.

View File

@@ -105,7 +105,7 @@ class Scrollable<T extends HorizontalDragGestureRecognizer>
required this.horizontalDragGestureRecognizer,
}) : assert(semanticChildCount == null || semanticChildCount >= 0);
final T horizontalDragGestureRecognizer;
final GestureRecognizerFactoryConstructor<T> horizontalDragGestureRecognizer;
/// {@template flutter.widgets.Scrollable.axisDirection}
/// The direction in which this widget scrolls.
@@ -815,7 +815,7 @@ class ScrollableState<T extends HorizontalDragGestureRecognizer>
case Axis.horizontal:
_gestureRecognizers = <Type, GestureRecognizerFactory>{
T: GestureRecognizerFactoryWithHandlers<T>(
() => widget.horizontalDragGestureRecognizer,
widget.horizontalDragGestureRecognizer,
(T instance) {
instance
..onDown = _handleDragDown

View File

@@ -38,7 +38,7 @@ class TabBarView<T extends HorizontalDragGestureRecognizer>
required this.horizontalDragGestureRecognizer,
});
final T horizontalDragGestureRecognizer;
final GestureRecognizerFactoryConstructor<T> horizontalDragGestureRecognizer;
/// This widget's selection and animation state.
///