update template for gen_keycodes (#49884)
This commit is contained in:
committed by
GitHub
parent
8b600032ee
commit
8061894f05
@@ -45,7 +45,7 @@ abstract class KeyboardKey extends Diagnosticable {
|
||||
/// look at the physical key to make sure that regardless of the character the
|
||||
/// key produces, you got the key that is in that location on the keyboard.
|
||||
///
|
||||
/// {@tool snippet --template=stateful_widget_scaffold}
|
||||
/// {@tool sample --template=stateful_widget_scaffold}
|
||||
/// This example shows how to detect if the user has selected the logical "Q"
|
||||
/// key.
|
||||
///
|
||||
@@ -127,7 +127,7 @@ class LogicalKeyboardKey extends KeyboardKey {
|
||||
///
|
||||
/// [keyId] must not be null.
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// {@tool snippet}
|
||||
/// To save executable size, it is recommended that the [debugName] be null in
|
||||
/// release mode. You can do this by using the [kReleaseMode] constant.
|
||||
///
|
||||
@@ -167,12 +167,12 @@ class LogicalKeyboardKey extends KeyboardKey {
|
||||
int get hashCode => keyId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final LogicalKeyboardKey typedOther = other;
|
||||
return keyId == typedOther.keyId;
|
||||
return other is LogicalKeyboardKey
|
||||
&& other.keyId == keyId;
|
||||
}
|
||||
|
||||
/// Returns the [LogicalKeyboardKey] constant that matches the given ID, or
|
||||
@@ -246,7 +246,7 @@ class LogicalKeyboardKey extends KeyboardKey {
|
||||
/// [control], so that the question "is any control key down?" can be asked.
|
||||
static Set<LogicalKeyboardKey> collapseSynonyms(Set<LogicalKeyboardKey> input) {
|
||||
final Set<LogicalKeyboardKey> result = <LogicalKeyboardKey>{};
|
||||
for (LogicalKeyboardKey key in input) {
|
||||
for (final LogicalKeyboardKey key in input) {
|
||||
final LogicalKeyboardKey synonym = _synonyms[key];
|
||||
result.add(synonym ?? key);
|
||||
}
|
||||
@@ -331,7 +331,7 @@ class LogicalKeyboardKey extends KeyboardKey {
|
||||
/// looking for "the key next next to the TAB key", since on a French keyboard,
|
||||
/// the key next to the TAB key has an "A" on it.
|
||||
///
|
||||
/// {@tool snippet --template=stateful_widget_scaffold}
|
||||
/// {@tool sample --template=stateful_widget_scaffold}
|
||||
/// This example shows how to detect if the user has selected the physical key
|
||||
/// to the right of the CAPS LOCK key.
|
||||
///
|
||||
@@ -407,7 +407,7 @@ class PhysicalKeyboardKey extends KeyboardKey {
|
||||
///
|
||||
/// The [usbHidUsage] must not be null.
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// {@tool snippet}
|
||||
/// To save executable size, it is recommended that the [debugName] be null in
|
||||
/// release mode. You can do this using the [kReleaseMode] constant.
|
||||
///
|
||||
@@ -440,12 +440,12 @@ class PhysicalKeyboardKey extends KeyboardKey {
|
||||
int get hashCode => usbHidUsage.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
bool operator ==(Object other) {
|
||||
if (other.runtimeType != runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final PhysicalKeyboardKey typedOther = other;
|
||||
return usbHidUsage == typedOther.usbHidUsage;
|
||||
return other is PhysicalKeyboardKey
|
||||
&& other.usbHidUsage == usbHidUsage;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -92,4 +92,3 @@ const Map<String, PhysicalKeyboardKey> kWebToPhysicalKey = <String, PhysicalKeyb
|
||||
const Map<String, LogicalKeyboardKey> kWebNumPadMap = <String, LogicalKeyboardKey>{
|
||||
@@@WEB_NUMPAD_MAP@@@
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user