@@ -1326,35 +1326,6 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
1326
1326
return Size .zero;
1327
1327
}
1328
1328
1329
- ChildSemanticsConfigurationsResult _childSemanticsConfigurationDelegate (List <SemanticsConfiguration > childConfigs) {
1330
- final ChildSemanticsConfigurationsResultBuilder builder = ChildSemanticsConfigurationsResultBuilder ();
1331
- List <SemanticsConfiguration >? prefixMergeGroup;
1332
- List <SemanticsConfiguration >? suffixMergeGroup;
1333
- for (final SemanticsConfiguration childConfig in childConfigs) {
1334
- if (childConfig.tagsChildrenWith (_InputDecoratorState ._kPrefixSemanticsTag)) {
1335
- prefixMergeGroup ?? = < SemanticsConfiguration > [];
1336
- prefixMergeGroup.add (childConfig);
1337
- } else if (childConfig.tagsChildrenWith (_InputDecoratorState ._kSuffixSemanticsTag)) {
1338
- suffixMergeGroup ?? = < SemanticsConfiguration > [];
1339
- suffixMergeGroup.add (childConfig);
1340
- } else {
1341
- builder.markAsMergeUp (childConfig);
1342
- }
1343
- }
1344
- if (prefixMergeGroup != null ) {
1345
- builder.markAsSiblingMergeGroup (prefixMergeGroup);
1346
- }
1347
- if (suffixMergeGroup != null ) {
1348
- builder.markAsSiblingMergeGroup (suffixMergeGroup);
1349
- }
1350
- return builder.build ();
1351
- }
1352
-
1353
- @override
1354
- void describeSemanticsConfiguration (SemanticsConfiguration config) {
1355
- config.childConfigurationsDelegate = _childSemanticsConfigurationDelegate;
1356
- }
1357
-
1358
1329
@override
1359
1330
void performLayout () {
1360
1331
final BoxConstraints constraints = this .constraints;
@@ -1742,16 +1713,12 @@ class _AffixText extends StatelessWidget {
1742
1713
this .text,
1743
1714
this .style,
1744
1715
this .child,
1745
- this .semanticsSortKey,
1746
- required this .semanticsTag,
1747
1716
});
1748
1717
1749
1718
final bool labelIsFloating;
1750
1719
final String ? text;
1751
1720
final TextStyle ? style;
1752
1721
final Widget ? child;
1753
- final SemanticsSortKey ? semanticsSortKey;
1754
- final SemanticsTag semanticsTag;
1755
1722
1756
1723
@override
1757
1724
Widget build (BuildContext context) {
@@ -1761,11 +1728,7 @@ class _AffixText extends StatelessWidget {
1761
1728
duration: _kTransitionDuration,
1762
1729
curve: _kTransitionCurve,
1763
1730
opacity: labelIsFloating ? 1.0 : 0.0 ,
1764
- child: Semantics (
1765
- sortKey: semanticsSortKey,
1766
- tagForChildren: semanticsTag,
1767
- child: child ?? (text == null ? null : Text (text! , style: style)),
1768
- ),
1731
+ child: child ?? (text == null ? null : Text (text! , style: style)),
1769
1732
),
1770
1733
);
1771
1734
}
@@ -1936,11 +1899,6 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
1936
1899
late AnimationController _floatingLabelController;
1937
1900
late AnimationController _shakingLabelController;
1938
1901
final _InputBorderGap _borderGap = _InputBorderGap ();
1939
- static const OrdinalSortKey _kPrefixSemanticsSortOrder = OrdinalSortKey (0 );
1940
- static const OrdinalSortKey _kInputSemanticsSortOrder = OrdinalSortKey (1 );
1941
- static const OrdinalSortKey _kSuffixSemanticsSortOrder = OrdinalSortKey (2 );
1942
- static const SemanticsTag _kPrefixSemanticsTag = SemanticsTag ('_InputDecoratorState.prefix' );
1943
- static const SemanticsTag _kSuffixSemanticsTag = SemanticsTag ('_InputDecoratorState.suffix' );
1944
1902
1945
1903
@override
1946
1904
void initState () {
@@ -2260,42 +2218,22 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2260
2218
),
2261
2219
);
2262
2220
2263
- final bool hasPrefix = decoration.prefix != null || decoration.prefixText != null ;
2264
- final bool hasSuffix = decoration.suffix != null || decoration.suffixText != null ;
2265
-
2266
- Widget ? input = widget.child;
2267
- // If at least two out of the three are visible, it needs semantics sort
2268
- // order.
2269
- final bool needsSemanticsSortOrder = widget._labelShouldWithdraw && (input != null ? (hasPrefix || hasSuffix) : (hasPrefix && hasSuffix));
2270
-
2271
- final Widget ? prefix = hasPrefix
2272
- ? _AffixText (
2273
- labelIsFloating: widget._labelShouldWithdraw,
2274
- text: decoration.prefixText,
2275
- style: MaterialStateProperty .resolveAs (decoration.prefixStyle, materialState) ?? hintStyle,
2276
- semanticsSortKey: needsSemanticsSortOrder ? _kPrefixSemanticsSortOrder : null ,
2277
- semanticsTag: _kPrefixSemanticsTag,
2278
- child: decoration.prefix,
2279
- )
2280
- : null ;
2281
-
2282
- final Widget ? suffix = hasSuffix
2283
- ? _AffixText (
2284
- labelIsFloating: widget._labelShouldWithdraw,
2285
- text: decoration.suffixText,
2286
- style: MaterialStateProperty .resolveAs (decoration.suffixStyle, materialState) ?? hintStyle,
2287
- semanticsSortKey: needsSemanticsSortOrder ? _kSuffixSemanticsSortOrder : null ,
2288
- semanticsTag: _kSuffixSemanticsTag,
2289
- child: decoration.suffix,
2290
- )
2291
- : null ;
2292
-
2293
- if (input != null && needsSemanticsSortOrder) {
2294
- input = Semantics (
2295
- sortKey: _kInputSemanticsSortOrder,
2296
- child: input,
2221
+ final Widget ? prefix = decoration.prefix == null && decoration.prefixText == null ? null :
2222
+ _AffixText (
2223
+ labelIsFloating: widget._labelShouldWithdraw,
2224
+ text: decoration.prefixText,
2225
+ style: MaterialStateProperty .resolveAs (decoration.prefixStyle, materialState) ?? hintStyle,
2226
+ child: decoration.prefix,
2297
2227
);
2298
- }
2228
+
2229
+ final Widget ? suffix = decoration.suffix == null && decoration.suffixText == null ? null :
2230
+ _AffixText (
2231
+ labelIsFloating: widget._labelShouldWithdraw,
2232
+ text: decoration.suffixText,
2233
+ style: MaterialStateProperty .resolveAs (decoration.suffixStyle, materialState) ?? hintStyle,
2234
+ child: decoration.suffix,
2235
+ );
2236
+
2299
2237
2300
2238
final bool decorationIsDense = decoration.isDense ?? false ;
2301
2239
final double iconSize = decorationIsDense ? 18.0 : 24.0 ;
@@ -2334,9 +2272,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2334
2272
color: _getPrefixIconColor (themeData, defaults),
2335
2273
size: iconSize,
2336
2274
),
2337
- child: Semantics (
2338
- child: decoration.prefixIcon,
2339
- ),
2275
+ child: decoration.prefixIcon! ,
2340
2276
),
2341
2277
),
2342
2278
),
@@ -2361,9 +2297,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2361
2297
color: _getSuffixIconColor (themeData, defaults),
2362
2298
size: iconSize,
2363
2299
),
2364
- child: Semantics (
2365
- child: decoration.suffixIcon,
2366
- ),
2300
+ child: decoration.suffixIcon! ,
2367
2301
),
2368
2302
),
2369
2303
),
@@ -2440,7 +2374,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2440
2374
isDense: decoration.isDense,
2441
2375
visualDensity: themeData.visualDensity,
2442
2376
icon: icon,
2443
- input: input ,
2377
+ input: widget.child ,
2444
2378
label: label,
2445
2379
hint: hint,
2446
2380
prefix: prefix,
0 commit comments