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
a6765938
Unverified
Commit
a6765938
authored
Jan 25, 2022
by
chunhtai
Committed by
GitHub
Jan 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
relax routerReportsNewRouteInformation function signature (#97154)
parent
a88888e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
router.dart
packages/flutter/lib/src/widgets/router.dart
+2
-2
router_test.dart
packages/flutter/test/widgets/router_test.dart
+3
-3
No files found.
packages/flutter/lib/src/widgets/router.dart
View file @
a6765938
...
@@ -1326,7 +1326,7 @@ abstract class RouteInformationProvider extends ValueListenable<RouteInformation
...
@@ -1326,7 +1326,7 @@ abstract class RouteInformationProvider extends ValueListenable<RouteInformation
/// For more information on how [Router] determines a navigation event, see
/// For more information on how [Router] determines a navigation event, see
/// the "URL updates for web applications" section in the [Router]
/// the "URL updates for web applications" section in the [Router]
/// documentation.
/// documentation.
void
routerReportsNewRouteInformation
(
RouteInformation
routeInformation
,
{
required
RouteInformationReportingType
typ
e
})
{}
void
routerReportsNewRouteInformation
(
RouteInformation
routeInformation
,
{
RouteInformationReportingType
type
=
RouteInformationReportingType
.
non
e
})
{}
}
}
/// The route information provider that propagates the platform route information changes.
/// The route information provider that propagates the platform route information changes.
...
@@ -1349,7 +1349,7 @@ class PlatformRouteInformationProvider extends RouteInformationProvider with Wid
...
@@ -1349,7 +1349,7 @@ class PlatformRouteInformationProvider extends RouteInformationProvider with Wid
})
:
_value
=
initialRouteInformation
;
})
:
_value
=
initialRouteInformation
;
@override
@override
void
routerReportsNewRouteInformation
(
RouteInformation
routeInformation
,
{
required
RouteInformationReportingType
typ
e
})
{
void
routerReportsNewRouteInformation
(
RouteInformation
routeInformation
,
{
RouteInformationReportingType
type
=
RouteInformationReportingType
.
non
e
})
{
final
bool
replace
=
final
bool
replace
=
type
==
RouteInformationReportingType
.
neglect
||
type
==
RouteInformationReportingType
.
neglect
||
(
type
==
RouteInformationReportingType
.
none
&&
(
type
==
RouteInformationReportingType
.
none
&&
...
...
packages/flutter/test/widgets/router_test.dart
View file @
a6765938
...
@@ -802,14 +802,14 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
...
@@ -802,14 +802,14 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
);
);
log
.
clear
();
log
.
clear
();
provider
.
routerReportsNewRouteInformation
(
const
RouteInformation
(
location:
'a'
,
state:
true
)
,
type:
RouteInformationReportingType
.
none
);
provider
.
routerReportsNewRouteInformation
(
const
RouteInformation
(
location:
'a'
,
state:
true
));
// Implicit reporting pushes new history entry if the location changes.
// Implicit reporting pushes new history entry if the location changes.
expect
(
log
,
<
Object
>[
expect
(
log
,
<
Object
>[
isMethodCall
(
'selectMultiEntryHistory'
,
arguments:
null
),
isMethodCall
(
'selectMultiEntryHistory'
,
arguments:
null
),
isMethodCall
(
'routeInformationUpdated'
,
arguments:
<
String
,
dynamic
>{
'location'
:
'a'
,
'state'
:
true
,
'replace'
:
false
}),
isMethodCall
(
'routeInformationUpdated'
,
arguments:
<
String
,
dynamic
>{
'location'
:
'a'
,
'state'
:
true
,
'replace'
:
false
}),
]);
]);
log
.
clear
();
log
.
clear
();
provider
.
routerReportsNewRouteInformation
(
const
RouteInformation
(
location:
'a'
,
state:
false
)
,
type:
RouteInformationReportingType
.
none
);
provider
.
routerReportsNewRouteInformation
(
const
RouteInformation
(
location:
'a'
,
state:
false
));
// Since the location is the same, the provider sends replaces message.
// Since the location is the same, the provider sends replaces message.
expect
(
log
,
<
Object
>[
expect
(
log
,
<
Object
>[
isMethodCall
(
'selectMultiEntryHistory'
,
arguments:
null
),
isMethodCall
(
'selectMultiEntryHistory'
,
arguments:
null
),
...
@@ -1392,7 +1392,7 @@ class SimpleRouteInformationProvider extends RouteInformationProvider with Chang
...
@@ -1392,7 +1392,7 @@ class SimpleRouteInformationProvider extends RouteInformationProvider with Chang
}
}
@override
@override
void
routerReportsNewRouteInformation
(
RouteInformation
routeInformation
,
{
required
RouteInformationReportingType
typ
e
})
{
void
routerReportsNewRouteInformation
(
RouteInformation
routeInformation
,
{
RouteInformationReportingType
type
=
RouteInformationReportingType
.
non
e
})
{
_value
=
routeInformation
;
_value
=
routeInformation
;
onRouterReport
?.
call
(
routeInformation
,
type
);
onRouterReport
?.
call
(
routeInformation
,
type
);
}
}
...
...
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