Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntegerDivisionByZeroException #225

Open
julianfrancodev opened this issue Sep 11, 2020 · 2 comments
Open

IntegerDivisionByZeroException #225

julianfrancodev opened this issue Sep 11, 2020 · 2 comments

Comments

@julianfrancodev
Copy link

Hello there i have this iusse

`The following IntegerDivisionByZeroException was thrown building AnimatedBuilder(animation:
AnimationController#46bc2(▶ 0.500; paused), dirty, state: _AnimatedState#4eba6):
IntegerDivisionByZeroException

The relevant error-causing widget was:
Swiper file:///home/julian/AndroidStudioProjects/flutter_03/lib/src/widgets/card_swiper_widget.dart:16:14
When the exception was thrown, this was the stack:
#0 int.% (dart:core-patch/integers.dart:34:7)
#1 _CustomLayoutStateBase._buildAnimation (package:flutter_swiper/src/custom_layout.dart:95:29)
#2 AnimatedBuilder.build (package:flutter/src/widgets/transitions.dart:1180:19)
#3 _AnimatedState.build (package:flutter/src/widgets/transitions.dart:179:48)
#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4663:28)
`

Using Swiper widget into my card_swiper_widget.dart widget

this is the swiper code

` Swiper(
itemBuilder: (BuildContext context, int index) {

      return ClipRRect(
          borderRadius: BorderRadius.circular(20),
          child: FadeInImage(
            placeholder: AssetImage('assets/images/jar-loading.gif'),
            image: NetworkImage(data[index].getPosterImg()),
            fit: BoxFit.cover,
          )
      );
    },
    itemCount: data.length,
    itemHeight: _screenSizen.height * 0.5,
    itemWidth: _screenSizen.width * 0.7,
    layout: SwiperLayout.STACK,

  ),`
@ExiaGo
Copy link

ExiaGo commented Apr 3, 2021

anyone can resolve this problem ?

@ExiaGo
Copy link

ExiaGo commented Apr 5, 2021

I think the problem is initialization, my resolvent is give the swiper one initialization item, if we do not need this default item, we can clear() before we get the data from service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants