diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart index ada90e8e0b..365bc06102 100644 --- a/packages/flutter/lib/src/widgets/editable_text.dart +++ b/packages/flutter/lib/src/widgets/editable_text.dart @@ -399,6 +399,12 @@ class EditableText extends StatefulWidget { /// Defaults to EdgeInserts.all(20.0). final EdgeInsets scrollPadding; + /// Setting this property to true makes the cursor stop blinking and stay visible on the screen continually. + /// This property is most useful for testing purposes. + /// + /// Defaults to false, resulting in a typical blinking cursor. + static bool debugDeterministicCursor = false; + @override EditableTextState createState() => new EditableTextState(); @@ -881,7 +887,7 @@ class EditableTextState extends State with AutomaticKeepAliveClien textSpan: buildTextSpan(), value: _value, cursorColor: widget.cursorColor, - showCursor: _showCursor, + showCursor: EditableText.debugDeterministicCursor ? ValueNotifier(true) : _showCursor, hasFocus: _hasFocus, maxLines: widget.maxLines, selectionColor: widget.selectionColor, @@ -1030,4 +1036,4 @@ class _Editable extends LeafRenderObjectWidget { ..cursorWidth = cursorWidth ..cursorRadius = cursorRadius; } -} +} \ No newline at end of file