Skip to content

Commit

Permalink
fix: divide 0 error when archType is not null (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
motionz-von committed Aug 4, 2023
1 parent c1c5ddb commit 5ed18db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/circular_percent_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ class _CircularPercentIndicatorState extends State<CircularPercentIndicator>
double getCurrentPercent(double percent) {
if (widget.arcType != null) {
final angle = _getStartAngleFixedMargin(widget.arcType!).fixedStartAngle;
final fixedPercent = 1.0 / widget.percent * _percent;
final fixedPercent =
widget.percent > 0 ? 1.0 / widget.percent * _percent : 0;
late double margin;
if (widget.arcType == ArcType.HALF) {
margin = 180 * widget.percent;
Expand Down

0 comments on commit 5ed18db

Please sign in to comment.