phase3: shop.dart NotificationListener return bool
This commit is contained in:
@@ -44,7 +44,7 @@ class CarouselState extends State<Carousel> {
|
||||
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<Carousel> {
|
||||
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<Carousel> {
|
||||
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<Indicator> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var indicators = <Widget>[];
|
||||
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<Indicator> {
|
||||
));
|
||||
}
|
||||
return new SizedBox(
|
||||
width: widget.count * 15.0,
|
||||
width: widget.count! * 15.0,
|
||||
height: 30.0,
|
||||
child: new Row(
|
||||
children: indicators,
|
||||
|
||||
@@ -1324,13 +1324,13 @@ class ShopState extends State<Shop>
|
||||
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(),
|
||||
|
||||
Reference in New Issue
Block a user