[MergeSemantics] added code snippet (#68123)
This commit is contained in:
parent
f26fbb6bdd
commit
ca84cc235c
@ -6960,6 +6960,25 @@ class Semantics extends SingleChildRenderObjectWidget {
|
|||||||
/// would be presented as a separate feature than the checkbox, and
|
/// would be presented as a separate feature than the checkbox, and
|
||||||
/// the user would not be able to be sure that they were related.
|
/// the user would not be able to be sure that they were related.
|
||||||
///
|
///
|
||||||
|
/// {@tool snippet}
|
||||||
|
/// This snippet shows how to use [MergeSemantics] to merge the semantics of
|
||||||
|
/// a [Checkbox] and [Text] widget.
|
||||||
|
///
|
||||||
|
/// ```dart
|
||||||
|
/// MergeSemantics(
|
||||||
|
/// child: Row(
|
||||||
|
/// children: <Widget>[
|
||||||
|
/// Checkbox(
|
||||||
|
/// value: true,
|
||||||
|
/// onChanged: (bool value) => null,
|
||||||
|
/// ),
|
||||||
|
/// const Text("Settings"),
|
||||||
|
/// ],
|
||||||
|
/// ),
|
||||||
|
/// )
|
||||||
|
/// ```
|
||||||
|
/// {@end-tool}
|
||||||
|
///
|
||||||
/// Be aware that if two nodes in the subtree have conflicting
|
/// Be aware that if two nodes in the subtree have conflicting
|
||||||
/// semantics, the result may be nonsensical. For example, a subtree
|
/// semantics, the result may be nonsensical. For example, a subtree
|
||||||
/// with a checked checkbox and an unchecked checkbox will be
|
/// with a checked checkbox and an unchecked checkbox will be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user