phase3: shop.dart NotificationListener return bool

This commit is contained in:
2026-07-31 14:54:32 +08:00
parent 6487c0db54
commit 70076d71c1
2 changed files with 7 additions and 7 deletions

View File

@@ -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,