Skip to main content
Logo Appt Light

Accessibility language on Flutter

When content is written in multiple languages, foreign words should ideally be indicated in their respective language. For example, you can indicate a French quote in a Dutch piece of content. This enables assistive technologies to use the right pronunciation.

With Flutter, the locale parameter of Text or TextSpan can be used to specify the locale for a piece of text. Multiple TextSpan elements can be combined to speak content in multiple languages.

/// Text implementation
Text(
  'Appt',
  locale: Locale.fromSubtags(languageCode: 'nl'),
);

/// TextSpan implementation
TextSpan(
  text: 'Appt',
  locale: Locale.fromSubtags(languageCode: 'nl'),
);

Feedback?

Let us know!