Unverified Commit 0174af8b authored by Haeseok Lee's avatar Haeseok Lee Committed by GitHub

Update LinearGradient docs (#63604)

parent 1de673bc
...@@ -330,22 +330,23 @@ abstract class Gradient { ...@@ -330,22 +330,23 @@ abstract class Gradient {
/// Typically this class is used with [BoxDecoration], which does the painting. /// Typically this class is used with [BoxDecoration], which does the painting.
/// To use a [LinearGradient] to paint on a canvas directly, see [createShader]. /// To use a [LinearGradient] to paint on a canvas directly, see [createShader].
/// ///
/// {@tool snippet} /// {@tool dartpad --template=stateless_widget_material}
///
/// This sample draws a picture that looks like vertical window shades by having /// This sample draws a picture that looks like vertical window shades by having
/// a [Container] display a [BoxDecoration] with a [LinearGradient]. /// a [Container] display a [BoxDecoration] with a [LinearGradient].
/// ///
/// ```dart /// ```dart
/// Container( /// Widget build(BuildContext context) {
/// decoration: BoxDecoration( /// return Container(
/// gradient: LinearGradient( /// decoration: BoxDecoration(
/// begin: Alignment.topLeft, /// gradient: LinearGradient(
/// end: Alignment(0.8, 0.0), // 10% of the width, so there are ten blinds. /// begin: Alignment.topLeft,
/// colors: [const Color(0xFFFFFFEE), const Color(0xFF999999)], // whitish to gray /// end: Alignment(0.8, 0.0), // 10% of the width, so there are ten blinds.
/// tileMode: TileMode.repeated, // repeats the gradient over the canvas /// colors: [const Color(0xffee0000), const Color(0xffeeee00)], // red to yellow
/// ), /// tileMode: TileMode.repeated, // repeats the gradient over the canvas
/// ), /// ),
/// ) /// ),
/// );
/// }
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
/// ///
......
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