New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
showDatePicker A RenderFlex overflowed by 5.0 pixels on the bottom #20171
Comments
Getting the same issue with Iphone 4s and pt-PT locale set for DatePicker. |
@IsaNascimento There is a temporary solution. You can modify the flutter file "date_picker.dart" by wrapping _DatePickerDialog with "SingleChildScrollView" Widget child = SingleChildScrollView(
child: _DatePickerDialog(
initialDate: initialDate,
firstDate: firstDate,
lastDate: lastDate,
selectableDayPredicate: selectableDayPredicate,
initialDatePickerMode: initialDatePickerMode,
)
); Side effect: scrolling blue effect is active( haven't figured out how to turn it off ) & once you will try running 'Flutter Upgrade' the file will be overwritten. |
thanks zoechi! |
if the MediaData textScaleFactor is bigger than 1.0, then the datepicker will overflower |
@nokia6290 Hi, friend, your solution still not works in my app, but I have found another way to fix this, final TextStyle dayStyle = headerTextTheme.display1.copyWith(color: dayColor, height: 1.3); |
Can workaround by updating line 37 of date_picker.dart as follows: Line 37: change '2' to '1' Original: Edited: |
I've added the accessibility tag to this because I believe it's being caused when the font used to render the header is larger than expected - such as when a user has text scaling turned on. Can anyone confirm whether this happens to them if they set text scaling to 1.0? |
A "simple" fix for this might just be to multiple the constant used for the height by the textscalefactor, but I suspect that could get ugly quickly :( |
material/date_picker.dart change the line 48 to |
The problem is that constant will be wrong for some value of text scaling. We need the values to be aware of the text scale factor. |
Is it really possible that flutter team didn't fix this bug? I mean, in a lot of application we need some sort of date picker. And for 1 whole year we are discussing how to modify core files ? |
I have fixed problem currently by adding new theme for showDatePicker http://prntscr.com/n0x31p in builder part. But as I said, I think that this is very important to have in most of applications and should be fixed ASAP |
My tests locally show that just multiplying the constant by the textScaleFactor works. I've uploaded a patch for that with a test at the linked PR. |
Spoke too soon - this doesn't work for large values of text scale. @willlarche - can you or someone from the material team provide some guidance here about making this widget accessible? |
Stand by. |
Still waiting on guidance but it's coming. |
/cc @DarrenGoog who I believe is working on date picker layout things. |
Fixed with #31514 |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
Logs
The text was updated successfully, but these errors were encountered: