Open AhmedAbogameel opened 8 months ago
@serenader2014 Please check this
Also faced issue Null check operator used on a null value is there a solution for this problem?
Declare final at the top and use it outside of the rendered widget
final CarouselController carouselController = CarouselController(); <- here
class CarouselDemo extends StatelessWidget {
/// CarouselController carouselController = CarouselController(); <- not here
@override
Widget build(BuildContext context) => Column(
children: <Widget>[
CarouselSlider(
items: child,
carouselController: carouselController,
options: CarouselOptions(
autoPlay: false,
enlargeCenterPage: true,
viewportFraction: 0.9,
aspectRatio: 2.0,
initialPage: 2,
),
),
RaisedButton(
onPressed: () => carouselController.nextPage(
duration: Duration(milliseconds: 300), curve: Curves.linear),
child: Text('→'),
)
]
);
}
We faced this bug in our release
so i handled it by replacing all null check operator inside nextPage and previousPage functions with null aware operator