serenader2014 / flutter_carousel_slider

A flutter carousel widget, support infinite scroll, and custom child widget.
https://pub.dev/packages/carousel_slider
MIT License
1.56k stars 530 forks source link

Unhandled Exception: NoSuchMethodError: The method 'round' was called on null. #131

Open zkmark opened 4 years ago

zkmark commented 4 years ago

Apparently the package runs on other pages even if you are not using it on these

E/flutter (14394): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'round' was called on null.
E/flutter (14394): Receiver: null
E/flutter (14394): Tried calling: round()

E/flutter (14394): #0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)
E/flutter (14394): #1      PageController.nextPage 
package:flutter/…/widgets/page_view.dart:227
E/flutter (14394): #2      CarouselSliderState.getTimer.<anonymous closure> 
package:carousel_slider/carousel_slider.dart:106
E/flutter (14394): #3      _rootRunUnary  (dart:async/zone.dart:1134:38)
E/flutter (14394): #4      _CustomZone.runUnary  (dart:async/zone.dart:1031:19)
E/flutter (14394): #5      _CustomZone.runUnaryGuarded  (dart:async/zone.dart:933:7)
E/flutter (14394): #6      _CustomZone.bindUnaryCallbackGuarded.<anonymous closure>  (dart:async/zone.dart:970:26)
E/flutter (14394): #7      _rootRunUnary  (dart:async/zone.dart:1138:13)
E/flutter (14394): #8      _CustomZone.runUnary  (dart:async/zone.dart:1031:19)
E/flutter (14394): #9      _CustomZone.bindUnaryCallback.<anonymous closure>  (dart:async/zone.dart:954:26)
E/flutter (14394): #10     _Timer._runTimers  (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (14394): #11     _Timer._handleMessage  (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (14394): #12     _RawReceivePortImpl._handleMessage  (dart:isolate-patch/isolate_patch.dart:168:12)

I'm just using it at home like this

CarouselSlider(
          options: CarouselOptions(
            autoPlay: true,
            aspectRatio: 2.3,
            //enlargeCenterPage: true,
            autoPlayInterval: Duration(seconds: 5),
          ),
          items: _listSliders(),
        ),
List<Widget> _listSliders() {
  List<Widget> list = [
    SliderCardSeeMore(
      pathImg: 'assets/img/cards/slider/slider_01.png',
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Text(
            'For all your \nsummer clothing \nneeds',
            style: TextStyle(
              color: Colors.white,
              fontSize: 20,
              fontWeight: FontWeight.w300
            ),
          ),
          Container(
            padding: EdgeInsets.only(top: 10),
            child: BtnTextIcon(
              width: 130,
              title: Text(
                'SEE MORE',
                style: TextStyle(
                  fontWeight: FontWeight.w400
                ),
              ),
              icon: Icon(
                Icons.keyboard_arrow_right,
                color: Colors.white,
              ),
              iconBg: Vars.colorPrimary,
              background: Colors.white,
            ),
          )
        ],
      ),
    ),
    SliderCardSeeMore(
      pathImg: 'assets/img/cards/slider/slider_02.png',
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Text(
            'For all your \nsummer clothing \nneeds',
            style: TextStyle(
              color: Colors.white,
              fontSize: 20,
              fontWeight: FontWeight.w300
            ),
          ),
          Container(
            padding: EdgeInsets.only(top: 10),
            child: BtnTextIcon(
              width: 130,
              title: Text(
                'SEE MORE',
                style: TextStyle(
                  fontWeight: FontWeight.w400
                ),
              ),
              icon: Icon(
                Icons.keyboard_arrow_right,
                color: Colors.white,
              ),
              iconBg: Vars.colorPrimary,
              background: Colors.white,
            ),
          )
        ],
      ),
    ),
  ];
  return list;
}

and every so often it shows the following error in the console: Unhandled Exception: NoSuchMethodError: The method 'round' was called on null.

saadmohmed commented 4 years ago

anyone solve this issuse

EinatK commented 4 years ago

@zkmark i have this same issue, did you find a solution ?

shakhzodkudratov commented 4 years ago

i have that too

mwawrusch commented 4 years ago

And add me to the list. Got this too.

jeffysmak commented 3 years ago

me toooooo ...

chubzchoc commented 3 years ago

me too..

couranos commented 3 years ago

September 2, 2020 this has not been solved

fathialamre commented 3 years ago

any new about above error ??

SachinTanpure commented 3 years ago

Any solution @zkmark ?

paloe commented 3 years ago

no solution?

kishan-dhankecha commented 1 month ago

@zkmark I think this issue should be resolved by now.

If anyone is still having this issue please open a new issue at carousel_slider_plus with reproducible steps and I will make sure it is fixed.