Skip to content

Commit aa176a4

Browse files
committed
add lineWidth option (#9)
1 parent 0450ab1 commit aa176a4

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

README-zh_CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ double fontSize;
9595
/// 进度条指示器的宽度, 默认2.0.
9696
double progressWidth;
9797
98+
/// 指示器的宽度, 默认4.0, 仅对[EasyLoadingIndicatorType.ring, EasyLoadingIndicatorType.dualRing]有效.
99+
double lineWidth;
100+
98101
/// [showSuccess] [showError] [showInfo]的展示时间, 默认2000ms.
99102
Duration displayDuration;
100103

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ double fontSize;
9595
/// width of progress indicator, default 2.0.
9696
double progressWidth;
9797
98+
/// width of indicator, default 4.0, only used for [EasyLoadingIndicatorType.ring, EasyLoadingIndicatorType.dualRing].
99+
double lineWidth;
100+
98101
/// display duration of [showSuccess] [showError] [showInfo], default 2000ms.
99102
Duration displayDuration;
100103

lib/src/easy_loading.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class EasyLoading {
8383
/// width of progress indicator, default 2.0.
8484
double progressWidth;
8585

86+
/// width of indicator, default 4.0, only used for [EasyLoadingIndicatorType.ring, EasyLoadingIndicatorType.dualRing].
87+
double lineWidth;
88+
8689
/// display duration of [showSuccess] [showError] [showInfo] [showToast], default 2000ms.
8790
Duration displayDuration;
8891

@@ -140,6 +143,7 @@ class EasyLoading {
140143
radius = 5.0;
141144
fontSize = 15.0;
142145
progressWidth = 2.0;
146+
lineWidth = 4.0;
143147
displayDuration = const Duration(milliseconds: 2000);
144148
textPadding = const EdgeInsets.only(bottom: 10.0);
145149
contentPadding = const EdgeInsets.symmetric(

lib/src/theme.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class EasyLoadingTheme {
5252
/// width of progress indicator
5353
static double get progressWidth => EasyLoading.instance.progressWidth;
5454

55+
/// width of indicator
56+
static double get lineWidth => EasyLoading.instance.lineWidth;
57+
5558
/// loading indicator type
5659
static EasyLoadingIndicatorType get indicatorType =>
5760
EasyLoading.instance.indicatorType;

lib/src/widgets/indicator.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class _LoadingIndicatorState extends State<LoadingIndicator> {
6565
_indicator = SpinKitWave(
6666
color: _indicatorColor,
6767
size: _size,
68+
itemCount: 6,
6869
);
6970
_width = _size * 1.25;
7071
break;
@@ -132,6 +133,7 @@ class _LoadingIndicatorState extends State<LoadingIndicator> {
132133
_indicator = SpinKitDualRing(
133134
color: _indicatorColor,
134135
size: _size,
136+
lineWidth: EasyLoadingTheme.lineWidth,
135137
);
136138
break;
137139
case EasyLoadingIndicatorType.hourGlass:
@@ -156,6 +158,7 @@ class _LoadingIndicatorState extends State<LoadingIndicator> {
156158
_indicator = SpinKitRing(
157159
color: _indicatorColor,
158160
size: _size,
161+
lineWidth: EasyLoadingTheme.lineWidth,
159162
);
160163
break;
161164
case EasyLoadingIndicatorType.ripple:

0 commit comments

Comments
 (0)