Reverts: flutter/flutter#149130 Initiated by: Piinks Reason for reverting: Google testing did not run on this PR and multiple semantics screen shots from internal testing look incorrect. Original PR Author: TahaTesser Reviewed By: {goderbauer} This change reverts the following previous change: fixes [AlertDialog content semantics merged](https://github.com/flutter/flutter/issues/147574) ### 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 MaterialApp( debugShowCheckedModeBanner: false, // showSemanticsDebugger: true, home: Scaffold( body: SafeArea( child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ const Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text('Some text'), Text('More text'), ], ), Builder(builder: (BuildContext context) { return ElevatedButton( onPressed: () { showDialog<void>( context: context, builder: (BuildContext context) { return AlertDialog( title: const Text('Dialog Title'), content: const Column( children: <Widget>[ Text('Some text'), Text('More text'), ], ), actions: <Widget>[ TextButton( onPressed: () { Navigator.of(context).pop(); }, child: const Text('Close'), ), ], ); }, ); }, child: const Text('Open Dialog'), ); }), ], ), ), ), ), ); } } ``` </details> ### Before vs After  
This commit is contained in:
@@ -812,7 +812,6 @@ class AlertDialog extends StatelessWidget {
|
||||
style: contentTextStyle ?? dialogTheme.contentTextStyle ?? defaults.contentTextStyle!,
|
||||
child: Semantics(
|
||||
container: true,
|
||||
explicitChildNodes: true,
|
||||
child: content,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1700,12 +1700,7 @@ void main() {
|
||||
theme: ThemeData(platform: TargetPlatform.iOS),
|
||||
home: const AlertDialog(
|
||||
title: Text('title'),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
Text('some content'),
|
||||
Text('more content'),
|
||||
],
|
||||
),
|
||||
content: Text('content'),
|
||||
actions: <Widget>[ TextButton(onPressed: null, child: Text('action')) ],
|
||||
),
|
||||
),
|
||||
@@ -1736,21 +1731,11 @@ void main() {
|
||||
// node 4.
|
||||
TestSemantics(
|
||||
id: 6,
|
||||
children: <TestSemantics>[
|
||||
TestSemantics(
|
||||
id: 7,
|
||||
label: 'some content',
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
TestSemantics(
|
||||
id: 8,
|
||||
label: 'more content',
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
],
|
||||
label: 'content',
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
TestSemantics(
|
||||
id: 9,
|
||||
id: 7,
|
||||
flags: <SemanticsFlag>[
|
||||
SemanticsFlag.isButton,
|
||||
SemanticsFlag.hasEnabledState,
|
||||
|
||||
Reference in New Issue
Block a user