flutter / flutter/flutter

[a11y] [Android] TalkBack does not announce Table / DataTable due to missing Role.TABLE mapping in Android embedding

Open
#190,542 6 comments 0 reactions 1 assignee Claimed by @gmackall View on GitHub
a: accessibility customer: google fyi-accessibility P1 platform-android team-android triaged-android
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

Reference: b/238751476

### Steps to reproduce

1. Create a Flutter application that displays a DataTable or Table widget with multiple columns and rows of data.
2. Install and launch the application on an Android device or emulator with Android TalkBack enabled in the accessibility settings.
3. Move TalkBack focus onto the table container itself.

### Expected results

When TalkBack focuses on the table container, it should announce that the widget is a table along with its total column and row count (for example, "Table, 2 columns and 2 rows").

### Code sample

import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: DataTableAccessibilityTest()));

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('DataTable TalkBack Accessibility Test'),
),
body: Center(
child: DataTable(
columns: const [
DataColumn(label: Text('Item')),
DataColumn(label: Text('Price')),
],
rows: const [
DataRow(
cells: [
DataCell(Text('Apple')),
DataCell(Text('\$1.00')),
],
),
DataRow(
cells: [
DataCell(Text('Banana')),
DataCell(Text('\$0.50')),
],
),
],
),
),
);
}
}

### Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

### Logs

Logs

```console
[Paste your logs here]
```

### Flutter Doctor output

Doctor output

```console
[Paste your output here]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.