Skip to content

Semantics link:true does not work on web.  #134795

@jiahaog

Description

@jiahaog

Internal Bug: b/300247612

Is there an existing issue for this?

Steps to reproduce

This can be reproduced on dartpad with the code sample below.

Expected results

Wrapping a widget with

Semantics(
  link: true,
  child: Foo(),
)

should be labeled as a link.

Actual results

Instead, it's just labeled as a group.

Code sample

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

const Color darkBlue = Color.fromARGB(255, 18, 32, 47);

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark().copyWith(
        scaffoldBackgroundColor: darkBlue,
      ),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: MyWidget(),
        ),
      ),
    );
  }
}

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Semantics(
      link: true,
      child: Text(
        'Hello, World!',
        style: Theme.of(context).textTheme.headlineMedium,
      ),
    );
  }
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

This can be reproduced on dartpad Based on Flutter 3.13.4 Dart SDK 3.1.2

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: huggsy (g3)platform-webWeb applications specificallyteam-webOwned by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions