Open delizondo opened 1 year ago
hi @delizondo thanks for raise this issue. do you mind if you create MR for this fix? since you already have the solution and the code. will be very happy if we can collaborate. i'll test in my local as well. thank you
I've implemented this Time Picker widget in my project, and works fine, however, the
ModalBottomSheet
height is not correctly calculated. Tested in a large screen device, and it takes half the screen, and it just doesn't look good, also, if you flip the device to portrait mode, theModalBottomSheet
has a pixel overflow.I took to liberty of making a few changes which fixes this problem. In the
TimePickerSheet
class, instead of using half the screen height in theSizedBox
, I used aLayoutBuilder
to obtain the widget height in the screen, asMediaQuery
returns the height of the screen no matter the orientation. And inside theLayoutBuilder
I used anOrientationBuilder
to get the current screen orientation, and from there, calculate the correctBottomSheet
height.Complete code here:
And to use it: