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
61a388a4
Unverified
Commit
61a388a4
authored
Sep 06, 2023
by
Polina Cherkasova
Committed by
GitHub
Sep 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix not disposed items in Cupertino app and route. (#134085)
parent
99f5cf07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
app.dart
packages/flutter/lib/src/cupertino/app.dart
+6
-0
route.dart
packages/flutter/lib/src/cupertino/route.dart
+6
-0
app_test.dart
packages/flutter/test/cupertino/app_test.dart
+9
-3
No files found.
packages/flutter/lib/src/cupertino/app.dart
View file @
61a388a4
...
...
@@ -506,6 +506,12 @@ class _CupertinoAppState extends State<CupertinoApp> {
_heroController
=
CupertinoApp
.
createCupertinoHeroController
();
}
@override
void
dispose
()
{
_heroController
.
dispose
();
super
.
dispose
();
}
// Combine the default localization for Cupertino 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/cupertino/route.dart
View file @
61a388a4
...
...
@@ -121,6 +121,12 @@ mixin CupertinoRouteTransitionMixin<T> on PageRoute<T> {
return
_previousTitle
!;
}
@override
void
dispose
()
{
_previousTitle
?.
dispose
();
super
.
dispose
();
}
@override
void
didChangePrevious
(
Route
<
dynamic
>?
previousRoute
)
{
final
String
?
previousTitleString
=
previousRoute
is
CupertinoRouteTransitionMixin
...
...
packages/flutter/test/cupertino/app_test.dart
View file @
61a388a4
...
...
@@ -7,9 +7,10 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
testWidgets
(
'Heroes work'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Heroes work'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
ListView
(
children:
<
Widget
>[
const
Hero
(
tag:
'a'
,
child:
Text
(
'foo'
)),
...
...
@@ -394,6 +395,11 @@ void main() {
return
renderEditable
!;
}
final
FocusNode
focusNode
=
FocusNode
();
addTearDown
(
focusNode
.
dispose
);
final
TextEditingController
controller
=
TextEditingController
();
addTearDown
(
controller
.
dispose
);
await
tester
.
pumpWidget
(
CupertinoApp
(
theme:
const
CupertinoThemeData
(
...
...
@@ -405,8 +411,8 @@ void main() {
return
EditableText
(
backgroundCursorColor:
DefaultSelectionStyle
.
of
(
context
).
selectionColor
!,
cursorColor:
DefaultSelectionStyle
.
of
(
context
).
cursorColor
!,
controller:
TextEditingController
()
,
focusNode:
FocusNode
()
,
controller:
controller
,
focusNode:
focusNode
,
style:
const
TextStyle
(),
);
},
...
...
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