Closed stormenergy91 closed 1 year ago
Hi @stormenergy91,
Thank you for using this package.
I will look into this issue and will fix it in the next update.
Thanks again for raising the issue.
Thanks @nixrajput, is a great plugin. If you need more info or some testing I'm here!
Hi @stormenergy91,
Can you please share some code snippets for testing the changes you want in the package?
@nixrajput as you can see in this image, on the left there is the actual result, on the right what I want to have:
Here the code that I have used:
ListView(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
...
FutureBuilder(
future: items,
builder: (context, AsyncSnapshot snapshot) {
List<CustomhView> itemsList = [];
if (snapshot.connectionState == ConnectionState.waiting) {
return Container(
height: 200,
child: Center(
child: CircularProgressIndicator(),
),
);
} else {
if (snapshot.hasError) {
return const Text("Network Error");
} else {
if (snapshot.data.length == 0) {
return const Text("No Items");
} else {
for (var i = 0; i < snapshot.data.length; i++) {
itemsList.add(CustomView(snapshot.data[i]));
}
return FlutterCarousel(
items: itemsList,
options: CarouselOptions(
viewportFraction: 0.70,
height: 280.0,
showIndicator: false,
pageSnapping: false,
disableCenter: true,
enableInfiniteScroll: false,
slideIndicator: CircularSlideIndicator(),
),
);
}
}
}
}),
...
],
),
],
)
The property disableCenter
what is used for?
Hi @stormenergy91,
I checked and tested the code and I found that no additional change requires in the code for this issue.
In your case, you can use padEnds
property to false
.
CarouselOptions(
viewportFraction: 0.70,
height: 280.0,
showIndicator: false,
padEnds: false,
enableInfiniteScroll: false,
slideIndicator: CircularSlideIndicator(),
),
Thanks
Thanks so much! :)
The plugin is forcing a center widget in each of its elements, constraining the application of this plugin.
E.g If i want the carousel to have the image at left of the screen it would be almost impossible because of this Center widget without using some obscure hacky stuff ;)
There is some way to don't force this behavior in the carousel?
I want to have this effect
Edit: I tried to use the
disableCenter: true
option but it doesn't work.