diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 431ee703c8..cfb1f3333f 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -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: [ +/// 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