Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ Now, you can click [this site](https://tinoguo.github.io/loading_indicator/) to

## Animation types

| Type | Type | Type | Type |
|---|---|---|---|
|1. ballPulse | 2. ballGridPulse | 3. ballClipRotate | 4. squareSpin|
|5. ballClipRotatePulse | 6. ballClipRotateMultiple | 7. ballPulseRise | 8. ballRotate|
|9. cubeTransition | 10. ballZigZag | 11. ballZigZagDeflect | 12. ballTrianglePath|
|13. ballTrianglePathColored | 14.ballTrianglePathColoredFilled | 15. ballScale | 16. lineScale|
|17. lineScaleParty | 18. ballScaleMultiple | 19. ballPulseSync | 20. ballBeat|
|21. lineScalePulseOut | 22. lineScalePulseOutRapid |23. ballScaleRipple | 24. ballScaleRippleMultiple|
|25. ballSpinFadeLoader | 26. lineSpinFadeLoader | 27. triangleSkewSpin | 28. pacman|
|29. ballGridBeat | 30. semiCircleSpin| 31. ballRotateChase | 32. orbit|
|33. audioEqualizer | 34. circleStrokeSpin|
| Type | Type | Type | Type |
|-----------------------------|----------------------------------|-----------------------|-----------------------------|
| 1. ballPulse | 2. ballGridPulse | 3. ballClipRotate | 4. squareSpin |
| 5. ballClipRotatePulse | 6. ballClipRotateMultiple | 7. ballPulseRise | 8. ballRotate |
| 9. cubeTransition | 10. ballZigZag | 11. ballZigZagDeflect | 12. ballTrianglePath |
| 13. ballTrianglePathColored | 14.ballTrianglePathColoredFilled | 15. ballScale | 16. lineScale |
| 17. lineScaleParty | 18. ballScaleMultiple | 19. ballPulseSync | 20. ballBeat |
| 21. lineScalePulseOut | 22. lineScalePulseOutRapid | 23. ballScaleRipple | 24. ballScaleRippleMultiple |
| 25. ballSpinFadeLoader | 26. lineSpinFadeLoader | 27. triangleSkewSpin | 28. pacman |
| 29. ballGridBeat | 30. semiCircleSpin | 31. ballRotateChase | 32. orbit |
| 33. audioEqualizer | 34. circleStrokeSpin |

## Installing
Install the latest version from [pub](https://pub.dev/packages/loading_indicator)
Expand Down
22 changes: 11 additions & 11 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@

## 动画类型

| Type | Type | Type | Type |
|---|---|---|---|
|1. ballPulse | 2. ballGridPulse | 3. ballClipRotate | 4. squareSpin|
|5. ballClipRotatePulse | 6. ballClipRotateMultiple | 7. ballPulseRise | 8. ballRotate|
|9. cubeTransition | 10. ballZigZag | 11. ballZigZagDeflect | 12. ballTrianglePath|
|13. ballTrianglePathColored | 14.ballTrianglePathColoredFilled | 15. ballScale | 16. lineScale|
|17. lineScaleParty | 18. ballScaleMultiple | 19. ballPulseSync | 20. ballBeat|
|21. lineScalePulseOut | 22. lineScalePulseOutRapid |23. ballScaleRipple | 24. ballScaleRippleMultiple|
|25. ballSpinFadeLoader | 26. lineSpinFadeLoader | 27. triangleSkewSpin | 28. pacman|
|29. ballGridBeat | 30. semiCircleSpin| 31. ballRotateChase | 32. orbit|
|33. audioEqualizer | 34. circleStrokeSpin|
| Type | Type | Type | Type |
|-----------------------------|----------------------------------|-----------------------|-----------------------------|
| 1. ballPulse | 2. ballGridPulse | 3. ballClipRotate | 4. squareSpin |
| 5. ballClipRotatePulse | 6. ballClipRotateMultiple | 7. ballPulseRise | 8. ballRotate |
| 9. cubeTransition | 10. ballZigZag | 11. ballZigZagDeflect | 12. ballTrianglePath |
| 13. ballTrianglePathColored | 14.ballTrianglePathColoredFilled | 15. ballScale | 16. lineScale |
| 17. lineScaleParty | 18. ballScaleMultiple | 19. ballPulseSync | 20. ballBeat |
| 21. lineScalePulseOut | 22. lineScalePulseOutRapid | 23. ballScaleRipple | 24. ballScaleRippleMultiple |
| 25. ballSpinFadeLoader | 26. lineSpinFadeLoader | 27. triangleSkewSpin | 28. pacman |
| 29. ballGridBeat | 30. semiCircleSpin | 31. ballRotateChase | 32. orbit |
| 33. audioEqualizer | 34. circleStrokeSpin |

## 安装
从[pub](https://pub.dev/packages/loading_indicator)安装最新版本。
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MainWidget extends StatelessWidget {
child: LoadingIndicator(
indicatorType: indicator,
colors: _kDefaultRainbowColors,
strokeWidth: 4.0,
strokeWidth: 40.0,
pathBackgroundColor:
showPathBackground ? Colors.black45 : null,
),
Expand Down
11 changes: 6 additions & 5 deletions example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXAggregateTarget section */
Expand Down Expand Up @@ -182,7 +182,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down Expand Up @@ -235,6 +235,7 @@
/* Begin PBXShellScriptBuildPhase section */
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -344,7 +345,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -423,7 +424,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -470,7 +471,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 1 addition & 3 deletions lib/src/decorate/decorate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:loading_indicator/loading_indicator.dart';

const double _kDefaultStrokeWidth = 2;

/// Information about a piece of animation (e.g., color).
@immutable
class DecorateData {
Expand All @@ -30,7 +28,7 @@ class DecorateData {
}) : _strokeWidth = strokeWidth,
assert(colors.length > 0);

double get strokeWidth => _strokeWidth ?? _kDefaultStrokeWidth;
double get strokeWidth => _strokeWidth ?? 0;

Function get _deepEq => const DeepCollectionEquality().equals;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/audio_equalizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _AudioEqualizerState extends State<AudioEqualizer>
);
},
child: IndicatorShapeWidget(
shape: Shape.rectangle,
shape: const Square(),
index: i ~/ 2,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_beat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class _BallBeatState extends State<BallBeat>
child: ScaleTransition(
scale: _scaleAnimations[i ~/ 2],
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i ~/ 2,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_clip_rotate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _BallClipRotateState extends State<BallClipRotate>
child: child,
);
},
child: const IndicatorShapeWidget(shape: Shape.ringThirdFour),
child: const IndicatorShapeWidget(shape: RingThirdFour()),
);
}
}
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_clip_rotate_multiple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _BallClipRotateMultipleState extends State<BallClipRotateMultiple>
),
],
),
child: const IndicatorShapeWidget(shape: Shape.ringTwoHalfVertical),
child: const IndicatorShapeWidget(shape: RingTwoHalfVertical()),
),
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/indicators/ball_clip_rotate_pulse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ class _BallClipRotatePulseState extends State<BallClipRotatePulse>
..scale(_outCircleScale.value)
..rotateZ(_outCircleRotate.value),
child: const IndicatorShapeWidget(
shape: Shape.ringTwoHalfVertical,
shape: RingTwoHalfVertical(),
index: 0,
),
),
Transform.scale(
scale: _innerCircle.value * 0.3,
child: const IndicatorShapeWidget(
shape: Shape.circle,
shape: Circle(),
index: 1,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_grid_beat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _BallGridBeatState extends State<BallGridBeat>
child: FadeTransition(
opacity: _animations[i],
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_grid_pulse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _BallGridPulseState extends State<BallGridPulse>
child: FadeTransition(
opacity: _opacityAnimations[i],
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_pulse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class _BallPulseState extends State<BallPulse>
child: ScaleTransition(
scale: _scaleAnimations[i],
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_pulse_rise.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class _BallPulseRiseState extends State<BallPulseRise>
);
},
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: index,
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_pulse_sync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class _BallPulseSyncState extends State<BallPulseSync>
);
},
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_rotate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class _BallRotateState extends State<BallRotate>
return Opacity(
opacity: opacity,
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: index,
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_rotate_chase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _BallRotateChaseState extends State<BallRotateChase>
);
},
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_scale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _BallScaleState extends State<BallScale>
opacity: _opacityAnimation,
child: ScaleTransition(
scale: _scaleAnimation,
child: const IndicatorShapeWidget(shape: Shape.circle),
child: const IndicatorShapeWidget(shape: Circle()),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_scale_multiple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _BallScaleMultipleState extends State<BallScaleMultiple>
child: FadeTransition(
opacity: _opacityAnimations[i],
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_scale_ripple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class _BallScaleRippleState extends State<BallScaleRipple>
opacity: _opacityAnimation,
child: ScaleTransition(
scale: _scaleAnimation,
child: const IndicatorShapeWidget(shape: Shape.ring),
child: const IndicatorShapeWidget(shape: Ring()),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_scale_ripple_multiple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _BallScaleRippleMultipleState extends State<BallScaleRippleMultiple>
child: FadeTransition(
opacity: _opacityAnimations[i],
child: IndicatorShapeWidget(
shape: Shape.ring,
shape: const Ring(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_spin_fade_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _BallSpinFadeLoaderState extends State<BallSpinFadeLoader>
child: ScaleTransition(
scale: _scaleAnimations[i],
child: IndicatorShapeWidget(
shape: Shape.circle,
shape: const Circle(),
index: i,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_triangle_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _BallTrianglePathState extends State<BallTrianglePath>
);
},
child: IndicatorShapeWidget(
shape: Shape.ring,
shape: const Ring(),
index: index,
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/indicators/ball_triangle_path_colored.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _BallTrianglePathColoredState extends State<BallTrianglePathColored>
);
},
child: IndicatorShapeWidget(
shape: widget.isFilled ? Shape.circle : Shape.ring,
shape: widget.isFilled ? const Circle() : const Ring(),
index: index,
),
);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/indicators/ball_zig_zag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class _BallZigZagState extends State<BallZigZag>
..translate(deltaX * _animation.value.dx,
deltaY * _animation.value.dy),
child: const IndicatorShapeWidget(
shape: Shape.circle,
shape: Circle(),
index: 0,
),
),
Expand All @@ -74,7 +74,7 @@ class _BallZigZagState extends State<BallZigZag>
..translate(deltaX * -_animation.value.dx,
deltaY * -_animation.value.dy),
child: const IndicatorShapeWidget(
shape: Shape.circle,
shape: Circle(),
index: 1,
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/indicators/ball_zig_zag_deflect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _BallZigZagDeflectState extends State<BallZigZagDeflect>
..translate(deltaX * _animation.value.dx,
deltaY * _animation.value.dy),
child: const IndicatorShapeWidget(
shape: Shape.circle,
shape: Circle(),
index: 0,
),
),
Expand All @@ -73,7 +73,7 @@ class _BallZigZagDeflectState extends State<BallZigZagDeflect>
..translate(deltaX * -_animation.value.dx,
deltaY * -_animation.value.dy),
child: const IndicatorShapeWidget(
shape: Shape.circle,
shape: Circle(),
index: 1,
),
),
Expand Down
5 changes: 4 additions & 1 deletion lib/src/indicators/circle_stroke_spin.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import 'package:flutter/material.dart';
import 'package:loading_indicator/src/decorate/decorate.dart';

const double _kDefaultStrokeWidth = 2;

/// CircleStrokeSpin.
class CircleStrokeSpin extends StatelessWidget {
const CircleStrokeSpin({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
final color = DecorateContext.of(context)!.decorateData.colors.first;
final strokeWidth = DecorateContext.of(context)!.decorateData.strokeWidth;
return CircularProgressIndicator(
strokeWidth: DecorateContext.of(context)!.decorateData.strokeWidth,
strokeWidth: strokeWidth == 0 ? _kDefaultStrokeWidth : strokeWidth,
color: color,
backgroundColor:
DecorateContext.of(context)!.decorateData.pathBackgroundColor,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/indicators/cube_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class _CubeTransitionState extends State<CubeTransition>
..rotateZ(_rotateAnimation.value)
..scale(_scaleAnimation.value),
child: const IndicatorShapeWidget(
shape: Shape.rectangle,
shape: Square(),
index: 0,
),
),
Expand All @@ -107,7 +107,7 @@ class _CubeTransitionState extends State<CubeTransition>
..rotateZ(_rotateAnimation.value)
..scale(_scaleAnimation.value),
child: const IndicatorShapeWidget(
shape: Shape.rectangle,
shape: Square(),
index: 1,
),
),
Expand Down
Loading