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
42b02d0a
Unverified
Commit
42b02d0a
authored
Feb 28, 2024
by
Polina Cherkasova
Committed by
GitHub
Feb 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use const route for notAnnounced. (#144050)
parent
55173169
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+8
-9
system_fonts_test.dart
packages/flutter/test/painting/system_fonts_test.dart
+1
-4
No files found.
packages/flutter/lib/src/widgets/navigator.dart
View file @
42b02d0a
...
...
@@ -138,7 +138,7 @@ enum RoutePopDisposition {
/// The type argument `T` is the route's return type, as used by
/// [currentResult], [popped], and [didPop]. The type `void` may be used if the
/// route does not return a value.
abstract
class
Route
<
T
>
{
abstract
class
Route
<
T
>
extends
_RoutePlaceholder
{
/// Initialize the [Route].
///
/// If the [settings] are not provided, an empty [RouteSettings] object is
...
...
@@ -2896,10 +2896,9 @@ enum _RouteLifecycle {
typedef
_RouteEntryPredicate
=
bool
Function
(
_RouteEntry
entry
);
class
_NotAnnounced
extends
Route
<
void
>
{
// A placeholder for the lastAnnouncedPreviousRoute, the
// lastAnnouncedPoppedNextRoute, and the lastAnnouncedNextRoute before any
// change has been announced.
/// Placeholder for a route.
class
_RoutePlaceholder
{
const
_RoutePlaceholder
();
}
class
_RouteEntry
extends
RouteTransitionRecord
{
...
...
@@ -2937,12 +2936,12 @@ class _RouteEntry extends RouteTransitionRecord {
/// remove as a result of a page update.
static
const
int
kDebugPopAttemptLimit
=
100
;
static
final
Route
<
dynamic
>
notAnnounced
=
_NotAnnounced
();
static
const
_RoutePlaceholder
notAnnounced
=
_RoutePlaceholder
();
_RouteLifecycle
currentState
;
Route
<
dynamic
>
?
lastAnnouncedPreviousRoute
=
notAnnounced
;
// last argument to Route.didChangePrevious
WeakReference
<
Route
<
dynamic
>>
lastAnnouncedPoppedNextRoute
=
WeakReference
<
Route
<
dynamic
>
>(
notAnnounced
);
// last argument to Route.didPopNext
Route
<
dynamic
>
?
lastAnnouncedNextRoute
=
notAnnounced
;
// last argument to Route.didChangeNext
_RoutePlaceholder
?
lastAnnouncedPreviousRoute
=
notAnnounced
;
// last argument to Route.didChangePrevious
WeakReference
<
_RoutePlaceholder
>
lastAnnouncedPoppedNextRoute
=
WeakReference
<
_RoutePlaceholder
>(
notAnnounced
);
// last argument to Route.didPopNext
_RoutePlaceholder
?
lastAnnouncedNextRoute
=
notAnnounced
;
// last argument to Route.didChangeNext
int
?
lastFocusNode
;
// The last focused semantic node for the route entry.
/// Restoration ID to be used for the encapsulating route when restoration is
...
...
packages/flutter/test/painting/system_fonts_test.dart
View file @
42b02d0a
...
...
@@ -40,10 +40,7 @@ void main() {
// TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean]
LeakTesting
.
settings
=
LeakTesting
.
settings
.
withIgnored
(
classes:
<
String
>[
'CurvedAnimation'
]);
testWidgets
(
'RenderParagraph relayout upon system fonts changes'
,
// TODO(polina-c): dispose _NotAnnounced, https://github.com/dart-lang/leak_tracker/issues/218 [leaks-to-clean]
experimentalLeakTesting:
LeakTesting
.
settings
.
withIgnored
(
classes:
<
String
>[
'ValueNotifier<String?>'
,
'_NotAnnounced'
]),
(
WidgetTester
tester
)
async
{
testWidgets
(
'RenderParagraph relayout upon system fonts changes'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Text
(
'text widget'
),
...
...
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