Increase TimePicker touch targets#32053
Merged
darrenaustin merged 2 commits intoflutter:masterfrom May 6, 2019
darrenaustin:time_picker_touch_targets
Merged
Increase TimePicker touch targets#32053darrenaustin merged 2 commits intoflutter:masterfrom darrenaustin:time_picker_touch_targets
darrenaustin merged 2 commits intoflutter:masterfrom
darrenaustin:time_picker_touch_targets
Conversation
- Increased the AM/PM, minute and hour buttons to at least 48x48 - Added InkWells to all of them - Adjusted the landscape layout for the AM/PM buttons to be horizontal - Added a test to ensure the regions are at least 48x48
HansMuller
approved these changes
May 4, 2019
| class _DayPeriodControl extends StatelessWidget { | ||
| const _DayPeriodControl({ | ||
| @required this.fragmentContext, | ||
| @required this.orientation, |
Contributor
There was a problem hiding this comment.
Looks like these values are assumed to be non-null; should assert that here
| child: Material( | ||
| type: MaterialType.transparency, | ||
| child: InkWell( | ||
| onTap: Feedback.wrapForTap(() => _setAm(context), context), |
Contributor
There was a problem hiding this comment.
The => is usually reserved for one-liners that return a value. This is OK:
Feedback.wrapForTap(() { _setAm(context); }, context),
Here and below
| _TimePickerHeaderFormat _buildHeaderFormat( | ||
| TimeOfDayFormat timeOfDayFormat, | ||
| _TimePickerFragmentContext context, | ||
| Orientation orientation |
| }); | ||
|
|
||
| testWidgets('header touch regions are large enough', (WidgetTester tester) async { | ||
| await mediaQueryBoilerplate(tester, false); |
Contributor
There was a problem hiding this comment.
Someday we should give this function a more meaningful name.
9 tasks
15 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR increases the remaining touch target sizes in the Material Time Picker that weren't handled in #19936. The AM/PM, minute and hour buttons have all be increased to at least 48x48dp. In addition I have added an InkWell to each of them for better user feedback.
Examples of the new layouts:

Related #Issues
Fixes: #18130
Tests
I added a test to ensure the size of all the header touch targets are at least 48x48.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?