Skip to content

Nonfunctioning semantic announcements on Ubuntu desktop #172023

@ashuntu

Description

@ashuntu

Steps to reproduce

Flutter on Ubuntu Linux desktop doesn't seem to support semantic announcements or live regions. SemanticsService.isAnnounceSupported() outputs true.

  1. Create the default new Flutter application via VSCode
  2. Add a SemanticsService.announce to the _incrementCounter function
  3. Enable the screen reader on Ubuntu desktop
  4. Run the app
  5. Press the + button to increment the counter
  6. Observe the screen reader not announcing anything

In my example below, I've also added a live region and the output of SemanticsService.isAnnounceSupported().

I have no special settings for the screen reader or Ubuntu, everything should be near defaults.

Expected results

The screen reader should read aloud when a live region changes content, or when a semantics announcement is manually triggered.

Actual results

No announcements are read by the screen reader.

Code sample

Code sample

Slightly modified version of the default new application via VSCode:

import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });

    SemanticsService.announce(
      'Incrementing counter',
      TextDirection.ltr,
    ); // doesn't actually say anything
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('You have pushed the button this many times:'),
            Semantics(
              liveRegion:
                  true, // doesn't actually result in any expected behavior
              child: Text(
                '$_counter',
                style: Theme.of(context).textTheme.headlineMedium,
              ),
            ),
            Text(
              'Supports announce: ${SemanticsService.isAnnounceSupported()}', // outputs true
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

Screenshots or Video

Logs

Logs (txt file)

Flutter Doctor output

Doctor output
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.32.5, on Ubuntu 24.04.2 LTS 6.11.0-29-generic, locale en_US.UTF-8) [27ms]
    • Flutter version 3.32.5 on channel stable at /home/[USERNAME]/fvm/versions/3.32.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fcf2c11572 (2 weeks ago), 2025-06-24 11:44:07 -0700
    • Engine revision dd93de6fb1
    • Dart version 3.8.1
    • DevTools version 2.45.1

[✗] Android toolchain - develop for Android devices [33ms]
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [12ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop [117ms]
    • Ubuntu clang version 18.1.3 (1ubuntu1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1
    ! Unable to access driver information using 'eglinfo'.
      It is likely available from your distribution (e.g.: apt install mesa-utils)

[!] Android Studio (not installed) [10ms]
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).

[✓] VS Code (version unknown) [10ms]
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    ✗ Unable to determine VS Code version.

[✓] Connected device (1 available) [37ms]
    • Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.2 LTS 6.11.0-29-generic

[✓] Network resources [178ms]
    • All expected network resources are available.

! Doctor found issues in 3 categories.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)found in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyr: fixedIssue is closed as already fixed in a newer versionteam-linuxOwned by the Linux platform teamtriaged-linuxTriaged by the Linux platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions