Created
June 23, 2021 11:49
-
-
Save Anirudhk07/e84f2dd17a58563164cef026a8c59c6f to your computer and use it in GitHub Desktop.
CSS to Flutter Linear Gradient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp( | |
| MaterialApp( | |
| home: MyWidget(), | |
| ), | |
| ); | |
| } | |
| class MyWidget extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| body: Container( | |
| padding: EdgeInsets.all(20), | |
| width: double.infinity, | |
| decoration: BoxDecoration( | |
| gradient: LinearGradient( | |
| begin: Alignment.centerRight, | |
| end: Alignment.centerLeft, | |
| colors: [Color(0xffab33b0),Color(0xff4d8cc2)] | |
| ) | |
| ), | |
| height: 1000, | |
| ) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment