1
1
import 'dart:ui' ;
2
2
3
3
import 'package:flutter/material.dart' ;
4
+ import 'package:flutter_meditation_app/wavy/wavy_bottom_navigation_bar.dart' ;
5
+ import 'package:flutter_meditation_app/wavy/wavy_image.dart' ;
6
+ import 'package:flutter_meditation_app/widgets/container_black.dart' ;
4
7
import 'package:flutter_screenutil/flutter_screenutil.dart' ;
5
8
6
9
void main () => runApp (MyApp ());
@@ -20,8 +23,6 @@ class MyHomePage extends StatelessWidget {
20
23
ScreenUtil .init (context);
21
24
MediaQueryData mediaQueryData = MediaQuery .of (context);
22
25
double heightScreen = mediaQueryData.size.height;
23
- double paddingTop = mediaQueryData.padding.top;
24
- double paddingBottom = mediaQueryData.padding.bottom;
25
26
return Scaffold (
26
27
body: Container (
27
28
width: double .infinity,
@@ -63,6 +64,62 @@ class MyHomePage extends StatelessWidget {
63
64
),
64
65
),
65
66
_buildWidgetColumnText (),
67
+ Align (
68
+ alignment: Alignment .bottomCenter,
69
+ child: WavyBottomNavigationBar (),
70
+ ),
71
+ Align (
72
+ alignment: Alignment .bottomCenter,
73
+ child: Padding (
74
+ padding: EdgeInsets .only (bottom: 100. w),
75
+ child: Row (
76
+ mainAxisAlignment: MainAxisAlignment .spaceAround,
77
+ children: < Widget > [
78
+ Container (
79
+ decoration: BoxDecoration (
80
+ color: Colors .white.withOpacity (0.1 ),
81
+ shape: BoxShape .circle,
82
+ ),
83
+ width: 150. w,
84
+ height: 150. w,
85
+ child: Icon (
86
+ Icons .bubble_chart,
87
+ color: Colors .white.withOpacity (0.5 ),
88
+ size: ScreenUtil ().setWidth (96 ),
89
+ ),
90
+ ),
91
+ Container (
92
+ decoration: BoxDecoration (
93
+ color: Colors .white,
94
+ shape: BoxShape .circle,
95
+ border: Border .all (
96
+ color: Colors .grey[800 ],
97
+ width: 2 ,
98
+ ),
99
+ ),
100
+ width: 150. w,
101
+ height: 150. w,
102
+ child: Icon (
103
+ Icons .image,
104
+ color: Colors .grey[900 ],
105
+ ),
106
+ ),
107
+ Container (
108
+ decoration: BoxDecoration (
109
+ color: Colors .white.withOpacity (0.1 ),
110
+ shape: BoxShape .circle,
111
+ ),
112
+ width: 150. w,
113
+ height: 150. w,
114
+ child: Icon (
115
+ Icons .brightness_3,
116
+ color: Colors .white.withOpacity (0.5 ),
117
+ ),
118
+ ),
119
+ ],
120
+ ),
121
+ ),
122
+ ),
66
123
],
67
124
),
68
125
),
@@ -92,12 +149,15 @@ class MyHomePage extends StatelessWidget {
92
149
),
93
150
),
94
151
Expanded (
95
- child: Column (
96
- mainAxisAlignment: MainAxisAlignment .center,
97
- children: < Widget > [
98
- _buildWidgetTitle ('Calm' ),
99
- _buildWidgetSubtitle ('Slow down and relax' ),
100
- ],
152
+ child: Padding (
153
+ padding: EdgeInsets .only (bottom: 200. w),
154
+ child: Column (
155
+ mainAxisAlignment: MainAxisAlignment .center,
156
+ children: < Widget > [
157
+ _buildWidgetTitle ('Calm' ),
158
+ _buildWidgetSubtitle ('Slow down and relax' ),
159
+ ],
160
+ ),
101
161
),
102
162
),
103
163
],
@@ -128,100 +188,3 @@ class MyHomePage extends StatelessWidget {
128
188
);
129
189
}
130
190
}
131
-
132
- class WavyImage extends StatelessWidget {
133
- final String img;
134
-
135
- WavyImage (this .img);
136
-
137
- @override
138
- Widget build (BuildContext context) {
139
- return ClipPath (
140
- child: Stack (
141
- children: < Widget > [
142
- Image .asset (
143
- img,
144
- fit: BoxFit .cover,
145
- height: 1150. w,
146
- ),
147
- ContainerBlack (
148
- heightScreen: 1150. w,
149
- ),
150
- ],
151
- ),
152
- clipper: WaveClipper (),
153
- );
154
- }
155
- }
156
-
157
- class WaveClipper extends CustomClipper <Path > {
158
- @override
159
- Path getClip (Size size) {
160
- Path path = Path ();
161
-
162
- path.lineTo (0 , size.height - 200 );
163
- var firstControlPoint = Offset (0 , size.height - 160 );
164
- var firstEndPoint = Offset (30 , size.height - 150 );
165
- path.quadraticBezierTo (
166
- firstControlPoint.dx,
167
- firstControlPoint.dy,
168
- firstEndPoint.dx,
169
- firstEndPoint.dy,
170
- );
171
-
172
- path.lineTo (size.width - 30 , size.height - 50 );
173
- var secondControlPoint = Offset (size.width, size.height - 40 );
174
- var secondEndPoint = Offset (size.width, size.height);
175
- path.quadraticBezierTo (
176
- secondControlPoint.dx,
177
- secondControlPoint.dy,
178
- secondEndPoint.dx,
179
- secondEndPoint.dy,
180
- );
181
-
182
- path.lineTo (size.width, 200 );
183
- var thirdControlPoint = Offset (size.width, 140 );
184
- var thirdEndPoint = Offset (size.width - 30 , 150 );
185
- path.quadraticBezierTo (
186
- thirdControlPoint.dx,
187
- thirdControlPoint.dy,
188
- thirdEndPoint.dx,
189
- thirdControlPoint.dy,
190
- );
191
-
192
- path.lineTo (30 , 50 );
193
- var fourthControlPoint = Offset (0 , 40 );
194
- var fourthEndPoint = Offset (0 , 0 );
195
- path.quadraticBezierTo (
196
- fourthControlPoint.dx,
197
- fourthControlPoint.dy,
198
- fourthEndPoint.dx,
199
- fourthEndPoint.dy,
200
- );
201
-
202
- path.close ();
203
- return path;
204
- }
205
-
206
- @override
207
- bool shouldReclip (CustomClipper <Path > oldClipper) {
208
- return true ;
209
- }
210
- }
211
-
212
- class ContainerBlack extends StatelessWidget {
213
- const ContainerBlack ({
214
- Key key,
215
- @required this .heightScreen,
216
- }) : super (key: key);
217
-
218
- final double heightScreen;
219
-
220
- @override
221
- Widget build (BuildContext context) {
222
- return Container (
223
- height: heightScreen,
224
- color: Colors .black.withOpacity (0.5 ),
225
- );
226
- }
227
- }
0 commit comments