@@ -2050,12 +2050,9 @@ class _HourMinuteTextFieldState extends State<_HourMinuteTextField> with Restora
20502050
20512051 final InputDecorationTheme inputDecorationTheme = timePickerTheme.inputDecorationTheme ?? defaultTheme.inputDecorationTheme;
20522052 InputDecoration inputDecoration = const InputDecoration ().applyDefaults (inputDecorationTheme);
2053- // If screen reader is in use, make the hint text say hours/minutes.
2054- // Otherwise, remove the hint text when focused because the centered cursor
2053+ // Remove the hint text when focused because the centered cursor
20552054 // appears odd above the hint text.
2056- final String ? hintText = MediaQuery .accessibleNavigationOf (context) || View .of (context).platformDispatcher.semanticsEnabled
2057- ? widget.semanticHintText
2058- : (focusNode.hasFocus ? null : _formattedValue);
2055+ final String ? hintText = focusNode.hasFocus ? null : _formattedValue;
20592056
20602057 // Because the fill color is specified in both the inputDecorationTheme and
20612058 // the TimePickerTheme, if there's one in the user's input decoration theme,
@@ -2102,26 +2099,29 @@ class _HourMinuteTextFieldState extends State<_HourMinuteTextField> with Restora
21022099 data: MediaQuery .of (context).copyWith (textScaleFactor: 1 ),
21032100 child: UnmanagedRestorationScope (
21042101 bucket: bucket,
2105- child: TextFormField (
2106- restorationId: 'hour_minute_text_form_field' ,
2107- autofocus: widget.autofocus ?? false ,
2108- expands: true ,
2109- maxLines: null ,
2110- inputFormatters: < TextInputFormatter > [
2111- LengthLimitingTextInputFormatter (2 ),
2112- ],
2113- focusNode: focusNode,
2114- textAlign: TextAlign .center,
2115- textInputAction: widget.inputAction,
2116- keyboardType: TextInputType .number,
2117- style: effectiveStyle,
2118- controller: controller.value,
2119- decoration: inputDecoration,
2120- validator: widget.validator,
2121- onEditingComplete: () => widget.onSavedSubmitted (controller.value.text),
2122- onSaved: widget.onSavedSubmitted,
2123- onFieldSubmitted: widget.onSavedSubmitted,
2124- onChanged: widget.onChanged,
2102+ child: Semantics (
2103+ label: widget.semanticHintText,
2104+ child: TextFormField (
2105+ restorationId: 'hour_minute_text_form_field' ,
2106+ autofocus: widget.autofocus ?? false ,
2107+ expands: true ,
2108+ maxLines: null ,
2109+ inputFormatters: < TextInputFormatter > [
2110+ LengthLimitingTextInputFormatter (2 ),
2111+ ],
2112+ focusNode: focusNode,
2113+ textAlign: TextAlign .center,
2114+ textInputAction: widget.inputAction,
2115+ keyboardType: TextInputType .number,
2116+ style: effectiveStyle,
2117+ controller: controller.value,
2118+ decoration: inputDecoration,
2119+ validator: widget.validator,
2120+ onEditingComplete: () => widget.onSavedSubmitted (controller.value.text),
2121+ onSaved: widget.onSavedSubmitted,
2122+ onFieldSubmitted: widget.onSavedSubmitted,
2123+ onChanged: widget.onChanged,
2124+ ),
21252125 ),
21262126 ),
21272127 ),
0 commit comments