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
Hide 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> {
...
@@ -138,6 +138,7 @@ class _OverlayExampleState extends State<OverlayExample> {
// Remove the OverlayEntry.
// Remove the OverlayEntry.
void
removeHighlightOverlay
()
{
void
removeHighlightOverlay
()
{
overlayEntry
?.
remove
();
overlayEntry
?.
remove
();
overlayEntry
?.
dispose
();
overlayEntry
=
null
;
overlayEntry
=
null
;
}
}
...
...
packages/flutter/lib/src/cupertino/context_menu.dart
View file @
5c17a37b
...
@@ -572,6 +572,7 @@ class _CupertinoContextMenuState extends State<CupertinoContextMenu> with Ticker
...
@@ -572,6 +572,7 @@ class _CupertinoContextMenuState extends State<CupertinoContextMenu> with Ticker
});
});
}
}
_lastOverlayEntry
?.
remove
();
_lastOverlayEntry
?.
remove
();
_lastOverlayEntry
?.
dispose
();
_lastOverlayEntry
=
null
;
_lastOverlayEntry
=
null
;
case
AnimationStatus
.
completed
:
case
AnimationStatus
.
completed
:
...
@@ -585,6 +586,7 @@ class _CupertinoContextMenuState extends State<CupertinoContextMenu> with Ticker
...
@@ -585,6 +586,7 @@ class _CupertinoContextMenuState extends State<CupertinoContextMenu> with Ticker
// one frame.
// one frame.
SchedulerBinding
.
instance
.
addPostFrameCallback
((
Duration
_
)
{
SchedulerBinding
.
instance
.
addPostFrameCallback
((
Duration
_
)
{
_lastOverlayEntry
?.
remove
();
_lastOverlayEntry
?.
remove
();
_lastOverlayEntry
?.
dispose
();
_lastOverlayEntry
=
null
;
_lastOverlayEntry
=
null
;
_openController
.
reset
();
_openController
.
reset
();
});
});
...
...
packages/flutter/lib/src/material/range_slider.dart
View file @
5c17a37b
...
@@ -484,10 +484,9 @@ class _RangeSliderState extends State<RangeSlider> with TickerProviderStateMixin
...
@@ -484,10 +484,9 @@ class _RangeSliderState extends State<RangeSlider> with TickerProviderStateMixin
enableController
.
dispose
();
enableController
.
dispose
();
startPositionController
.
dispose
();
startPositionController
.
dispose
();
endPositionController
.
dispose
();
endPositionController
.
dispose
();
if
(
overlayEntry
!=
null
)
{
overlayEntry
?.
remove
();
overlayEntry
!.
remove
();
overlayEntry
?.
dispose
();
overlayEntry
=
null
;
overlayEntry
=
null
;
}
super
.
dispose
();
super
.
dispose
();
}
}
...
@@ -842,8 +841,9 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix
...
@@ -842,8 +841,9 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix
parent:
_state
.
valueIndicatorController
,
parent:
_state
.
valueIndicatorController
,
curve:
Curves
.
fastOutSlowIn
,
curve:
Curves
.
fastOutSlowIn
,
)..
addStatusListener
((
AnimationStatus
status
)
{
)..
addStatusListener
((
AnimationStatus
status
)
{
if
(
status
==
AnimationStatus
.
dismissed
&&
_state
.
overlayEntry
!=
null
)
{
if
(
status
==
AnimationStatus
.
dismissed
)
{
_state
.
overlayEntry
!.
remove
();
_state
.
overlayEntry
?.
remove
();
_state
.
overlayEntry
?.
dispose
();
_state
.
overlayEntry
=
null
;
_state
.
overlayEntry
=
null
;
}
}
});
});
...
...
packages/flutter/lib/src/material/slider.dart
View file @
5c17a37b
...
@@ -654,10 +654,9 @@ class _SliderState extends State<Slider> with TickerProviderStateMixin {
...
@@ -654,10 +654,9 @@ class _SliderState extends State<Slider> with TickerProviderStateMixin {
valueIndicatorController
.
dispose
();
valueIndicatorController
.
dispose
();
enableController
.
dispose
();
enableController
.
dispose
();
positionController
.
dispose
();
positionController
.
dispose
();
if
(
overlayEntry
!=
null
)
{
overlayEntry
?.
remove
();
overlayEntry
!.
remove
();
overlayEntry
?.
dispose
();
overlayEntry
=
null
;
overlayEntry
=
null
;
}
_focusNode
?.
dispose
();
_focusNode
?.
dispose
();
super
.
dispose
();
super
.
dispose
();
}
}
...
@@ -1116,8 +1115,9 @@ class _RenderSlider extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
...
@@ -1116,8 +1115,9 @@ class _RenderSlider extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
parent:
_state
.
valueIndicatorController
,
parent:
_state
.
valueIndicatorController
,
curve:
Curves
.
fastOutSlowIn
,
curve:
Curves
.
fastOutSlowIn
,
)..
addStatusListener
((
AnimationStatus
status
)
{
)..
addStatusListener
((
AnimationStatus
status
)
{
if
(
status
==
AnimationStatus
.
dismissed
&&
_state
.
overlayEntry
!=
null
)
{
if
(
status
==
AnimationStatus
.
dismissed
)
{
_state
.
overlayEntry
!.
remove
();
_state
.
overlayEntry
?.
remove
();
_state
.
overlayEntry
?.
dispose
();
_state
.
overlayEntry
=
null
;
_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>>
...
@@ -446,6 +446,7 @@ class _RawAutocompleteState<T extends Object> extends State<RawAutocomplete<T>>
}
}
_floatingOptions
?.
remove
();
_floatingOptions
?.
remove
();
_floatingOptions
?.
dispose
();
if
(
_shouldShowOptions
)
{
if
(
_shouldShowOptions
)
{
final
OverlayEntry
newFloatingOptions
=
OverlayEntry
(
final
OverlayEntry
newFloatingOptions
=
OverlayEntry
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
...
@@ -562,6 +563,7 @@ class _RawAutocompleteState<T extends Object> extends State<RawAutocomplete<T>>
...
@@ -562,6 +563,7 @@ class _RawAutocompleteState<T extends Object> extends State<RawAutocomplete<T>>
_focusNode
.
dispose
();
_focusNode
.
dispose
();
}
}
_floatingOptions
?.
remove
();
_floatingOptions
?.
remove
();
_floatingOptions
?.
dispose
();
_floatingOptions
=
null
;
_floatingOptions
=
null
;
super
.
dispose
();
super
.
dispose
();
}
}
...
...
packages/flutter/lib/src/widgets/heroes.dart
View file @
5c17a37b
...
@@ -568,6 +568,7 @@ class _HeroFlight {
...
@@ -568,6 +568,7 @@ class _HeroFlight {
assert
(
overlayEntry
!=
null
);
assert
(
overlayEntry
!=
null
);
overlayEntry
!.
remove
();
overlayEntry
!.
remove
();
overlayEntry
!.
dispose
();
overlayEntry
=
null
;
overlayEntry
=
null
;
// We want to keep the hero underneath the current page hidden. If
// We want to keep the hero underneath the current page hidden. If
// [AnimationStatus.completed], toHero will be the one on top and we keep
// [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 {
...
@@ -242,9 +242,8 @@ class MagnifierController {
Widget
?
debugRequiredFor
,
Widget
?
debugRequiredFor
,
OverlayEntry
?
below
,
OverlayEntry
?
below
,
})
async
{
})
async
{
if
(
overlayEntry
!=
null
)
{
_overlayEntry
?.
remove
();
overlayEntry
!.
remove
();
_overlayEntry
?.
dispose
();
}
final
OverlayState
overlayState
=
Overlay
.
of
(
final
OverlayState
overlayState
=
Overlay
.
of
(
context
,
context
,
...
@@ -257,7 +256,7 @@ class MagnifierController {
...
@@ -257,7 +256,7 @@ class MagnifierController {
to:
Navigator
.
maybeOf
(
context
)?.
context
,
to:
Navigator
.
maybeOf
(
context
)?.
context
,
);
);
_overlayEntry
=
OverlayEntry
(
_overlayEntry
=
OverlayEntry
(
builder:
(
BuildContext
context
)
=>
capturedThemes
.
wrap
(
builder
(
context
)),
builder:
(
BuildContext
context
)
=>
capturedThemes
.
wrap
(
builder
(
context
)),
);
);
overlayState
.
insert
(
overlayEntry
!,
below:
below
);
overlayState
.
insert
(
overlayEntry
!,
below:
below
);
...
@@ -307,6 +306,7 @@ class MagnifierController {
...
@@ -307,6 +306,7 @@ class MagnifierController {
@visibleForTesting
@visibleForTesting
void
removeFromOverlay
()
{
void
removeFromOverlay
()
{
_overlayEntry
?.
remove
();
_overlayEntry
?.
remove
();
_overlayEntry
?.
dispose
();
_overlayEntry
=
null
;
_overlayEntry
=
null
;
}
}
...
...
packages/flutter/lib/src/widgets/reorderable_list.dart
View file @
5c17a37b
...
@@ -832,6 +832,7 @@ class SliverReorderableListState extends State<SliverReorderableList> with Ticke
...
@@ -832,6 +832,7 @@ class SliverReorderableListState extends State<SliverReorderableList> with Ticke
_recognizer
?.
dispose
();
_recognizer
?.
dispose
();
_recognizer
=
null
;
_recognizer
=
null
;
_overlayEntry
?.
remove
();
_overlayEntry
?.
remove
();
_overlayEntry
?.
dispose
();
_overlayEntry
=
null
;
_overlayEntry
=
null
;
_finalDropPosition
=
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