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
5c17a37b
Unverified
Commit
5c17a37b
authored
Aug 25, 2023
by
Tomasz Gucio
Committed by
GitHub
Aug 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dispose overlay entries (#132826)
parent
901a392a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
16 deletions
+23
-16
overlay.0.dart
examples/api/lib/widgets/overlay/overlay.0.dart
+1
-0
context_menu.dart
packages/flutter/lib/src/cupertino/context_menu.dart
+2
-0
range_slider.dart
packages/flutter/lib/src/material/range_slider.dart
+6
-6
slider.dart
packages/flutter/lib/src/material/slider.dart
+6
-6
autocomplete.dart
packages/flutter/lib/src/widgets/autocomplete.dart
+2
-0
heroes.dart
packages/flutter/lib/src/widgets/heroes.dart
+1
-0
magnifier.dart
packages/flutter/lib/src/widgets/magnifier.dart
+4
-4
reorderable_list.dart
packages/flutter/lib/src/widgets/reorderable_list.dart
+1
-0
No files found.
examples/api/lib/widgets/overlay/overlay.0.dart
View file @
5c17a37b
...
...
@@ -138,6 +138,7 @@ class _OverlayExampleState extends State<OverlayExample> {
// Remove the OverlayEntry.
void
removeHighlightOverlay
()
{
overlayEntry
?.
remove
();
overlayEntry
?.
dispose
();
overlayEntry
=
null
;
}
...
...
packages/flutter/lib/src/cupertino/context_menu.dart
View file @
5c17a37b
...
...
@@ -572,6 +572,7 @@ class _CupertinoContextMenuState extends State<CupertinoContextMenu> with Ticker
});
}
_lastOverlayEntry
?.
remove
();
_lastOverlayEntry
?.
dispose
();
_lastOverlayEntry
=
null
;
case
AnimationStatus
.
completed
:
...
...
@@ -585,6 +586,7 @@ class _CupertinoContextMenuState extends State<CupertinoContextMenu> with Ticker
// one frame.
SchedulerBinding
.
instance
.
addPostFrameCallback
((
Duration
_
)
{
_lastOverlayEntry
?.
remove
();
_lastOverlayEntry
?.
dispose
();
_lastOverlayEntry
=
null
;
_openController
.
reset
();
});
...
...
packages/flutter/lib/src/material/range_slider.dart
View file @
5c17a37b
...
...
@@ -484,10 +484,9 @@ class _RangeSliderState extends State<RangeSlider> with TickerProviderStateMixin
enableController
.
dispose
();
startPositionController
.
dispose
();
endPositionController
.
dispose
();
if
(
overlayEntry
!=
null
)
{
overlayEntry
!.
remov
e
();
overlayEntry
?.
remove
();
overlayEntry
?.
dispos
e
();
overlayEntry
=
null
;
}
super
.
dispose
();
}
...
...
@@ -842,8 +841,9 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix
parent:
_state
.
valueIndicatorController
,
curve:
Curves
.
fastOutSlowIn
,
)..
addStatusListener
((
AnimationStatus
status
)
{
if
(
status
==
AnimationStatus
.
dismissed
&&
_state
.
overlayEntry
!=
null
)
{
_state
.
overlayEntry
!.
remove
();
if
(
status
==
AnimationStatus
.
dismissed
)
{
_state
.
overlayEntry
?.
remove
();
_state
.
overlayEntry
?.
dispose
();
_state
.
overlayEntry
=
null
;
}
});
...
...
packages/flutter/lib/src/material/slider.dart
View file @
5c17a37b
...
...
@@ -654,10 +654,9 @@ class _SliderState extends State<Slider> with TickerProviderStateMixin {
valueIndicatorController
.
dispose
();
enableController
.
dispose
();
positionController
.
dispose
();
if
(
overlayEntry
!=
null
)
{
overlayEntry
!.
remov
e
();
overlayEntry
?.
remove
();
overlayEntry
?.
dispos
e
();
overlayEntry
=
null
;
}
_focusNode
?.
dispose
();
super
.
dispose
();
}
...
...
@@ -1116,8 +1115,9 @@ class _RenderSlider extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
parent:
_state
.
valueIndicatorController
,
curve:
Curves
.
fastOutSlowIn
,
)..
addStatusListener
((
AnimationStatus
status
)
{
if
(
status
==
AnimationStatus
.
dismissed
&&
_state
.
overlayEntry
!=
null
)
{
_state
.
overlayEntry
!.
remove
();
if
(
status
==
AnimationStatus
.
dismissed
)
{
_state
.
overlayEntry
?.
remove
();
_state
.
overlayEntry
?.
dispose
();
_state
.
overlayEntry
=
null
;
}
});
...
...
packages/flutter/lib/src/widgets/autocomplete.dart
View file @
5c17a37b
...
...
@@ -446,6 +446,7 @@ class _RawAutocompleteState<T extends Object> extends State<RawAutocomplete<T>>
}
_floatingOptions
?.
remove
();
_floatingOptions
?.
dispose
();
if
(
_shouldShowOptions
)
{
final
OverlayEntry
newFloatingOptions
=
OverlayEntry
(
builder:
(
BuildContext
context
)
{
...
...
@@ -562,6 +563,7 @@ class _RawAutocompleteState<T extends Object> extends State<RawAutocomplete<T>>
_focusNode
.
dispose
();
}
_floatingOptions
?.
remove
();
_floatingOptions
?.
dispose
();
_floatingOptions
=
null
;
super
.
dispose
();
}
...
...
packages/flutter/lib/src/widgets/heroes.dart
View file @
5c17a37b
...
...
@@ -568,6 +568,7 @@ class _HeroFlight {
assert
(
overlayEntry
!=
null
);
overlayEntry
!.
remove
();
overlayEntry
!.
dispose
();
overlayEntry
=
null
;
// We want to keep the hero underneath the current page hidden. If
// [AnimationStatus.completed], toHero will be the one on top and we keep
...
...
packages/flutter/lib/src/widgets/magnifier.dart
View file @
5c17a37b
...
...
@@ -242,9 +242,8 @@ class MagnifierController {
Widget
?
debugRequiredFor
,
OverlayEntry
?
below
,
})
async
{
if
(
overlayEntry
!=
null
)
{
overlayEntry
!.
remove
();
}
_overlayEntry
?.
remove
();
_overlayEntry
?.
dispose
();
final
OverlayState
overlayState
=
Overlay
.
of
(
context
,
...
...
@@ -307,6 +306,7 @@ class MagnifierController {
@visibleForTesting
void
removeFromOverlay
()
{
_overlayEntry
?.
remove
();
_overlayEntry
?.
dispose
();
_overlayEntry
=
null
;
}
...
...
packages/flutter/lib/src/widgets/reorderable_list.dart
View file @
5c17a37b
...
...
@@ -832,6 +832,7 @@ class SliverReorderableListState extends State<SliverReorderableList> with Ticke
_recognizer
?.
dispose
();
_recognizer
=
null
;
_overlayEntry
?.
remove
();
_overlayEntry
?.
dispose
();
_overlayEntry
=
null
;
_finalDropPosition
=
null
;
}
...
...
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