Repository navigation
Commit a0e7807
authored
[material_ui] Add enabled parameter to DropdownButtonFormField (flutter#12610)
Introduced the `enabled` parameter in `DropdownButtonFormField`, allowing proper disabled/read-only usage without needing to pass dummy callbacks or remove existing ones.
Previously, the only way to disable a `DropdownButtonFormField` was to set `onChanged: null`. With this change, developers can explicitly control the interactive state via the `enabled` property. For example, you can set `enabled: false` while keeping `onChanged` defined, or set `enabled: true` to have an interactive field even if `onChanged` is omitted.
This change is fully backward compatible. If the `enabled` property is omitted (left as `null`), the field will fall back to the legacy behavior: it will be enabled if and only if `onChanged` is non-null.
Closes flutter#57953.
Port of flutter#182419.
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 parent eca7601 commit a0e7807
3 files changed
Lines changed: 115 additions & 8 deletions
File tree
- packages/material_ui
- lib/src
- pending_changelogs
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1852 | 1852 | | |
1853 | 1853 | | |
1854 | 1854 | | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
1855 | 1871 | | |
1856 | 1872 | | |
1857 | 1873 | | |
| |||
1868 | 1884 | | |
1869 | 1885 | | |
1870 | 1886 | | |
1871 | | - | |
| 1887 | + | |
1872 | 1888 | | |
1873 | 1889 | | |
1874 | 1890 | | |
| |||
1888 | 1904 | | |
1889 | 1905 | | |
1890 | 1906 | | |
| 1907 | + | |
1891 | 1908 | | |
1892 | 1909 | | |
1893 | 1910 | | |
| |||
1922 | 1939 | | |
1923 | 1940 | | |
1924 | 1941 | | |
| 1942 | + | |
1925 | 1943 | | |
1926 | 1944 | | |
1927 | 1945 | | |
| |||
1930 | 1948 | | |
1931 | 1949 | | |
1932 | 1950 | | |
1933 | | - | |
| 1951 | + | |
| 1952 | + | |
1934 | 1953 | | |
1935 | 1954 | | |
1936 | 1955 | | |
| |||
1969 | 1988 | | |
1970 | 1989 | | |
1971 | 1990 | | |
1972 | | - | |
| 1991 | + | |
1973 | 1992 | | |
1974 | 1993 | | |
1975 | 1994 | | |
| |||
2006 | 2025 | | |
2007 | 2026 | | |
2008 | 2027 | | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
2009 | 2031 | | |
2010 | 2032 | | |
2011 | 2033 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | | - | |
1187 | 1186 | | |
1188 | 1187 | | |
1189 | 1188 | | |
| |||
1315 | 1314 | | |
1316 | 1315 | | |
1317 | 1316 | | |
1318 | | - | |
1319 | 1317 | | |
1320 | 1318 | | |
1321 | 1319 | | |
| |||
1364 | 1362 | | |
1365 | 1363 | | |
1366 | 1364 | | |
1367 | | - | |
1368 | 1365 | | |
1369 | 1366 | | |
1370 | 1367 | | |
| |||
1529 | 1526 | | |
1530 | 1527 | | |
1531 | 1528 | | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
1532 | 1612 | | |
0 commit comments