Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
161c7090
Unverified
Commit
161c7090
authored
Sep 08, 2023
by
Polina Cherkasova
Committed by
GitHub
Sep 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EditableTextState should dispose cursorVisibilityNotifier. (#133858)
parent
0d30546c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+2
-8
No files found.
packages/flutter/lib/src/widgets/editable_text.dart
View file @
161c7090
...
...
@@ -2125,7 +2125,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
late
final
Simulation
_iosBlinkCursorSimulation
=
_DiscreteKeyFrameSimulation
.
iOSBlinkingCaret
();
final
ValueNotifier
<
bool
>
_cursorVisibilityNotifier
=
ValueNotifier
<
bool
>(
true
);
final
ValueNotifier
<
bool
>
_debugCursorNotifier
=
ValueNotifier
<
bool
>(
true
);
final
GlobalKey
_editableKey
=
GlobalKey
();
/// Detects whether the clipboard can paste.
...
...
@@ -2803,8 +2802,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
void
didChangeDependencies
()
{
super
.
didChangeDependencies
();
_debugCursorNotifier
.
value
=
widget
.
showCursor
;
_style
=
MediaQuery
.
boldTextOf
(
context
)
?
widget
.
style
.
merge
(
const
TextStyle
(
fontWeight:
FontWeight
.
bold
))
:
widget
.
style
;
...
...
@@ -2959,7 +2956,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
clipboardStatus
.
removeListener
(
_onChangedClipboardStatus
);
clipboardStatus
.
dispose
();
_cursorVisibilityNotifier
.
dispose
();
_debugCursorNotifier
.
dispose
();
FocusManager
.
instance
.
removeListener
(
_unflagInternalFocus
);
super
.
dispose
();
assert
(
_batchEditDepth
<=
0
,
'unfinished batch edits:
$_batchEditDepth
'
);
...
...
@@ -3879,7 +3875,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
void
_onCursorColorTick
()
{
final
double
effectiveOpacity
=
math
.
min
(
widget
.
cursorColor
.
alpha
/
255.0
,
_cursorBlinkOpacityController
.
value
);
renderEditable
.
cursorColor
=
widget
.
cursorColor
.
withOpacity
(
effectiveOpacity
);
_cursorVisibilityNotifier
.
value
=
widget
.
showCursor
&&
_cursorBlinkOpacityController
.
value
>
0
;
_cursorVisibilityNotifier
.
value
=
widget
.
showCursor
&&
(
EditableText
.
debugDeterministicCursor
||
_cursorBlinkOpacityController
.
value
>
0
)
;
}
bool
get
_showBlinkingCursor
=>
_hasFocus
&&
_value
.
selection
.
isCollapsed
&&
widget
.
showCursor
&&
_tickersEnabled
;
...
...
@@ -4860,9 +4856,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
value:
_value
,
cursorColor:
_cursorColor
,
backgroundCursorColor:
widget
.
backgroundCursorColor
,
showCursor:
EditableText
.
debugDeterministicCursor
?
_debugCursorNotifier
:
_cursorVisibilityNotifier
,
showCursor:
_cursorVisibilityNotifier
,
forceLine:
widget
.
forceLine
,
readOnly:
widget
.
readOnly
,
hasFocus:
_hasFocus
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment