File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/flutter/lib/src/widgets Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,12 @@ class EditableText extends StatefulWidget {
399
399
/// Defaults to EdgeInserts.all(20.0).
400
400
final EdgeInsets scrollPadding;
401
401
402
+ /// Setting this property to true makes the cursor stop blinking and stay visible on the screen continually.
403
+ /// This property is most useful for testing purposes.
404
+ ///
405
+ /// Defaults to false, resulting in a typical blinking cursor.
406
+ static bool debugDeterministicCursor = false ;
407
+
402
408
@override
403
409
EditableTextState createState () => new EditableTextState ();
404
410
@@ -881,7 +887,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
881
887
textSpan: buildTextSpan (),
882
888
value: _value,
883
889
cursorColor: widget.cursorColor,
884
- showCursor: _showCursor,
890
+ showCursor: EditableText .debugDeterministicCursor ? ValueNotifier < bool >( true ) : _showCursor,
885
891
hasFocus: _hasFocus,
886
892
maxLines: widget.maxLines,
887
893
selectionColor: widget.selectionColor,
@@ -1030,4 +1036,4 @@ class _Editable extends LeafRenderObjectWidget {
1030
1036
..cursorWidth = cursorWidth
1031
1037
..cursorRadius = cursorRadius;
1032
1038
}
1033
- }
1039
+ }
You can’t perform that action at this time.
0 commit comments