Repository navigation
Commit af757cb
authored
[CP-stable]Add ContextMenuButtonKind (#195015)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
### Issue Link:
Part of flutter/flutter#193527
### Impact Description:
Low user-facing impact on its own, as this PR is purely additive (`ContextMenuButtonKind` and `ContextMenuButtonItem.kind`) without deprecating `ContextMenuButtonType` or changing existing behavior. However, cherry-picking this into `3.47` unblocks the decoupled `cupertino_ui` and `material_ui` packages (which must support the latest stable Flutter release) from migrating to `ContextMenuButtonKind` and unblocks shipping the iOS Translate context menu work (#180021) without waiting an extra stable release cycle.
### Changelog Description:
Explain this cherry pick:
- [flutter/193527](flutter/flutter#193527) When building custom text selection menus, packages can't add new actions such as Translate without breaking exhaustive switches on `ContextMenuButtonType`; adds the extensible `ContextMenuButtonKind`.
### Workaround:
Is there a workaround for this issue?
No.
### Risk:
What is the risk level of this cherry-pick?
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
### Validation Steps:
Run the automated unit tests in `flutter test test/widgets/context_menu_button_item_test.dart`, `test/widgets/editable_text_test.dart`, `test/widgets/selectable_region_test.dart`, and `test/widgets/system_context_menu_test.dart` to verify `ContextMenuButtonKind` and `ContextMenuButtonItem.kind` behavior and backwards compatibility with `ContextMenuButtonType`.1 parent a2bafa5 commit af757cb
5 files changed
Lines changed: 274 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
56 | 187 | | |
57 | 188 | | |
58 | 189 | | |
| |||
64 | 195 | | |
65 | 196 | | |
66 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
67 | 201 | | |
68 | 202 | | |
69 | | - | |
| 203 | + | |
| 204 | + | |
70 | 205 | | |
71 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
72 | 209 | | |
73 | 210 | | |
74 | 211 | | |
75 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
76 | 234 | | |
77 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
78 | 242 | | |
79 | 243 | | |
80 | 244 | | |
81 | | - | |
82 | | - | |
| 245 | + | |
| 246 | + | |
83 | 247 | | |
84 | 248 | | |
85 | 249 | | |
| |||
88 | 252 | | |
89 | 253 | | |
90 | 254 | | |
| 255 | + | |
91 | 256 | | |
92 | 257 | | |
| 258 | + | |
93 | 259 | | |
94 | 260 | | |
95 | | - | |
| 261 | + | |
96 | 262 | | |
97 | 263 | | |
98 | 264 | | |
| |||
105 | 271 | | |
106 | 272 | | |
107 | 273 | | |
108 | | - | |
| 274 | + | |
109 | 275 | | |
110 | 276 | | |
111 | 277 | | |
112 | | - | |
| 278 | + | |
113 | 279 | | |
114 | 280 | | |
115 | | - | |
| 281 | + | |
116 | 282 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
2170 | | - | |
| 2170 | + | |
2171 | 2171 | | |
2172 | | - | |
| 2172 | + | |
2173 | 2173 | | |
2174 | | - | |
| 2174 | + | |
2175 | 2175 | | |
2176 | | - | |
| 2176 | + | |
2177 | 2177 | | |
2178 | | - | |
| 2178 | + | |
2179 | 2179 | | |
2180 | | - | |
| 2180 | + | |
2181 | 2181 | | |
2182 | | - | |
| 2182 | + | |
2183 | 2183 | | |
2184 | | - | |
| 2184 | + | |
2185 | 2185 | | |
2186 | 2186 | | |
2187 | 2187 | | |
| |||
2190 | 2190 | | |
2191 | 2191 | | |
2192 | 2192 | | |
2193 | | - | |
| 2193 | + | |
2194 | 2194 | | |
2195 | 2195 | | |
2196 | 2196 | | |
| |||
3131 | 3131 | | |
3132 | 3132 | | |
3133 | 3133 | | |
3134 | | - | |
| 3134 | + | |
3135 | 3135 | | |
3136 | 3136 | | |
3137 | 3137 | | |
3138 | 3138 | | |
3139 | 3139 | | |
3140 | 3140 | | |
3141 | | - | |
| 3141 | + | |
3142 | 3142 | | |
3143 | 3143 | | |
3144 | 3144 | | |
3145 | 3145 | | |
3146 | 3146 | | |
3147 | 3147 | | |
3148 | | - | |
| 3148 | + | |
3149 | 3149 | | |
3150 | 3150 | | |
3151 | 3151 | | |
3152 | 3152 | | |
3153 | 3153 | | |
3154 | 3154 | | |
3155 | | - | |
| 3155 | + | |
3156 | 3156 | | |
3157 | 3157 | | |
3158 | 3158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
| 165 | + | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
0 commit comments