Skip to content

Commit 84ad67f

Browse files
authored
Improve consistency of code snippets in basic.dart (#158015)
Updates `basic.dart` to use consistent doc snippets that follows the style from the [documentation on snippets](https://github.com/flutter/flutter/tree/master/dev/snippets#snippet-tool). Follow-up to: flutter/flutter#157227 (comment)
1 parent 2ce743d commit 84ad67f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/flutter/lib/src/widgets/basic.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ class Directionality extends _UbiquitousInheritedWidget {
302302
/// colorBlendMode: BlendMode.modulate
303303
/// )
304304
/// ```
305-
///
306305
/// {@end-tool}
307306
///
308307
/// Directly drawing an [Image] or [Color] with opacity is faster than using
@@ -559,6 +558,7 @@ class BackdropGroup extends InheritedWidget {
559558
/// {@youtube 560 315 https://www.youtube.com/watch?v=dYRs7Q1vfYI}
560559
///
561560
/// {@tool snippet}
561+
///
562562
/// If the [BackdropFilter] needs to be applied to an area that exactly matches
563563
/// its child, wraps the [BackdropFilter] with a clip widget that clips exactly
564564
/// to that child.
@@ -622,6 +622,7 @@ class BackdropGroup extends InheritedWidget {
622622
/// ```
623623
/// {@end-tool}
624624
/// {@tool snippet}
625+
///
625626
/// Instead consider the following approach which directly applies a blur
626627
/// to the child widget.
627628
///
@@ -633,7 +634,6 @@ class BackdropGroup extends InheritedWidget {
633634
/// );
634635
/// }
635636
/// ```
636-
///
637637
/// {@end-tool}
638638
///
639639
/// See also:
@@ -2132,6 +2132,7 @@ class Padding extends SingleChildRenderObjectWidget {
21322132
/// the width of this widget will always be twice its child's width.
21332133
///
21342134
/// {@tool snippet}
2135+
///
21352136
/// The [Align] widget in this example uses one of the defined constants from
21362137
/// [Alignment], [Alignment.topRight]. This places the [FlutterLogo] in the top
21372138
/// right corner of the parent blue [Container].
@@ -2163,6 +2164,7 @@ class Padding extends SingleChildRenderObjectWidget {
21632164
/// each other.
21642165
///
21652166
/// {@tool snippet}
2167+
///
21662168
/// The [Alignment] used in the following example defines two points:
21672169
///
21682170
/// * (0.2 * width of [FlutterLogo]/2 + width of [FlutterLogo]/2, 0.6 * height
@@ -2199,6 +2201,7 @@ class Padding extends SingleChildRenderObjectWidget {
21992201
/// {@end-tool}
22002202
///
22012203
/// {@tool snippet}
2204+
///
22022205
/// The [FractionalOffset] used in the following example defines two points:
22032206
///
22042207
/// * (0.2 * width of [FlutterLogo], 0.6 * height of [FlutterLogo]) = (12.0, 36.0)
@@ -2691,6 +2694,7 @@ class ConstrainedBox extends SingleChildRenderObjectWidget {
26912694
/// vertically:
26922695
///
26932696
/// {@tool snippet}
2697+
///
26942698
/// In the following snippet, the [Card] is guaranteed to be at least as tall as
26952699
/// its "natural" height. Unlike [UnconstrainedBox], it will become taller if
26962700
/// its "natural" height is smaller than 40 px. If the [Container] isn't high
@@ -7540,6 +7544,7 @@ class Semantics extends SingleChildRenderObjectWidget {
75407544
/// the user would not be able to be sure that they were related.
75417545
///
75427546
/// {@tool snippet}
7547+
///
75437548
/// This snippet shows how to use [MergeSemantics] to merge the semantics of
75447549
/// a [Checkbox] and [Text] widget.
75457550
///

0 commit comments

Comments
 (0)