Skip to content

Add custom semantic label for progress #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jamontes79
Copy link

With this improvement the library allows the user to provide a custom semantic label for the progress indicator and announce it in his own language.

Before this change, it was always announced in English.

… indicator semantics

This commit introduces a new optional parameter `progressSemantic` to the `IntroductionScreen` widget. This parameter allows developers to provide a custom semantic label for the progress indicator (dots or custom progress).

If `progressSemantic` is provided, it will be used to generate the semantic label. Otherwise, a default label "Page {currentPage} of {totalPages}" will be used.

This change enhances accessibility by allowing developers to provide more contextually relevant information to users relying on screen readers.
The ternary operator in the `progressSemantic` call within the `DotsIndicator` widget has been simplified. Instead of checking if `widget.progressSemantic` is not null and then calling it, it now uses the null-aware operator `?.` for a more concise and readable conditional call.

The unused import `dart:nativewrappers/_internal/vm/lib/ffi_allocation_patch.dart` has also been removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant