Skip to content

Instantly share code, notes, and snippets.

@Anirudhk07
Created June 23, 2021 11:49
Show Gist options
  • Select an option

  • Save Anirudhk07/e84f2dd17a58563164cef026a8c59c6f to your computer and use it in GitHub Desktop.

Select an option

Save Anirudhk07/e84f2dd17a58563164cef026a8c59c6f to your computer and use it in GitHub Desktop.
CSS to Flutter Linear Gradient
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