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.
This commit is contained in:
Chris Bracken
2019-01-15 19:42:55 -08:00
committed by GitHub
parent 71a15896d8
commit 584ef083c7

View File

@@ -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;