Implement customizable cursor height#61714
Implement customizable cursor height#61714fluttergithubbot merged 8 commits intoflutter:masterfrom guidezpl:text-field-cursor-height
Conversation
|
Gold has detected about 4 untriaged digest(s) on patchset 6. |
justinmc
left a comment
There was a problem hiding this comment.
LGTM, just take a look at using pumpAndSettle as mentioned in a comment. Thanks for working on this!
| properties.add(FlagProperty('maxLengthEnforced', value: maxLengthEnforced, ifTrue: 'max length enforced')); | ||
| properties.add(DoubleProperty('cursorWidth', cursorWidth, defaultValue: 2.0)); | ||
| properties.add(DoubleProperty('cursorHeight', cursorHeight, defaultValue: null)); | ||
| properties.add(DiagnosticsProperty<Radius>('cursorRadius', cursorRadius, defaultValue: null)); |
There was a problem hiding this comment.
Good catch adding these missing properties!
| tester.state<EditableTextState>(textFinder).showToolbar(); | ||
| await tester.pump(); | ||
| await tester.pump(const Duration(milliseconds: 500)); | ||
| await tester.pump(const Duration(milliseconds: 500)); |
There was a problem hiding this comment.
You should be able to use a pumpAndSettle here and below instead of the multiple pumps and durations, if you haven't tried it already.
There was a problem hiding this comment.
I could only replace one, I think it has to do with the cursor blinking and the timing needing to be right
| await tester.tap(find.text('Paste')); | ||
| await tester.pump(); | ||
| await tester.pump(const Duration(milliseconds: 500)); | ||
| await tester.pump(const Duration(milliseconds: 500)); |
There was a problem hiding this comment.
Strange, is the pump without a duration needed as well? And what if you combine the two with durations into one with Duration(seconds: 1)?
There are other tests that do this sort of thing, though not testing the cursor size.
Anyway I think the main thing is to just make sure it's clear to someone else reading this code why the pumps are there, so maybe just add a comment.
There was a problem hiding this comment.
It wasn't, I simplified this test and others doing the same thing, and added a comment
Description
Cursor width can currently be customized. This PR adds the ability to customize cursor height for Cupertino and Material text fields (as well as
EditableTextandSelectableText).Related Issues
Closes #26870
#61715
Tests
I added the following tests:
debugFillPropertiesand plumbing testsChecklist
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
Did any tests fail when you ran them? Please read Handling breaking changes.