Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 76a270f

Browse files
authored
Update iOS KeyCodeMap dictionary literal and migrate to ARC (#51981)
Framework template updated in flutter/flutter#146481. See [gen_keycodes README](https://github.com/flutter/flutter/tree/master/dev/tools/gen_keycodes ) for details. Fixes flutter/flutter#146480 `-Wobjc-redundant-literal-use` error. Note `-Wobjc-redundant-literal-use` is already on for clang-tidy https://github.com/flutter/engine/blob/6dc91bff96a56513a57ed5dd036fb16d25c945fd/.clang-tidy#L13 but in this case it's only true triggered when the file is compiled with ARC. When I migrated this file to ARC as part of flutter/flutter#137801, it triggered the error.
1 parent 1fb2a7a commit 76a270f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

shell/platform/darwin/ios/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ source_set("flutter_framework_source_arc") {
6868
"framework/Source/FlutterTextInputPlugin.mm",
6969
"framework/Source/FlutterTextureRegistryRelay.h",
7070
"framework/Source/FlutterTextureRegistryRelay.mm",
71+
"framework/Source/KeyCodeMap.g.mm",
72+
"framework/Source/KeyCodeMap_Internal.h",
7173
"framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h",
7274
"framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.mm",
7375
]
@@ -129,8 +131,6 @@ source_set("flutter_framework_source") {
129131
"framework/Source/FlutterView.mm",
130132
"framework/Source/FlutterViewController.mm",
131133
"framework/Source/FlutterViewController_Internal.h",
132-
"framework/Source/KeyCodeMap.g.mm",
133-
"framework/Source/KeyCodeMap_Internal.h",
134134
"framework/Source/SemanticsObject.h",
135135
"framework/Source/SemanticsObject.mm",
136136
"framework/Source/accessibility_bridge.h",

shell/platform/darwin/ios/framework/Source/KeyCodeMap.g.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
};
330330

331331
API_AVAILABLE(ios(13.4))
332-
NSDictionary<NSString*, NSNumber*>* specialKeyMapping = [[NSDictionary alloc] initWithDictionary:@{
332+
NSDictionary<NSString*, NSNumber*>* specialKeyMapping = @{
333333
@"UIKeyInputEscape" : @(0x10000001b),
334334
@"UIKeyInputF1" : @(0x100000801),
335335
@"UIKeyInputF2" : @(0x100000802),
@@ -351,7 +351,7 @@
351351
@"UIKeyInputEnd" : @(0x10000000d),
352352
@"UIKeyInputPageUp" : @(0x100000308),
353353
@"UIKeyInputPageDown" : @(0x100000307),
354-
}];
354+
};
355355

356356
const uint64_t kCapsLockPhysicalKey = 0x00070039;
357357
const uint64_t kCapsLockLogicalKey = 0x100000104;

0 commit comments

Comments
 (0)