forked from anncode1/Curso-de-Flutter-Avanzado-en-Platzi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile_background.dart
39 lines (36 loc) · 1.08 KB
/
profile_background.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
import 'package:flutter/material.dart';
class ProfileBackground extends StatelessWidget {
@override
Widget build(BuildContext context) {
double screenHeight = MediaQuery.of(context).size.height;
double screenWidth = MediaQuery.of(context).size.width;
return Container(
width: screenWidth,
height: screenHeight * 0.45,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color(0xFF4268D3),
Color(0xFF584CD1)
],
begin: FractionalOffset(0.2, 0.0),
end: FractionalOffset(1.0, 0.6),
stops: [0.0, 0.6],
tileMode: TileMode.clamp
)
),
child: FittedBox(
fit: BoxFit.none,
alignment: Alignment(-1.5, -0.8),
child: Container(
width: screenHeight,
height: screenHeight,
decoration: BoxDecoration(
color: Color.fromRGBO(0, 0, 0, 0.05),
borderRadius: BorderRadius.circular(screenHeight / 2)
),
),
),
);
}
}