@@ -1865,9 +1865,11 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
18651865 late final CurvedAnimation _floatingLabelAnimation;
18661866 late final AnimationController _shakingLabelController;
18671867 final _InputBorderGap _borderGap = _InputBorderGap ();
1868- static const OrdinalSortKey _kPrefixSemanticsSortOrder = OrdinalSortKey (0 );
1869- static const OrdinalSortKey _kInputSemanticsSortOrder = OrdinalSortKey (1 );
1870- static const OrdinalSortKey _kSuffixSemanticsSortOrder = OrdinalSortKey (2 );
1868+ // Provide a unique name to avoid mixing up sort order with sibling input
1869+ // decorators.
1870+ late final OrdinalSortKey _prefixSemanticsSortOrder = OrdinalSortKey (0 , name: hashCode.toString ());
1871+ late final OrdinalSortKey _inputSemanticsSortOrder = OrdinalSortKey (1 , name: hashCode.toString ());
1872+ late final OrdinalSortKey _suffixSemanticsSortOrder = OrdinalSortKey (2 , name: hashCode.toString ());
18711873 static const SemanticsTag _kPrefixSemanticsTag = SemanticsTag ('_InputDecoratorState.prefix' );
18721874 static const SemanticsTag _kSuffixSemanticsTag = SemanticsTag ('_InputDecoratorState.suffix' );
18731875
@@ -2219,7 +2221,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
22192221 labelIsFloating: widget._labelShouldWithdraw,
22202222 text: decoration.prefixText,
22212223 style: MaterialStateProperty .resolveAs (decoration.prefixStyle, materialState) ?? hintStyle,
2222- semanticsSortKey: needsSemanticsSortOrder ? _kPrefixSemanticsSortOrder : null ,
2224+ semanticsSortKey: needsSemanticsSortOrder ? _prefixSemanticsSortOrder : null ,
22232225 semanticsTag: _kPrefixSemanticsTag,
22242226 child: decoration.prefix,
22252227 )
@@ -2230,15 +2232,15 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
22302232 labelIsFloating: widget._labelShouldWithdraw,
22312233 text: decoration.suffixText,
22322234 style: MaterialStateProperty .resolveAs (decoration.suffixStyle, materialState) ?? hintStyle,
2233- semanticsSortKey: needsSemanticsSortOrder ? _kSuffixSemanticsSortOrder : null ,
2235+ semanticsSortKey: needsSemanticsSortOrder ? _suffixSemanticsSortOrder : null ,
22342236 semanticsTag: _kSuffixSemanticsTag,
22352237 child: decoration.suffix,
22362238 )
22372239 : null ;
22382240
22392241 if (input != null && needsSemanticsSortOrder) {
22402242 input = Semantics (
2241- sortKey: _kInputSemanticsSortOrder ,
2243+ sortKey: _inputSemanticsSortOrder ,
22422244 child: input,
22432245 );
22442246 }
0 commit comments