@@ -17,6 +17,7 @@ import 'package:ouds_core/components/common/ouds_icon_status.dart';
1717import 'package:ouds_core/components/progress_indicator/internal/ouds_progress_indicator_status_modifier.dart' ;
1818import 'package:ouds_core/components/progress_indicator/internal/ouds_progress_indicator_style_modifier.dart' ;
1919import 'package:ouds_core/components/progress_indicator/internal/ouds_progress_indicator_utils.dart' ;
20+ import 'package:ouds_core/l10n/gen/ouds_localizations.dart' ;
2021import 'package:ouds_theme_contract/ouds_theme.dart' ;
2122
2223/// Defines whether a progress indicator shows a known progress value
@@ -196,8 +197,12 @@ class _OudsCircularProgressIndicatorState
196197 required double gapSize,
197198 required StrokeCap strokeCap,
198199 }) {
200+ final localizations = OudsLocalizations .of (context);
201+ final semanticsLabel =
202+ '${widget .semanticLabel } , ${OudsProgressIndicatorUtils .buildStatusSemanticsLabel (localizations , widget .status ) ?? '' }, ' ;
203+
199204 return CircularProgressIndicator (
200- semanticsLabel: widget.semanticLabel ,
205+ semanticsLabel: semanticsLabel ,
201206 year2023: false ,
202207 constraints: BoxConstraints (
203208 minWidth: defaultSize,
@@ -299,33 +304,39 @@ class _OudsLinearProgressIndicatorState
299304
300305 @override
301306 Widget build (BuildContext context) {
302- return Column (
303- spacing: OudsTheme .of (
304- context,
305- ).componentsTokens (context).progressIndicator.spacePaddingBlock,
306- children: [
307- _buildLinearProgressIndicator (),
308- Align (
309- alignment: OudsProgressIndicatorUtils .getTextAlign (
310- widget.helperTextAlignment,
311- ),
312- child: Text (
313- OudsProgressIndicatorUtils .buildHelperText (
314- widget.percentage,
315- widget.spaceBeforePercentage,
316- widget.progress,
317- widget.helperText,
307+ return MergeSemantics (
308+ child: Column (
309+ spacing: OudsTheme .of (
310+ context,
311+ ).componentsTokens (context).progressIndicator.spacePaddingBlock,
312+ children: [
313+ _buildLinearProgressIndicator (),
314+ Align (
315+ alignment: OudsProgressIndicatorUtils .getTextAlign (
316+ widget.helperTextAlignment,
318317 ),
319- style: OudsTheme .of (context).typographyTokens
320- .typeLabelDefaultMedium (context)
321- .copyWith (
322- color: OudsTheme .of (
323- context,
324- ).colorScheme (context).contentDefault,
325- ),
318+ child: widget.percentage
319+ ? ExcludeSemantics (child: _buildHelperTextWidget ())
320+ : _buildHelperTextWidget (),
321+ ),
322+ ],
323+ ),
324+ );
325+ }
326+
327+ Widget _buildHelperTextWidget () {
328+ return Text (
329+ OudsProgressIndicatorUtils .buildHelperText (
330+ widget.percentage,
331+ widget.spaceBeforePercentage,
332+ widget.progress,
333+ widget.helperText,
334+ ),
335+ style: OudsTheme .of (context).typographyTokens
336+ .typeLabelDefaultMedium (context)
337+ .copyWith (
338+ color: OudsTheme .of (context).colorScheme (context).contentDefault,
326339 ),
327- ),
328- ],
329340 );
330341 }
331342
@@ -410,9 +421,14 @@ class _OudsLinearProgressIndicatorState
410421 required double gapSize,
411422 required BorderRadiusGeometry borderRadius,
412423 }) {
424+ final localizations = OudsLocalizations .of (context);
425+
426+ final semanticsLabel =
427+ '${widget .semanticLabel } , ${OudsProgressIndicatorUtils .buildStatusSemanticsLabel (localizations , widget .status ) ?? '' }, ' ;
428+
413429 return LinearProgressIndicator (
414430 minHeight: minHeight,
415- semanticsLabel: widget.semanticLabel ,
431+ semanticsLabel: semanticsLabel ,
416432 year2023: false ,
417433 value: value,
418434 valueColor: AlwaysStoppedAnimation <Color >(indicatorColor),
0 commit comments