mirror of
https://github.com/flutter/flutter
synced 2024-08-24 18:36:03 +00:00
![]() fixes [Screen reader is not announcing the selected date as selected on DatePicker](https://github.com/flutter/flutter/issues/143439) ### Descriptions - This fixes an issue where `CalendarDatePicker` doesn't announce selected date on desktop. - Add semantic label to describe the selected date is indeed "Selected". ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override MyHomePageState createState() => MyHomePageState(); } class MyHomePageState extends State<MyHomePage> { void _showDatePicker() async { await showDatePicker( context: context, initialDate: DateTime.now(), firstDate: DateTime(1900), lastDate: DateTime(2200), ); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title, style: const TextStyle(fontFamily: 'ProductSans')), ), body: const Center( child: Text('Click the button to show date picker.'), ), floatingActionButton: FloatingActionButton( onPressed: _showDatePicker, tooltip: 'Show date picker', child: const Icon(Icons.edit_calendar), ), ); } } // import 'package:flutter/material.dart'; // void main() => runApp(const MyApp()); // class MyApp extends StatelessWidget { // const MyApp({super.key}); // @override // Widget build(BuildContext context) { // return MaterialApp( // debugShowCheckedModeBanner: false, // home: Scaffold( // body: Center( // child: CalendarDatePicker( // initialDate: DateTime.now(), // firstDate: DateTime(2020), // lastDate: DateTime(2050), // onDateChanged: (date) { // print(date); // }, // ), // ), // ), // ); // } // } ``` </details> ### Before https://github.com/flutter/flutter/assets/48603081/c82e1f15-f067-4865-8a5a-1f3c0c8d91da ### After https://github.com/flutter/flutter/assets/48603081/193d9e26-df9e-4d89-97ce-265c3d564607 |
||
---|---|---|
.. | ||
flutter | ||
flutter_driver | ||
flutter_goldens | ||
flutter_localizations | ||
flutter_test | ||
flutter_tools | ||
flutter_web_plugins | ||
fuchsia_remote_debug_protocol | ||
integration_test | ||
analysis_options.yaml |