Unverified Commit c7bb476b authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Update to Container Sample Code in API Docs (#29053)

* Updating sample code for container to match forthcoming diagrams in assets-for-api-docs.

* Analyzer unhappy with Colors, fixing.

* Resolving push conflict (hopefully)

* Analyzer fix.

* Corrected color to match brand gallery

* Fixing wrap and indentation.
parent ddee4f71
...@@ -184,7 +184,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -184,7 +184,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// ///
/// {@tool sample} /// {@tool sample}
/// ///
/// This example shows a 48x48 green square (placed inside a [Center] widget in /// This example shows a 48x48 amber square (placed inside a [Center] widget in
/// case the parent widget has its own opinions regarding the size that the /// case the parent widget has its own opinions regarding the size that the
/// [Container] should take), with a margin so that it stays away from /// [Container] should take), with a margin so that it stays away from
/// neighboring widgets: /// neighboring widgets:
...@@ -193,7 +193,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -193,7 +193,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// Center( /// Center(
/// child: Container( /// child: Container(
/// margin: const EdgeInsets.all(10.0), /// margin: const EdgeInsets.all(10.0),
/// color: const Color(0xFF00FF00), /// color: Colors.amber[600],
/// width: 48.0, /// width: 48.0,
/// height: 48.0, /// height: 48.0,
/// ), /// ),
...@@ -206,9 +206,8 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -206,9 +206,8 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// The [constraints] are set to fit the font size plus ample headroom /// The [constraints] are set to fit the font size plus ample headroom
/// vertically, while expanding horizontally to fit the parent. The [padding] is /// vertically, while expanding horizontally to fit the parent. The [padding] is
/// used to make sure there is space between the contents and the text. The /// used to make sure there is space between the contents and the text. The
/// `color` makes the box teal. The [alignment] causes the [child] to be /// [color] makes the box blue. The [alignment] causes the [child] to be
/// centered in the box. The [foregroundDecoration] overlays a nine-patch image /// centered in the box. Finally, the [transform] applies a slight rotation to the
/// onto the text. Finally, the [transform] applies a slight rotation to the
/// entire contraption to complete the effect. /// entire contraption to complete the effect.
/// ///
/// ```dart /// ```dart
...@@ -217,15 +216,13 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -217,15 +216,13 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// height: Theme.of(context).textTheme.display1.fontSize * 1.1 + 200.0, /// height: Theme.of(context).textTheme.display1.fontSize * 1.1 + 200.0,
/// ), /// ),
/// padding: const EdgeInsets.all(8.0), /// padding: const EdgeInsets.all(8.0),
/// color: Colors.teal.shade700, /// color: Colors.blue[600],
/// alignment: Alignment.center, /// alignment: Alignment.center,
/// child: Text('Hello World', style: Theme.of(context).textTheme.display1.copyWith(color: Colors.white)), /// child: Text('Hello World',
/// foregroundDecoration: BoxDecoration( /// style: Theme.of(context)
/// image: DecorationImage( /// .textTheme
/// image: NetworkImage('https://www.example.com/images/frame.png'), /// .display1
/// centerSlice: Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), /// .copyWith(color: Colors.white)),
/// ),
/// ),
/// transform: Matrix4.rotationZ(0.1), /// transform: Matrix4.rotationZ(0.1),
/// ) /// )
/// ``` /// ```
......
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