How to specify stops in a gradient?

This Article is posted by seven.srikanth at 9/13/2019 4:26:53 AM



<p>Here is an example of how to specify stops inside a gradient. You gonna achieve the below output through this example. ![](https://fluttercentral.com/Uploads/19489858-09a4-4680-938a-0e64ce42c505.PNGwidth="50%height="auto]( Here is the code from main.dart file.</p> <p>color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;](color: #569cd6;](import color: #ce9178;]('package:flutter/material.dart'; color: #569cd6;](void color: #dcdcaa;](main() => color: #dcdcaa;](runApp(color: #4ec9b0;](MyApp()); color: #569cd6;](class color: #4ec9b0;](MyApp color: #569cd6;](extends color: #4ec9b0;](StatefulWidget { color: #569cd6;](@override color: #4ec9b0;](_MyAppState color: #dcdcaa;](createState() => color: #4ec9b0;](_MyAppState();} color: #569cd6;](class color: #4ec9b0;](_MyAppState color: #569cd6;](extends color: #4ec9b0;](State { color: #4ec9b0;](double padValue = color: #b5cea8;](0; color: #569cd6;](@override color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext context) { color: #c586c0;](return color: #4ec9b0;](MaterialApp( home: color: #4ec9b0;](Scaffold( appBar: color: #4ec9b0;](AppBar( title: color: #4ec9b0;](Text(color: #ce9178;]("Container Example"), ), body: color: #4ec9b0;](Container( margin: color: #4ec9b0;](EdgeInsets.color: #dcdcaa;](all(color: #b5cea8;](100.0), decoration: color: #4ec9b0;](BoxDecoration( gradient: color: #4ec9b0;](LinearGradient( tileMode: color: #4ec9b0;](TileMode.clamp, stops: [color: #b5cea8;](0.3,color: #b5cea8;](0.6,color: #b5cea8;](0.9], colors: [color: #4ec9b0;](Colors.orange, color: #4ec9b0;](Colors.red, color: #4ec9b0;](Colors.blue] ), shape: color: #4ec9b0;](BoxShape.rectangle, ), ) ), ); }} Thanks,Srikanth</p>


Tags: Multiple colors inside a Container;








0 Comments
Login to comment.
Recent Comments