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
7625c10f
Unverified
Commit
7625c10f
authored
Sep 05, 2023
by
Polina Cherkasova
Committed by
GitHub
Sep 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
_MaterialAppState should dispose MaterialHeroController. (#133951)
parent
af1b7494
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
61 deletions
+93
-61
app.dart
packages/flutter/lib/src/material/app.dart
+6
-0
heroes.dart
packages/flutter/lib/src/widgets/heroes.dart
+21
-0
snack_bar_test.dart
packages/flutter/test/material/snack_bar_test.dart
+4
-1
stepper_test.dart
packages/flutter/test/material/stepper_test.dart
+61
-59
switch_list_tile_test.dart
packages/flutter/test/material/switch_list_tile_test.dart
+1
-1
No files found.
packages/flutter/lib/src/material/app.dart
View file @
7625c10f
...
...
@@ -880,6 +880,12 @@ class _MaterialAppState extends State<MaterialApp> {
_heroController
=
MaterialApp
.
createMaterialHeroController
();
}
@override
void
dispose
()
{
_heroController
.
dispose
();
super
.
dispose
();
}
// Combine the Localizations for Material with the ones contributed
// by the localizationsDelegates parameter, if any. Only the first delegate
// of a particular LocalizationsDelegate.type is loaded so the
...
...
packages/flutter/lib/src/widgets/heroes.dart
View file @
7625c10f
...
...
@@ -612,6 +612,19 @@ class _HeroFlight {
navigator
.
userGestureInProgressNotifier
.
addListener
(
delayedPerformAnimationUpdate
);
}
/// Releases resources.
@mustCallSuper
void
dispose
()
{
if
(
overlayEntry
!=
null
)
{
overlayEntry
!.
remove
();
overlayEntry
!.
dispose
();
overlayEntry
=
null
;
_proxyAnimation
.
parent
=
null
;
_proxyAnimation
.
removeListener
(
onTick
);
_proxyAnimation
.
removeStatusListener
(
_handleAnimationUpdate
);
}
}
void
onTick
()
{
final
RenderBox
?
toHeroBox
=
(!
_aborted
&&
manifest
.
toHero
.
mounted
)
?
manifest
.
toHero
.
context
.
findRenderObject
()
as
RenderBox
?
...
...
@@ -1027,6 +1040,14 @@ class HeroController extends NavigatorObserver {
},
);
}
/// Releases resources.
@mustCallSuper
void
dispose
()
{
for
(
final
_HeroFlight
flight
in
_flights
.
values
)
{
flight
.
dispose
();
}
}
}
/// Enables or disables [Hero]es in the widget subtree.
...
...
packages/flutter/test/material/snack_bar_test.dart
View file @
7625c10f
...
...
@@ -14,6 +14,7 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
testWidgets
(
'SnackBar control test'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -2542,7 +2543,9 @@ void main() {
expect
(
find
.
text
(
secondHeader
),
findsOneWidget
);
});
testWidgets
(
'Should have only one SnackBar during back swipe navigation'
,
(
WidgetTester
tester
)
async
{
testWidgetsWithLeakTracking
(
'Should have only one SnackBar during back swipe navigation'
,
leakTrackingTestConfig:
LeakTrackingTestConfig
.
debugNotDisposed
(),
(
WidgetTester
tester
)
async
{
const
String
snackBarText
=
'hello snackbar'
;
const
Key
snackTarget
=
Key
(
'snack-target'
);
const
Key
transitionTarget
=
Key
(
'transition-target'
);
...
...
packages/flutter/test/material/stepper_test.dart
View file @
7625c10f
This diff is collapsed.
Click to expand it.
packages/flutter/test/material/switch_list_tile_test.dart
View file @
7625c10f
...
...
@@ -865,7 +865,7 @@ void main() {
);
});
testWidgets
(
'Material3 - SwitchListTile respects thumbColor in hovered/pressed states'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Material3 - SwitchListTile respects thumbColor in hovered/pressed states'
,
(
WidgetTester
tester
)
async
{
tester
.
binding
.
focusManager
.
highlightStrategy
=
FocusHighlightStrategy
.
alwaysTraditional
;
const
Color
hoveredThumbColor
=
Color
(
0xFF4caf50
);
const
Color
pressedThumbColor
=
Color
(
0xFFF44336
);
...
...
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