There was an error while loading. Please reload this page.
1 parent b67cf00 commit fc00ea5Copy full SHA for fc00ea5
lib/carousel_slider.dart
@@ -235,10 +235,11 @@ class CarouselSliderState extends State<CarouselSlider>
235
}
236
if (widget.options.enlargeStrategy == CenterPageEnlargeStrategy.zoom) {
237
late Alignment alignment;
238
+ final bool horizontal = options.scrollDirection == Axis.horizontal;
239
if (itemOffset > 0) {
- alignment = Alignment.centerRight;
240
+ alignment = horizontal? Alignment.centerRight : Alignment.bottomCenter;
241
} else {
- alignment = Alignment.centerLeft;
242
+ alignment = horizontal? Alignment.centerLeft : Alignment.topCenter;
243
244
return Transform.scale(child: child, scale: scale, alignment: alignment);
245
0 commit comments