Skip to content

Checkbox, Radio and Switch not shown with appropriate a11y roles in Linux #98895

@robert-ancell

Description

@robert-ancell

Steps to Reproduce

  1. Execute flutter run on the code sample
  2. Open accerciser.
  3. Find the Checkbox/Radio/Switch objects in accerciser.

Expected results:

Suitable roles are shown for these objects.

Actual results:

All objects are shown with default role (currently frame).

Code sample
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

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

class _MyHomePageState extends State<MyHomePage> {
  bool? _checkValue = false;
  int _selectedRadio = 1;
  bool _switchValue = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Checkbox(
                value: _checkValue,
                onChanged: (bool? value) =>
                    setState(() => _checkValue = value)),
            Radio<int>(
                value: 0,
                groupValue: _selectedRadio,
                onChanged: (int? value) => setState(() => _selectedRadio = 0)),
            Radio<int>(
                value: 1,
                groupValue: _selectedRadio,
                onChanged: (int? value) => setState(() => _selectedRadio = 1)),
            Radio<int>(
                value: 2,
                groupValue: _selectedRadio,
                onChanged: (int? value) => setState(() => _selectedRadio = 2)),
            Switch(
                value: _switchValue,
                onChanged: (bool value) =>
                    setState(() => _switchValue = value)),
          ],
        ),
      ),
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)f: material designflutter/packages/flutter/material repository.found in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11frameworkflutter/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 version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions