-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
fix: Update time picker dialog input size #163184
base: master
Are you sure you want to change the base?
Conversation
75b9ab3
to
f8f9805
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for making this PR. My main concern was accessibility, and the text being scaled up. But there are clamping on the text scaling and specifically in the input mode we have room to increase the height a little, so this should be fine. Due to box constraints, this only affects the max size and will not affect input dialogs that do not need the extra space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming Google tests pass 👍 . I didn't realized this height would be hardcoded but I guess so.
The material date pickers have hard coded maxes due to containing text scaling. The calendar view in particular has to watch out for a lot of text being scaled up and filling the screen. There's wiggle room with the input picker though, which has less text. |
I was wrong, Google testing is showing that the pickers are expanding when they don't need to. It doesn't look great. I'm not sure what the best solution is. |
I will see, what other solution I can come up with. |
0fe00c1
to
64796ee
Compare
@MitchellGoodwin Few solutions |
Making them scrollable is nice because it will avoid errors, but would lead to bad UI, in my opinion. We could do that as a last resort. Changing the dialog size dynamically would be preferable. For the input time picker there's a lot of room to grow. All the careful constraints are target towards the calendar date picker, which fills up much more space. I'd have to double check but I believe font size can only increase by 10%. When I looked at the code, dynamically increasing the size does seem difficult, however, with the expanded widgets involved. |
88ef8b0
to
7e8fd27
Compare
Yaa, I have converted |
padding: EdgeInsetsDirectional.only(start: theme.useMaterial3 ? 0 : 4), | ||
padding: EdgeInsetsDirectional.only( | ||
start: theme.useMaterial3 ? 0 : 4, | ||
top: (pickerTheme.padding ?? defaultTheme.padding).vertical / 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to add a gap between the inputs and the actions, right? Both deriving this spacing from the top padding and having it inflexible feels odd.
What if we added another Flexible widget to act as the spacing? Then it could shrink if needed, but the form section would have priority on space.
And if we used the uncompressed height as a derivative of the theme padding, we should call that out in the time picker theme documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding Flexible
for spacing will start taking entire allowed height and which is not what we want. I wanted spacing around actions symmertical. So, I will change documentation in picker theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a flexible spacing widget could be added if a sub Column
was added as well, setting the priority of how widgets grow.
Some of the checks are failing for overflow errors, so I imagine that since this space is static and cannot shrink it is lowering the amount of open space for the rest of the widgets.
842dc68
to
9845c9a
Compare
30868ed
to
1307b1e
Compare
fix: Update time picker dialog input size
Fixes: #162796
Pre-launch Checklist
///
).