@@ -1624,10 +1624,6 @@ void main() {
1624
1624
TestSemantics (
1625
1625
label: 'test' ,
1626
1626
textDirection: TextDirection .ltr,
1627
- flags: < SemanticsFlag > [
1628
- SemanticsFlag .hasEnabledState,
1629
- SemanticsFlag .isButton,
1630
- ],
1631
1627
),
1632
1628
],
1633
1629
),
@@ -1666,10 +1662,6 @@ void main() {
1666
1662
TestSemantics (
1667
1663
label: 'test' ,
1668
1664
textDirection: TextDirection .ltr,
1669
- flags: < SemanticsFlag > [
1670
- SemanticsFlag .hasEnabledState,
1671
- SemanticsFlag .isButton,
1672
- ],
1673
1665
children: < TestSemantics > [
1674
1666
TestSemantics (
1675
1667
label: 'Delete' ,
@@ -1720,7 +1712,6 @@ void main() {
1720
1712
textDirection: TextDirection .ltr,
1721
1713
flags: < SemanticsFlag > [
1722
1714
SemanticsFlag .hasEnabledState,
1723
- SemanticsFlag .isButton,
1724
1715
SemanticsFlag .isEnabled,
1725
1716
SemanticsFlag .isFocusable,
1726
1717
],
@@ -1772,7 +1763,6 @@ void main() {
1772
1763
textDirection: TextDirection .ltr,
1773
1764
flags: < SemanticsFlag > [
1774
1765
SemanticsFlag .hasEnabledState,
1775
- SemanticsFlag .isButton,
1776
1766
SemanticsFlag .isEnabled,
1777
1767
SemanticsFlag .isFocusable,
1778
1768
],
@@ -1818,7 +1808,6 @@ void main() {
1818
1808
textDirection: TextDirection .ltr,
1819
1809
flags: < SemanticsFlag > [
1820
1810
SemanticsFlag .hasEnabledState,
1821
- SemanticsFlag .isButton,
1822
1811
SemanticsFlag .isEnabled,
1823
1812
SemanticsFlag .isFocusable,
1824
1813
SemanticsFlag .isSelected,
@@ -1864,10 +1853,7 @@ void main() {
1864
1853
TestSemantics (
1865
1854
label: 'test' ,
1866
1855
textDirection: TextDirection .ltr,
1867
- flags: < SemanticsFlag > [
1868
- SemanticsFlag .hasEnabledState,
1869
- SemanticsFlag .isButton,
1870
- ],
1856
+ flags: < SemanticsFlag > [],
1871
1857
actions: < SemanticsAction > [],
1872
1858
),
1873
1859
],
@@ -1881,140 +1867,6 @@ void main() {
1881
1867
1882
1868
semanticsTester.dispose ();
1883
1869
});
1884
-
1885
- testWidgets ('tapEnabled explicitly false' , (WidgetTester tester) async {
1886
- final SemanticsTester semanticsTester = SemanticsTester (tester);
1887
-
1888
- await tester.pumpWidget (const MaterialApp (
1889
- home: Material (
1890
- child: RawChip (
1891
- tapEnabled: false ,
1892
- label: Text ('test' ),
1893
- ),
1894
- ),
1895
- ));
1896
-
1897
- expect (semanticsTester, hasSemantics (
1898
- TestSemantics .root (
1899
- children: < TestSemantics > [
1900
- TestSemantics (
1901
- textDirection: TextDirection .ltr,
1902
- children: < TestSemantics > [
1903
- TestSemantics (
1904
- children: < TestSemantics > [
1905
- TestSemantics (
1906
- flags: < SemanticsFlag > [SemanticsFlag .scopesRoute],
1907
- children: < TestSemantics > [
1908
- TestSemantics (
1909
- label: 'test' ,
1910
- textDirection: TextDirection .ltr,
1911
- flags: < SemanticsFlag > [], // Must not be a button when tapping is disabled.
1912
- actions: < SemanticsAction > [],
1913
- ),
1914
- ],
1915
- ),
1916
- ],
1917
- ),
1918
- ],
1919
- ),
1920
- ],
1921
- ), ignoreTransform: true , ignoreId: true , ignoreRect: true ));
1922
-
1923
- semanticsTester.dispose ();
1924
- });
1925
-
1926
- testWidgets ('enabled when tapEnabled and canTap' , (WidgetTester tester) async {
1927
- final SemanticsTester semanticsTester = SemanticsTester (tester);
1928
-
1929
- // These settings make a Chip which can be tapped, both in general and at this moment.
1930
- await tester.pumpWidget (MaterialApp (
1931
- home: Material (
1932
- child: RawChip (
1933
- isEnabled: true ,
1934
- tapEnabled: true ,
1935
- onPressed: () {},
1936
- label: const Text ('test' ),
1937
- ),
1938
- ),
1939
- ));
1940
-
1941
- expect (semanticsTester, hasSemantics (
1942
- TestSemantics .root (
1943
- children: < TestSemantics > [
1944
- TestSemantics (
1945
- textDirection: TextDirection .ltr,
1946
- children: < TestSemantics > [
1947
- TestSemantics (
1948
- children: < TestSemantics > [
1949
- TestSemantics (
1950
- flags: < SemanticsFlag > [SemanticsFlag .scopesRoute],
1951
- children: < TestSemantics > [
1952
- TestSemantics (
1953
- label: 'test' ,
1954
- textDirection: TextDirection .ltr,
1955
- flags: < SemanticsFlag > [
1956
- SemanticsFlag .hasEnabledState,
1957
- SemanticsFlag .isButton,
1958
- SemanticsFlag .isEnabled,
1959
- SemanticsFlag .isFocusable,
1960
- ],
1961
- actions: < SemanticsAction > [SemanticsAction .tap],
1962
- ),
1963
- ],
1964
- ),
1965
- ],
1966
- ),
1967
- ],
1968
- ),
1969
- ],
1970
- ), ignoreTransform: true , ignoreId: true , ignoreRect: true ));
1971
-
1972
- semanticsTester.dispose ();
1973
- });
1974
-
1975
- testWidgets ('disabled when tapEnabled but not canTap' , (WidgetTester tester) async {
1976
- final SemanticsTester semanticsTester = SemanticsTester (tester);
1977
- // These settings make a Chip which _could_ be tapped, but not currently (ensures `canTap == false`).
1978
- await tester.pumpWidget (const MaterialApp (
1979
- home: Material (
1980
- child: RawChip (
1981
- isEnabled: true ,
1982
- tapEnabled: true ,
1983
- label: Text ('test' ),
1984
- ),
1985
- ),
1986
- ));
1987
-
1988
- expect (semanticsTester, hasSemantics (
1989
- TestSemantics .root (
1990
- children: < TestSemantics > [
1991
- TestSemantics (
1992
- textDirection: TextDirection .ltr,
1993
- children: < TestSemantics > [
1994
- TestSemantics (
1995
- children: < TestSemantics > [
1996
- TestSemantics (
1997
- flags: < SemanticsFlag > [SemanticsFlag .scopesRoute],
1998
- children: < TestSemantics > [
1999
- TestSemantics (
2000
- label: 'test' ,
2001
- textDirection: TextDirection .ltr,
2002
- flags: < SemanticsFlag > [
2003
- SemanticsFlag .hasEnabledState,
2004
- SemanticsFlag .isButton,
2005
- ],
2006
- ),
2007
- ],
2008
- ),
2009
- ],
2010
- ),
2011
- ],
2012
- ),
2013
- ],
2014
- ), ignoreTransform: true , ignoreId: true , ignoreRect: true ));
2015
-
2016
- semanticsTester.dispose ();
2017
- });
2018
1870
});
2019
1871
2020
1872
testWidgets ('can be tapped outside of chip delete icon' , (WidgetTester tester) async {
0 commit comments