Commit e070417
authored
Add 'Share' button to the selection toolbar on Android (#139479)
## Description
This PR adds the 'Share' button to the text selection toolbar on Android.
## Related Issue
Fixes flutter/flutter#138728
## Tests
Refactor a lot of existing tests in order to:
- make them more readable (avoid duplication by introducing helper functions, specify explictly check which buttons are expected).
- make them more accurate (check that expected buttons are visible instead of just checking the number of buttons).
For instance, previous tests contained sections such as:
```dart
// Collapsed toolbar shows 3 buttons.
expect(
find.byType(CupertinoButton),
isContextMenuProvidedByPlatform ? findsNothing : isTargetPlatformIOS ? findsNWidgets(6) : findsNWidgets(3)
);
```
Where the comment is obsolete, the two cases (6 widgets and 3 widgets) are not explicit (which buttons are expected?), and not accurate (will pass if the number of buttons is right but the buttons are the wrong ones).1 parent c674161 commit e070417
10 files changed
Lines changed: 725 additions & 496 deletions
File tree
- packages/flutter
- lib/src
- material
- widgets
- test
- cupertino
- material
- widgets
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1882 | 1882 | | |
1883 | 1883 | | |
1884 | 1884 | | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
1885 | 1889 | | |
1886 | 1890 | | |
1887 | 1891 | | |
| |||
1898 | 1902 | | |
1899 | 1903 | | |
1900 | 1904 | | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
1901 | 1910 | | |
1902 | 1911 | | |
1903 | 1912 | | |
| |||
1913 | 1922 | | |
1914 | 1923 | | |
1915 | 1924 | | |
1916 | | - | |
| 1925 | + | |
1917 | 1926 | | |
1918 | 1927 | | |
1919 | 1928 | | |
| |||
2300 | 2309 | | |
2301 | 2310 | | |
2302 | 2311 | | |
2303 | | - | |
2304 | | - | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
2305 | 2323 | | |
2306 | | - | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
2310 | 2324 | | |
2311 | 2325 | | |
2312 | 2326 | | |
| |||
2516 | 2530 | | |
2517 | 2531 | | |
2518 | 2532 | | |
2519 | | - | |
| 2533 | + | |
2520 | 2534 | | |
2521 | | - | |
| 2535 | + | |
2522 | 2536 | | |
2523 | 2537 | | |
2524 | 2538 | | |
| |||
Lines changed: 38 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 35 | | |
42 | 36 | | |
43 | 37 | | |
| |||
188 | 182 | | |
189 | 183 | | |
190 | 184 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 185 | | |
197 | 186 | | |
198 | 187 | | |
199 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
200 | 204 | | |
201 | | - | |
202 | 205 | | |
203 | 206 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
207 | 220 | | |
| 221 | + | |
208 | 222 | | |
209 | 223 | | |
210 | 224 | | |
211 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
212 | 234 | | |
213 | 235 | | |
214 | 236 | | |
| |||
0 commit comments