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
18ed041d
Unverified
Commit
18ed041d
authored
Aug 06, 2020
by
Alexandre Ardhuin
Committed by
GitHub
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handler can be null in platform_channel (#63057)
parent
e9117c19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
platform_channel.dart
packages/flutter/lib/src/services/platform_channel.dart
+5
-5
No files found.
packages/flutter/lib/src/services/platform_channel.dart
View file @
18ed041d
...
...
@@ -67,7 +67,7 @@ class BasicMessageChannel<T> {
///
/// The handler's return value is sent back to the platform plugins as a
/// message reply. It may be null.
void
setMessageHandler
(
Future
<
T
>
handler
(
T
message
)
)
{
void
setMessageHandler
(
Future
<
T
>
Function
(
T
message
)?
handler
)
{
if
(
handler
==
null
)
{
binaryMessenger
.
setMessageHandler
(
name
,
null
);
}
else
{
...
...
@@ -88,7 +88,7 @@ class BasicMessageChannel<T> {
///
/// This is intended for testing. Messages intercepted in this manner are not
/// sent to platform plugins.
void
setMockMessageHandler
(
Future
<
T
>
handler
(
T
message
)
)
{
void
setMockMessageHandler
(
Future
<
T
>
Function
(
T
message
)
handler
)
{
if
(
handler
==
null
)
{
binaryMessenger
.
setMockMessageHandler
(
name
,
null
);
}
else
{
...
...
@@ -390,7 +390,7 @@ class MethodChannel {
///
/// This method is useful for tests or test harnesses that want to assert the
/// handler for the specified channel has not been altered by a previous test.
bool
checkMethodCallHandler
(
Future
<
dynamic
>
handler
(
MethodCall
call
)
)
=>
_methodChannelHandlers
[
this
]
==
handler
;
bool
checkMethodCallHandler
(
Future
<
dynamic
>
Function
(
MethodCall
call
)?
handler
)
=>
_methodChannelHandlers
[
this
]
==
handler
;
/// Sets a mock callback for intercepting method invocations on this channel.
///
...
...
@@ -410,7 +410,7 @@ class MethodChannel {
/// return value of the call. The value will be encoded using
/// [MethodCodec.encodeSuccessEnvelope], to act as if platform plugin had
/// returned that value.
void
setMockMethodCallHandler
(
Future
<
dynamic
>
handler
(
MethodCall
call
)
)
{
void
setMockMethodCallHandler
(
Future
<
dynamic
>
Function
(
MethodCall
call
)?
handler
)
{
_methodChannelMockHandlers
[
this
]
=
handler
;
binaryMessenger
.
setMockMessageHandler
(
name
,
...
...
@@ -423,7 +423,7 @@ class MethodChannel {
///
/// This method is useful for tests or test harnesses that want to assert the
/// handler for the specified channel has not been altered by a previous test.
bool
checkMockMethodCallHandler
(
Future
<
dynamic
>
handler
(
MethodCall
call
)
)
=>
_methodChannelMockHandlers
[
this
]
==
handler
;
bool
checkMockMethodCallHandler
(
Future
<
dynamic
>
Function
(
MethodCall
call
)?
handler
)
=>
_methodChannelMockHandlers
[
this
]
==
handler
;
Future
<
ByteData
?>
_handleAsMethodCall
(
ByteData
?
message
,
Future
<
dynamic
>
handler
(
MethodCall
call
))
async
{
final
MethodCall
call
=
codec
.
decodeMethodCall
(
message
);
...
...
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