Milad-Akarie / smooth_page_indicator

Flutter Smooth PageView indicators
MIT License
1.24k stars 147 forks source link

Unsupported operation: Infinity or NaN toInt #84

Open VadymPinchuk opened 4 months ago

VadymPinchuk commented 4 months ago
The following UnsupportedError was thrown during paint():
Unsupported operation: Infinity or NaN toInt

When the exception was thrown, this was the stack: 
#0      double.floor (dart:core-patch/double.dart)
#1      ScrollingDotsPainter.paint (package:smooth_page_indicator/src/painters/scrolling_dots_painter.dart:31:34)
#2      RenderCustomPaint._paintWithPainter (package:flutter/src/rendering/custom_paint.dart:588:13)
#3      RenderCustomPaint.paint (package:flutter/src/rendering/custom_paint.dart:630:7)
#4      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3239:7)
#5      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
#6      RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:130:13)
#7      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3239:7)
jay-mahakalagro commented 4 months ago

Facing Same Issue . Please help to resolve it

Milad-Akarie commented 4 months ago

@VadymPinchuk @jay-mahakalagro are you using AnimatedSmoothIndicator or SmoothPageIndicator?

mrjanees commented 3 months ago

Facing the Same Issue. I am using AnimatedSmoothIndicator. My Flutter version is 3.22.3 . Dart 3.4.4 and smooth_page_indicator: ^1.2.0. How to solve this issue?

mrjanees commented 3 months ago

Any solution?

VadymPinchuk commented 2 months ago
SmoothPageIndicator(
          controller: pageController,
          count: pageCount,
          effect: ScrollingDotsEffect(
            maxVisibleDots: 7,
            activeDotScale: 1.0,
            dotHeight: dimens.indicatorDotSize,
            dotWidth: dimens.indicatorDotSize,
            spacing: dimens.indicatorDotSize * 2,
            dotColor: theme.colors.baseLight30,
            activeDotColor: theme.colors.baseLightPrimary,
          ),
        )

this is my code. In regards of Flutter - I am on the main branch :) need it for work. But on 3.24 it was the same @Milad-Akarie can you check it out? Thanks

ProjectHousePC commented 2 months ago

Firebase crashlytics keep spamming this error yet....

passos commented 1 month ago

send a fix in pull request #87