-
Notifications
You must be signed in to change notification settings - Fork 28.9k
EditableText Cursor can be set to not blink for testing #20004
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
Conversation
@@ -399,6 +399,15 @@ class EditableText extends StatefulWidget { | |||
/// Defaults to EdgeInserts.all(20.0). | |||
final EdgeInsets scrollPadding; | |||
|
|||
static bool get debugDeterministicCursor => _debugDeterministicCursor; |
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.
Can you please add a doc comment explaining this setting?
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.
Will do.
@@ -399,6 +399,15 @@ class EditableText extends StatefulWidget { | |||
/// Defaults to EdgeInserts.all(20.0). | |||
final EdgeInsets scrollPadding; | |||
|
|||
static bool get debugDeterministicCursor => _debugDeterministicCursor; | |||
static bool _debugDeterministicCursor = false; | |||
static set debugDeterministicCursor(bool value) { |
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.
Looks like this setter doesn't really do anything? Could we just use a regular property here?
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.
Done.
@@ -399,6 +399,8 @@ class EditableText extends StatefulWidget { | |||
/// Defaults to EdgeInserts.all(20.0). | |||
final EdgeInsets scrollPadding; | |||
|
|||
static bool debugDeterministicCursor = false; |
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.
Please add a comment here describing what it does and when it is used (only in tests).
Added documentation as requested.
LGTM (still) :-) |
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
@@ -1030,4 +1036,4 @@ class _Editable extends LeafRenderObjectWidget { | |||
..cursorWidth = cursorWidth | |||
..cursorRadius = cursorRadius; | |||
} | |||
} | |||
} |
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.
nit: leave the last newline
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 took it out because it causes the tests to fail.
* Revert "increase size of user account drawer headers to 48 by 48 (#20266)" This reverts commit 4a7b4a4. * Revert "EditableText Cursor can be set to not blink for testing (#20004)" This reverts commit d041b31. * Revert "Refactor analysis benchmark and collect more data (#20169)" This reverts commit 5ea0a13.
@@ -881,7 +887,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien | |||
textSpan: buildTextSpan(), | |||
value: _value, | |||
cursorColor: widget.cursorColor, | |||
showCursor: _showCursor, | |||
showCursor: EditableText.debugDeterministicCursor ? ValueNotifier<bool>(true) : _showCursor, |
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.
we should probably have a constant here rather than creating a new value notifier each frame
Addresses issue #14656. Adds static field to EditableText to enable developers to make the cursor continually appear on the screen (for testing purposes).