flutter_carousel_slider
flutter_carousel_slider copied to clipboard
The itemBuilder Runs when itemCount is zero
The itemBuilder
Runs when itemCount
is zero
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: SafeArea(
child: Scaffold(
body: CarouselSlider.builder(
itemCount: 0,
itemBuilder:
(BuildContext context, int sliderIndex, int realIndex) {
return Center(
child: Container(
child: Text('Why ??'),
),
);
},
options: CarouselOptions(),
),
),
),
);
}
}
It is due to the code found in this file https://github.com/serenader2014/flutter_carousel_slider/blob/master/lib/carousel_slider.dart is what I think.
I don't know you could try setting the value to -1, maybe it could solve, I am not sure.