Unverified Commit ca84cc23 authored by Ayush Bherwani's avatar Ayush Bherwani Committed by GitHub

[MergeSemantics] added code snippet (#68123)

parent f26fbb6b
......@@ -6960,6 +6960,25 @@ class Semantics extends SingleChildRenderObjectWidget {
/// would be presented as a separate feature than the checkbox, and
/// 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
/// semantics, the result may be nonsensical. For example, a subtree
/// with a checked checkbox and an unchecked checkbox will be
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment