Skip to content

Commit ad9da4d

Browse files
committed
Fix containerWidth calculation
1 parent ef4a358 commit ad9da4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/flutter_xlider.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class _FlutterSliderState extends State<FlutterSlider>
273273
}
274274
__containerSizeWithoutPadding = _containerHeightWithoutPadding;
275275
_containerWidth =
276-
[(sliderProperSize! * 2), layoutWidth].reduce(max);
276+
[(sliderProperSize! * 2), layoutWidth].reduce(min);
277277
_containerHeight = constraints.maxHeight;
278278
} else {
279279
double layoutHeight = constraints.maxHeight;
@@ -282,7 +282,7 @@ class _FlutterSliderState extends State<FlutterSlider>
282282
}
283283
_containerWidth = constraints.maxWidth;
284284
_containerHeight =
285-
[(sliderProperSize! * 2), layoutHeight].reduce(max);
285+
[(sliderProperSize! * 2), layoutHeight].reduce(min);
286286
__containerSizeWithoutPadding = _containerWidthWithoutPadding;
287287
}
288288

0 commit comments

Comments
 (0)