Skip to content

Commit

Permalink
add lineWidth option (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
nslogx committed Mar 23, 2020
1 parent 0450ab1 commit aa176a4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ double fontSize;
/// 进度条指示器的宽度, 默认2.0.
double progressWidth;
/// 指示器的宽度, 默认4.0, 仅对[EasyLoadingIndicatorType.ring, EasyLoadingIndicatorType.dualRing]有效.
double lineWidth;
/// [showSuccess] [showError] [showInfo]的展示时间, 默认2000ms.
Duration displayDuration;
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ double fontSize;
/// width of progress indicator, default 2.0.
double progressWidth;
/// width of indicator, default 4.0, only used for [EasyLoadingIndicatorType.ring, EasyLoadingIndicatorType.dualRing].
double lineWidth;
/// display duration of [showSuccess] [showError] [showInfo], default 2000ms.
Duration displayDuration;
Expand Down
4 changes: 4 additions & 0 deletions lib/src/easy_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class EasyLoading {
/// width of progress indicator, default 2.0.
double progressWidth;

/// width of indicator, default 4.0, only used for [EasyLoadingIndicatorType.ring, EasyLoadingIndicatorType.dualRing].
double lineWidth;

/// display duration of [showSuccess] [showError] [showInfo] [showToast], default 2000ms.
Duration displayDuration;

Expand Down Expand Up @@ -140,6 +143,7 @@ class EasyLoading {
radius = 5.0;
fontSize = 15.0;
progressWidth = 2.0;
lineWidth = 4.0;
displayDuration = const Duration(milliseconds: 2000);
textPadding = const EdgeInsets.only(bottom: 10.0);
contentPadding = const EdgeInsets.symmetric(
Expand Down
3 changes: 3 additions & 0 deletions lib/src/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class EasyLoadingTheme {
/// width of progress indicator
static double get progressWidth => EasyLoading.instance.progressWidth;

/// width of indicator
static double get lineWidth => EasyLoading.instance.lineWidth;

/// loading indicator type
static EasyLoadingIndicatorType get indicatorType =>
EasyLoading.instance.indicatorType;
Expand Down
3 changes: 3 additions & 0 deletions lib/src/widgets/indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class _LoadingIndicatorState extends State<LoadingIndicator> {
_indicator = SpinKitWave(
color: _indicatorColor,
size: _size,
itemCount: 6,
);
_width = _size * 1.25;
break;
Expand Down Expand Up @@ -132,6 +133,7 @@ class _LoadingIndicatorState extends State<LoadingIndicator> {
_indicator = SpinKitDualRing(
color: _indicatorColor,
size: _size,
lineWidth: EasyLoadingTheme.lineWidth,
);
break;
case EasyLoadingIndicatorType.hourGlass:
Expand All @@ -156,6 +158,7 @@ class _LoadingIndicatorState extends State<LoadingIndicator> {
_indicator = SpinKitRing(
color: _indicatorColor,
size: _size,
lineWidth: EasyLoadingTheme.lineWidth,
);
break;
case EasyLoadingIndicatorType.ripple:
Expand Down

0 comments on commit aa176a4

Please sign in to comment.