@@ -2050,12 +2050,9 @@ class _HourMinuteTextFieldState extends State<_HourMinuteTextField> with Restora
2050
2050
2051
2051
final InputDecorationTheme inputDecorationTheme = timePickerTheme.inputDecorationTheme ?? defaultTheme.inputDecorationTheme;
2052
2052
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
2055
2054
// 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;
2059
2056
2060
2057
// Because the fill color is specified in both the inputDecorationTheme and
2061
2058
// the TimePickerTheme, if there's one in the user's input decoration theme,
@@ -2102,26 +2099,29 @@ class _HourMinuteTextFieldState extends State<_HourMinuteTextField> with Restora
2102
2099
data: MediaQuery .of (context).copyWith (textScaleFactor: 1 ),
2103
2100
child: UnmanagedRestorationScope (
2104
2101
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
+ ),
2125
2125
),
2126
2126
),
2127
2127
),
0 commit comments