diff --git a/lib/widgets/general/carousel.dart b/lib/widgets/general/carousel.dart index 55f8a2f..b07f843 100644 --- a/lib/widgets/general/carousel.dart +++ b/lib/widgets/general/carousel.dart @@ -44,7 +44,7 @@ class CarouselState extends State { duration: widget.animationDuration, curve: Curves.linear); if (!reverse) { _currentPage += 1; - if (_currentPage == widget.pages.length) { + if (_currentPage == widget.pages!.length) { _currentPage -= 1; reverse = true; } @@ -77,7 +77,7 @@ class CarouselState extends State { color: Style.backgroundColor, child: new PageView( controller: _pageController, - children: widget.pages, + children: widget.pages!, onPageChanged: (index) { _currentPage = index; _indicatorStateKey.currentState!.changeIndex(index); @@ -91,7 +91,7 @@ class CarouselState extends State { child: new Align( child: new Indicator( key: _indicatorStateKey, - count: widget.pages.length, + count: widget.pages!.length, ), alignment: Alignment.center, ), @@ -124,7 +124,7 @@ class IndicatorState extends State { @override Widget build(BuildContext context) { var indicators = []; - for (var i = 0; i < widget.count; ++i) { + for (var i = 0; i < widget.count!; ++i) { indicators.add(new Container( width: 5.0, height: 5.0, @@ -135,7 +135,7 @@ class IndicatorState extends State { )); } return new SizedBox( - width: widget.count * 15.0, + width: widget.count! * 15.0, height: 30.0, child: new Row( children: indicators, diff --git a/lib/widgets/mobile/shop.dart b/lib/widgets/mobile/shop.dart index c629a2a..da4f77a 100644 --- a/lib/widgets/mobile/shop.dart +++ b/lib/widgets/mobile/shop.dart @@ -1324,13 +1324,13 @@ class ShopState extends State onNotification: (ScrollUpdateNotification notification) { if (!displayProductByCategoryClick) { if (_categoryIndexChange) { - return; + return false; } int index = _getCategoryIndexByRightScrollHeight( notification.metrics.pixels); _setCategoryByProductScrolledIndex(index); } - return; + return false; }, child: new ListView.builder( physics: ClampingScrollPhysics(),