forked from md-siam/widget_of_the_day
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlineargradient.dart
49 lines (47 loc) · 1.39 KB
/
lineargradient.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import 'package:flutter/material.dart';
class MyLinearGradient extends StatelessWidget {
const MyLinearGradient({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('LinearGradient'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(15),
child: Container(
height: 150,
width: 300,
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Colors.red, Colors.blue, Colors.green])),
),
),
Container(
height: 150,
width: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
stops: [0.2, 0.5, 0.7, 1],
colors: [
Colors.red,
Colors.purple,
Colors.yellow,
Colors.blue
],
),
),
),
],
),
),
);
}
}