[Reland] - Enable explicitChildNodes for the AlertDialog content (#149597)
Fixes the semantics of AlertDialog.
This commit is contained in:
@@ -812,6 +812,7 @@ class AlertDialog extends StatelessWidget {
|
||||
style: contentTextStyle ?? dialogTheme.contentTextStyle ?? defaults.contentTextStyle!,
|
||||
child: Semantics(
|
||||
container: true,
|
||||
explicitChildNodes: true,
|
||||
child: content,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1722,7 +1722,12 @@ void main() {
|
||||
theme: ThemeData(platform: TargetPlatform.iOS),
|
||||
home: const AlertDialog(
|
||||
title: Text('title'),
|
||||
content: Text('content'),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
Text('some content'),
|
||||
Text('more content'),
|
||||
],
|
||||
),
|
||||
actions: <Widget>[ TextButton(onPressed: null, child: Text('action')) ],
|
||||
),
|
||||
),
|
||||
@@ -1753,11 +1758,21 @@ void main() {
|
||||
// node 4.
|
||||
TestSemantics(
|
||||
id: 6,
|
||||
label: 'content',
|
||||
textDirection: TextDirection.ltr,
|
||||
children: <TestSemantics>[
|
||||
TestSemantics(
|
||||
id: 7,
|
||||
label: 'some content',
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
TestSemantics(
|
||||
id: 8,
|
||||
label: 'more content',
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
],
|
||||
),
|
||||
TestSemantics(
|
||||
id: 7,
|
||||
id: 9,
|
||||
flags: <SemanticsFlag>[
|
||||
SemanticsFlag.isButton,
|
||||
SemanticsFlag.hasEnabledState,
|
||||
|
||||
Reference in New Issue
Block a user