diff --git a/CHANGELOG.md b/CHANGELOG.md index aad36d1..bd09f7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## Next +- fix: Increase the priority of ClassicIndicator.pullIconBuilder [#674](https://github.com/xuelongqy/flutter_easy_refresh/issues/674). + ## 3.3.1 - fix: Avoid an endless loop caused by multiple ListViews nested, Thanks LinXunFeng for [PR#681](https://github.com/xuelongqy/flutter_easy_refresh/pull/681). - fix: FooterNotifier.callTask use callRefreshOverOffset, Thanks AWarmHug for [PR#680](https://github.com/xuelongqy/flutter_easy_refresh/pull/680). diff --git a/lib/src/styles/classic/classic_indicator.dart b/lib/src/styles/classic/classic_indicator.dart index 9ea2acf..9f141b0 100644 --- a/lib/src/styles/classic/classic_indicator.dart +++ b/lib/src/styles/classic/classic_indicator.dart @@ -86,7 +86,7 @@ class _ClassicIndicator extends StatefulWidget { /// Icon when [IndicatorResult.noMore]. final Widget? noMoreIcon; - /// Icon on pull. + /// Icon on pull builder. final CIPullIconBuilder? pullIconBuilder; /// Text style. @@ -265,6 +265,10 @@ class _ClassicIndicatorState extends State<_ClassicIndicator> /// Build icon. Widget _buildIcon() { + if (widget.pullIconBuilder != null) { + return widget.pullIconBuilder! + .call(context, widget.state, _iconAnimationController.value); + } Widget icon; final iconTheme = widget.iconTheme ?? Theme.of(context).iconTheme; ValueKey iconKey; @@ -315,18 +319,14 @@ class _ClassicIndicatorState extends State<_ClassicIndicator> } else { iconKey = const ValueKey(IndicatorMode.drag); icon = SizedBox( - child: widget.pullIconBuilder - ?.call(context, widget.state, _iconAnimationController.value) ?? - Transform.rotate( - angle: -math.pi * _iconAnimationController.value, - child: Icon(widget.reverse - ? (_axis == Axis.vertical - ? Icons.arrow_upward - : Icons.arrow_back) - : (_axis == Axis.vertical - ? Icons.arrow_downward - : Icons.arrow_forward)), - ), + child: Transform.rotate( + angle: -math.pi * _iconAnimationController.value, + child: Icon(widget.reverse + ? (_axis == Axis.vertical ? Icons.arrow_upward : Icons.arrow_back) + : (_axis == Axis.vertical + ? Icons.arrow_downward + : Icons.arrow_forward)), + ), ); } return AnimatedSwitcher(