isAutogenerated property

bool isAutogenerated

Returns true if the keyId of this object is one that is auto-generated by Flutter.

Auto-generated key IDs are generated in response to platform key codes which Flutter doesn't recognize, and their IDs shouldn't be used in a persistent way.

Auto-generated IDs should be a rare occurrence: Flutter supports most keys.

Keys that generate Unicode characters (even if unknown to Flutter) will not return true for isAutogenerated, since they will be assigned a Unicode-based code that will remain stable.

If Flutter adds support for a previously unsupported key code, the ID it reports will change, but the ID will remain stable on the platform it is produced on until Flutter adds support for recognizing it.

So, hypothetically, if Android added a new key code of 0xffff, representing a new "do what I mean" key, then the auto-generated code would be 0x1020000ffff, but once Flutter added the "doWhatIMean" key to the definitions below, the new code would be 0x0020000ffff for all platforms that had a "do what I mean" key from then on.

Implementation

bool get isAutogenerated => (keyId & autogeneratedMask) != 0;