@@ -40,11 +40,6 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
4040 /// Whether custom refresh indicator can change [IndicatorState] from `idle` to `draging`
4141 bool _canStart = false ;
4242
43- /// Direction in which user is scrolling
44- ScrollDirection _userScrollingDirection;
45-
46- /// The direction in which list scrolls
47- AxisDirection _axisDirection;
4843 double _dragOffset;
4944
5045 AnimationController _animationController;
@@ -60,13 +55,9 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
6055 void initState () {
6156 _dragOffset = 0 ;
6257 _canStart = false ;
63- _axisDirection = AxisDirection .down;
64- _userScrollingDirection = ScrollDirection .idle;
6558
6659 _customRefreshIndicatorData = IndicatorController (
6760 value: _kInitialValue,
68- direction: _axisDirection,
69- scrollingDirection: _userScrollingDirection,
7061 );
7162
7263 _animationController = AnimationController (
@@ -91,8 +82,6 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
9182 void _updateCustomRefreshIndicatorData () {
9283 _customRefreshIndicatorData.updateAndNotify (
9384 value: _animationController? .value ?? _kInitialValue,
94- direction: _axisDirection,
95- scrollingDirection: _userScrollingDirection,
9685 );
9786 }
9887
@@ -112,7 +101,7 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
112101
113102 if (_canStart) controller._setIndicatorState (IndicatorState .draging);
114103
115- _axisDirection = notification.metrics.axisDirection;
104+ controller. _setAxisDirection ( notification.metrics.axisDirection) ;
116105 return false ;
117106 }
118107
@@ -152,7 +141,7 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
152141 }
153142
154143 bool _handleUserScrollNotification (UserScrollNotification notification) {
155- _userScrollingDirection = notification.direction;
144+ controller. _setScrollingDirection ( notification.direction) ;
156145 return false ;
157146 }
158147
0 commit comments