Skip to content

Commit

Permalink
- fix: CupertinoActivityIndicator renamed to avoid conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelongqy committed Jan 11, 2023
1 parent cb8a0ff commit c0dc8b5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.2.2+1
- fix: CupertinoActivityIndicator renamed to avoid conflicts.

## 3.2.2
- fix: Compatible with Flutter2.8.1 and below [#619](https://github.com/xuelongqy/flutter_easy_refresh/issues/619).
- perf: Pub scores.
Expand Down
2 changes: 1 addition & 1 deletion lib/easy_refresh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ library easy_refresh;
import 'dart:math' as math;
import 'dart:async';

import 'package:flutter/cupertino.dart' hide CupertinoActivityIndicator;
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
Expand Down
15 changes: 8 additions & 7 deletions lib/src/styles/cupertino/cupertino_activity_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ const Color _kActiveTickColor = CupertinoDynamicColor.withBrightness(
/// {@youtube 560 315 https://www.youtube.com/watch?v=AENVH-ZqKDQ}
///
/// {@tool dartpad}
/// This example shows how [CupertinoActivityIndicator] can be customized.
/// This example shows how [_CupertinoActivityIndicator] can be customized.
///
/// ** See code in examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart **
/// {@end-tool}
///
/// See also:
///
/// * <https://developer.apple.com/ios/human-interface-guidelines/controls/progress-indicators/#activity-indicators>
class CupertinoActivityIndicator extends StatefulWidget {
class _CupertinoActivityIndicator extends StatefulWidget {
/// Creates an iOS-style activity indicator that spins clockwise.
const CupertinoActivityIndicator({
const _CupertinoActivityIndicator({
Key? key,
this.color,
this.animating = true,
Expand All @@ -38,7 +38,7 @@ class CupertinoActivityIndicator extends StatefulWidget {
/// When provided, the value of [progress] must be between 0.0 (zero ticks
/// will be shown) and 1.0 (all ticks will be shown) inclusive. Defaults
/// to 1.0.
const CupertinoActivityIndicator.partiallyRevealed({
const _CupertinoActivityIndicator.partiallyRevealed({
Key? key,
this.color,
this.radius = _kDefaultIndicatorRadius,
Expand Down Expand Up @@ -73,11 +73,12 @@ class CupertinoActivityIndicator extends StatefulWidget {
final double progress;

@override
State<CupertinoActivityIndicator> createState() =>
State<_CupertinoActivityIndicator> createState() =>
_CupertinoActivityIndicatorState();
}

class _CupertinoActivityIndicatorState extends State<CupertinoActivityIndicator>
class _CupertinoActivityIndicatorState
extends State<_CupertinoActivityIndicator>
with SingleTickerProviderStateMixin {
late AnimationController _controller;

Expand All @@ -95,7 +96,7 @@ class _CupertinoActivityIndicatorState extends State<CupertinoActivityIndicator>
}

@override
void didUpdateWidget(CupertinoActivityIndicator oldWidget) {
void didUpdateWidget(_CupertinoActivityIndicator oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.animating != oldWidget.animating) {
if (widget.animating) {
Expand Down
8 changes: 5 additions & 3 deletions lib/src/styles/cupertino/cupertino_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class _CupertinoIndicatorState extends State<_CupertinoIndicator>
indicator = Opacity(
key: const ValueKey('indicator'),
opacity: opacityCurve.transform(scale),
child: CupertinoActivityIndicator.partiallyRevealed(
child: _CupertinoActivityIndicator.partiallyRevealed(
radius: _radius,
progress: scale,
color: widget.foregroundColor,
Expand All @@ -118,17 +118,19 @@ class _CupertinoIndicatorState extends State<_CupertinoIndicator>
case IndicatorMode.ready:
case IndicatorMode.processing:
case IndicatorMode.processed:
indicator = CupertinoActivityIndicator(
indicator = _CupertinoActivityIndicator(
key: const ValueKey('indicator'),
radius: _radius,
color: widget.foregroundColor,
animating: true,
);
break;
case IndicatorMode.done:
indicator = CupertinoActivityIndicator(
indicator = _CupertinoActivityIndicator(
key: const ValueKey('indicator'),
radius: _radius * scale,
color: widget.foregroundColor,
animating: true,
);
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: easy_refresh
description: A flutter widget that provides pull-down refresh and pull-up load.
version: 3.2.2
version: 3.2.2+1
homepage: https://xuelongqy.github.io/flutter_easy_refresh
repository: https://github.com/xuelongqy/flutter_easy_refresh
issue_tracker: https://github.com/xuelongqy/flutter_easy_refresh/issues
Expand Down

0 comments on commit c0dc8b5

Please sign in to comment.