From 5b7434fb2a414885e398bbb404c0010814e5dd5d Mon Sep 17 00:00:00 2001 From: Nishant Srivastava Date: Fri, 29 Sep 2017 22:47:15 -0700 Subject: [PATCH] added gradient to using_gradient example --- using_gradient/lib/main.dart | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/using_gradient/lib/main.dart b/using_gradient/lib/main.dart index 4ed3cc3..55f8036 100644 --- a/using_gradient/lib/main.dart +++ b/using_gradient/lib/main.dart @@ -13,12 +13,20 @@ void main() { ), // Body body: new Container( - // Center the content - child: new Center( - // Add Text - child: new Text( - "Hello World!", + // Center the content + child: new Center( + // Add Text + child: new Text( + "Hello World!", + ), ), - ), - )))); + decoration: new BoxDecoration( + // Add Gradient + gradient: new LinearGradient( + colors: [Colors.lightBlueAccent, Colors.blueAccent], + begin: const FractionalOffset(0.0, 0.0), + end: const FractionalOffset(0.6, 0.0), + stops: [0.0, 0.6], + tileMode: TileMode.clamp), + ))))); }