Skip to content

Instantly share code, notes, and snippets.

@Geeky-star
Created June 16, 2020 16:17
Show Gist options
  • Save Geeky-star/c87d55617ffdbcb497664f5b34331751 to your computer and use it in GitHub Desktop.
Save Geeky-star/c87d55617ffdbcb497664f5b34331751 to your computer and use it in GitHub Desktop.
bGEwzWX
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: MyWidget(),
),
);
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Stack(
children:<Widget>[
Align(
alignment: Alignment.center,
child: Container(
height: 400,
width: 400,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.blue, Colors.green
],
),
),
),
),
SizedBox(height: 10,),
Align(
alignment: Alignment.center,
child: Container(
padding: EdgeInsets.only(left: 40),
height: 300,
width: 300,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.yellow, Colors.orange
],
),
),
),
),
SizedBox(height: 10,),
Align(
alignment: Alignment.center,
child: Container(
padding: EdgeInsets.only(left: 60),
height: 200,
width: 200,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.pink, Colors.red
],
),
),
),
),
Align(
alignment: Alignment.center,
child: Container(
padding: EdgeInsets.only(top: 70, left: 80),
height: 100,
width: 100,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.purple, Colors.pink[400]
],
),
),
),
),
Align(
alignment: Alignment.center,
child: Container(
padding: EdgeInsets.only(top: 70, left: 80),
height: 50,
width: 50,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.blue, Colors.blue[800]
],
),
),
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment