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
5a862ebe
Unverified
Commit
5a862ebe
authored
Dec 03, 2021
by
Michael Goderbauer
Committed by
GitHub
Dec 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace dynamic with Object? in SystemChannels (#94629)
parent
ec40357f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
56 deletions
+56
-56
raw_keyboard.dart
packages/flutter/lib/src/services/raw_keyboard.dart
+3
-3
system_channels.dart
packages/flutter/lib/src/services/system_channels.dart
+4
-4
raw_keyboard_test.dart
packages/flutter/test/services/raw_keyboard_test.dart
+47
-47
event_simulation.dart
packages/flutter_test/lib/src/event_simulation.dart
+2
-2
No files found.
packages/flutter/lib/src/services/raw_keyboard.dart
View file @
5a862ebe
...
...
@@ -284,7 +284,7 @@ abstract class RawKeyEvent with Diagnosticable {
/// Creates a concrete [RawKeyEvent] class from a message in the form received
/// on the [SystemChannels.keyEvent] channel.
factory
RawKeyEvent
.
fromMessage
(
Map
<
String
,
dynamic
>
message
)
{
factory
RawKeyEvent
.
fromMessage
(
Map
<
String
,
Object
?
>
message
)
{
String
?
character
;
RawKeyEventData
_dataFromWeb
()
{
final
String
?
key
=
message
[
'key'
]
as
String
?;
...
...
@@ -303,7 +303,7 @@ abstract class RawKeyEvent with Diagnosticable {
if
(
kIsWeb
)
{
data
=
_dataFromWeb
();
}
else
{
final
String
keymap
=
message
[
'keymap'
]
as
String
;
final
String
keymap
=
message
[
'keymap'
]
!
as
String
;
switch
(
keymap
)
{
case
'android'
:
data
=
RawKeyEventDataAndroid
(
...
...
@@ -388,7 +388,7 @@ abstract class RawKeyEvent with Diagnosticable {
throw
FlutterError
(
'Unknown keymap for key events:
$keymap
'
);
}
}
final
String
type
=
message
[
'type'
]
as
String
;
final
String
type
=
message
[
'type'
]
!
as
String
;
switch
(
type
)
{
case
'keydown'
:
return
RawKeyDownEvent
(
data:
data
,
character:
character
);
...
...
packages/flutter/lib/src/services/system_channels.dart
View file @
5a862ebe
...
...
@@ -240,7 +240,7 @@ class SystemChannels {
/// * [RawKeyboard], which uses this channel to expose key data.
/// * [new RawKeyEvent.fromMessage], which can decode this data into the [RawKeyEvent]
/// subclasses mentioned above.
static
const
BasicMessageChannel
<
dynamic
>
keyEvent
=
BasicMessageChannel
<
dynamic
>(
static
const
BasicMessageChannel
<
Object
?>
keyEvent
=
BasicMessageChannel
<
Object
?
>(
'flutter/keyevent'
,
JSONMessageCodec
(),
);
...
...
@@ -271,7 +271,7 @@ class SystemChannels {
/// applications to release caches to free up more memory. See
/// [WidgetsBindingObserver.didHaveMemoryPressure], which triggers whenever
/// a message is received on this channel.
static
const
BasicMessageChannel
<
dynamic
>
system
=
BasicMessageChannel
<
dynamic
>(
static
const
BasicMessageChannel
<
Object
?>
system
=
BasicMessageChannel
<
Object
?
>(
'flutter/system'
,
JSONMessageCodec
(),
);
...
...
@@ -283,7 +283,7 @@ class SystemChannels {
/// * [SemanticsEvent] and its subclasses for a list of valid accessibility
/// events that can be sent over this channel.
/// * [SemanticsNode.sendEvent], which uses this channel to dispatch events.
static
const
BasicMessageChannel
<
dynamic
>
accessibility
=
BasicMessageChannel
<
dynamic
>(
static
const
BasicMessageChannel
<
Object
?>
accessibility
=
BasicMessageChannel
<
Object
?
>(
'flutter/accessibility'
,
StandardMessageCodec
(),
);
...
...
@@ -311,7 +311,7 @@ class SystemChannels {
/// A [MethodChannel] for configuring mouse cursors.
///
/// All outgoing methods defined for this channel uses a `Map<String,
dynamic
>`
/// All outgoing methods defined for this channel uses a `Map<String,
Object?
>`
/// to contain multiple parameters, including the following methods (invoked
/// using [OptionalMethodChannel.invokeMethod]):
///
...
...
packages/flutter/test/services/raw_keyboard_test.dart
View file @
5a862ebe
This diff is collapsed.
Click to expand it.
packages/flutter_test/lib/src/event_simulation.dart
View file @
5a862ebe
...
...
@@ -688,8 +688,8 @@ class KeyEventSimulator {
result
.
complete
(
false
);
return
;
}
final
Map
<
String
,
dynamic
>
decoded
=
SystemChannels
.
keyEvent
.
codec
.
decodeMessage
(
data
)
as
Map
<
String
,
dynamic
>;
result
.
complete
(
decoded
[
'handled'
]
as
bool
);
final
Map
<
String
,
Object
?>
decoded
=
SystemChannels
.
keyEvent
.
codec
.
decodeMessage
(
data
)!
as
Map
<
String
,
dynamic
>;
result
.
complete
(
decoded
[
'handled'
]
!
as
bool
);
}
);
return
result
.
future
;
...
...
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