Revert "Fixing memory leak in EditableTextState" (#133804)
Reverts flutter/flutter#131377 reverting because of internal google testing failures b/298310760
This commit is contained in:
parent
f32b6fed24
commit
acdcbae78a
@ -2125,7 +2125,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
|
|||||||
late final Simulation _iosBlinkCursorSimulation = _DiscreteKeyFrameSimulation.iOSBlinkingCaret();
|
late final Simulation _iosBlinkCursorSimulation = _DiscreteKeyFrameSimulation.iOSBlinkingCaret();
|
||||||
|
|
||||||
final ValueNotifier<bool> _cursorVisibilityNotifier = ValueNotifier<bool>(true);
|
final ValueNotifier<bool> _cursorVisibilityNotifier = ValueNotifier<bool>(true);
|
||||||
late final ValueNotifier<bool> _debugCursorNotifier;
|
|
||||||
final GlobalKey _editableKey = GlobalKey();
|
final GlobalKey _editableKey = GlobalKey();
|
||||||
|
|
||||||
/// Detects whether the clipboard can paste.
|
/// Detects whether the clipboard can paste.
|
||||||
@ -2793,7 +2792,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
|
|||||||
_scrollController.addListener(_onEditableScroll);
|
_scrollController.addListener(_onEditableScroll);
|
||||||
_cursorVisibilityNotifier.value = widget.showCursor;
|
_cursorVisibilityNotifier.value = widget.showCursor;
|
||||||
_spellCheckConfiguration = _inferSpellCheckConfiguration(widget.spellCheckConfiguration);
|
_spellCheckConfiguration = _inferSpellCheckConfiguration(widget.spellCheckConfiguration);
|
||||||
_debugCursorNotifier = ValueNotifier<bool>(widget.showCursor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Whether `TickerMode.of(context)` is true and animations (like blinking the
|
// Whether `TickerMode.of(context)` is true and animations (like blinking the
|
||||||
@ -2938,7 +2936,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_debugCursorNotifier.dispose();
|
|
||||||
_internalScrollController?.dispose();
|
_internalScrollController?.dispose();
|
||||||
_currentAutofillScope?.unregister(autofillId);
|
_currentAutofillScope?.unregister(autofillId);
|
||||||
widget.controller.removeListener(_didChangeTextEditingValue);
|
widget.controller.removeListener(_didChangeTextEditingValue);
|
||||||
@ -4860,7 +4857,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
|
|||||||
cursorColor: _cursorColor,
|
cursorColor: _cursorColor,
|
||||||
backgroundCursorColor: widget.backgroundCursorColor,
|
backgroundCursorColor: widget.backgroundCursorColor,
|
||||||
showCursor: EditableText.debugDeterministicCursor
|
showCursor: EditableText.debugDeterministicCursor
|
||||||
? _debugCursorNotifier
|
? ValueNotifier<bool>(widget.showCursor)
|
||||||
: _cursorVisibilityNotifier,
|
: _cursorVisibilityNotifier,
|
||||||
forceLine: widget.forceLine,
|
forceLine: widget.forceLine,
|
||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
|
@ -167,7 +167,18 @@ void main() {
|
|||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
final RenderBox handle = tester.firstRenderObject<RenderBox>(find.byType(CustomPaint));
|
final RenderBox handle = tester.firstRenderObject<RenderBox>(find.byType(CustomPaint));
|
||||||
expect(handle, paints..path(color: defaultSelectionHandleColor));
|
expect(handle, paints..path(color: defaultSelectionHandleColor));
|
||||||
});
|
},
|
||||||
|
// TODO(polina-c): remove after fixing
|
||||||
|
// https://github.com/flutter/flutter/issues/130469
|
||||||
|
leakTrackingTestConfig: const LeakTrackingTestConfig(
|
||||||
|
notDisposedAllowList: <String, int?>{
|
||||||
|
'ValueNotifier<MagnifierInfo>': 1,
|
||||||
|
'ValueNotifier<_OverlayEntryWidgetState?>': 2,
|
||||||
|
'ValueNotifier<bool>': 2,
|
||||||
|
'_InputBorderGap': 1,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
testWidgets('ThemeData.textSelectionTheme will be used if provided', (WidgetTester tester) async {
|
testWidgets('ThemeData.textSelectionTheme will be used if provided', (WidgetTester tester) async {
|
||||||
const TextSelectionThemeData textSelectionTheme = TextSelectionThemeData(
|
const TextSelectionThemeData textSelectionTheme = TextSelectionThemeData(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user