Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v3' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelongqy committed Feb 27, 2023
2 parents 45cc91d + 12d33cb commit e8e5923
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
26 changes: 13 additions & 13 deletions lib/src/styles/classic/classic_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e8e5923

Please sign in to comment.