Unverified Commit 584ef083 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Replace Android-specific check with switch (#24754)

Generally, we should always use default-less switches for
platform-specific behaviour so we're forced to make a conscious decision
on each instance of such behaviour any time we add support for a new
platform.
parent 71a15896
......@@ -256,8 +256,14 @@ class RenderEditable extends RenderBox {
// TODO(goderbauer): doesn't handle extended grapheme clusters with more than one Unicode scalar value (https://github.com/flutter/flutter/issues/13404).
void _handleKeyEvent(RawKeyEvent keyEvent) {
if (defaultTargetPlatform != TargetPlatform.android)
return;
// Only handle key events on Android.
switch (defaultTargetPlatform) {
case TargetPlatform.android:
break;
case TargetPlatform.iOS:
case TargetPlatform.fuchsia:
return;
}
if (keyEvent is RawKeyUpEvent)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment