1
1
import 'package:animate_do/animate_do.dart' ;
2
+ import 'package:bouncing_widget/bouncing_widget.dart' ;
2
3
import 'package:flutter/material.dart' ;
3
4
import 'package:flutter/services.dart' ;
4
5
import 'package:pattern_formatter/pattern_formatter.dart' ;
@@ -15,6 +16,32 @@ class SendMoney extends StatefulWidget {
15
16
class _SendMoneyState extends State <SendMoney > {
16
17
var amount = TextEditingController (text: "0.00" );
17
18
19
+ FocusNode _focusNode = new FocusNode ();
20
+ TextEditingController _editingController = new TextEditingController ();
21
+ bool isFocused = false ;
22
+
23
+ List <String > _feedbacks = [
24
+ 'Awsome 🙌' ,
25
+ 'Nice 🔥' ,
26
+ 'Cool 🤩' ,
27
+ 'Amazing work 👍🏼' ,
28
+ ];
29
+
30
+ @override
31
+ void initState () {
32
+ super .initState ();
33
+
34
+ _focusNode.addListener (onFocusChanged);
35
+ }
36
+
37
+ void onFocusChanged () {
38
+ setState (() {
39
+ isFocused = _focusNode.hasFocus;
40
+ });
41
+
42
+ print ('focus changed.' );
43
+ }
44
+
18
45
@override
19
46
Widget build (BuildContext context) {
20
47
return Scaffold (
@@ -32,7 +59,8 @@ class _SendMoneyState extends State<SendMoney> {
32
59
children: [
33
60
SizedBox (height: 50 ,),
34
61
FadeInDown (
35
- duration: Duration (milliseconds: 500 ),
62
+ from: 100 ,
63
+ duration: Duration (milliseconds: 1000 ),
36
64
child: Container (
37
65
width: 130 ,
38
66
height: 130 ,
@@ -47,16 +75,22 @@ class _SendMoneyState extends State<SendMoney> {
47
75
),
48
76
),
49
77
SizedBox (height: 50 ,),
50
- FadeInRight (
51
- duration: Duration (milliseconds: 500 ),
78
+ FadeInUp (
79
+ from: 60 ,
80
+ delay: Duration (milliseconds: 500 ),
81
+ duration: Duration (milliseconds: 1000 ),
52
82
child: Text ("Send Money To" , style: TextStyle (color: Colors .grey),)),
53
83
SizedBox (height: 10 ,),
54
- FadeInRight (
55
- duration: Duration (milliseconds: 500 ),
84
+ FadeInUp (
85
+ from: 30 ,
86
+ delay: Duration (milliseconds: 800 ),
87
+ duration: Duration (milliseconds: 1000 ),
56
88
child: Text (widget.name, style: TextStyle (fontSize: 24 , fontWeight: FontWeight .bold),)),
57
- SizedBox (height: 30 ,),
58
- FadeInRight (
59
- duration: Duration (milliseconds: 500 ),
89
+ SizedBox (height: 20 ,),
90
+ FadeInUp (
91
+ from: 40 ,
92
+ delay: Duration (milliseconds: 800 ),
93
+ duration: Duration (milliseconds: 1000 ),
60
94
child: Padding (
61
95
padding: const EdgeInsets .symmetric (horizontal: 50.0 ),
62
96
child: TextField (
@@ -97,43 +131,92 @@ class _SendMoneyState extends State<SendMoney> {
97
131
),
98
132
),
99
133
),
100
- SizedBox (height: 30 ,),
134
+ SizedBox (height: 10 ,),
101
135
// note textfield
102
- FadeInRight (
103
- duration: Duration (milliseconds: 500 ),
104
- child: Padding (
105
- padding: const EdgeInsets .symmetric (horizontal: 50.0 ),
136
+ FadeInUp (
137
+ from: 60 ,
138
+ delay: Duration (milliseconds: 800 ),
139
+ duration: Duration (milliseconds: 1000 ),
140
+ child: AnimatedContainer (
141
+ margin: EdgeInsets .symmetric (horizontal: 30 ),
142
+ duration: Duration (milliseconds: 500 ),
143
+ decoration: BoxDecoration (
144
+ color: Colors .white,
145
+ borderRadius: BorderRadius .circular (8 ),
146
+ border: Border .all (color: isFocused ? Colors .indigo.shade400 : Colors .grey.shade200, width: 2 ),
147
+ // // boxShadow:
148
+ ),
106
149
child: TextField (
107
150
maxLines: 3 ,
151
+ focusNode: _focusNode,
152
+ controller: _editingController,
108
153
keyboardType: TextInputType .text,
109
154
cursorColor: Colors .black,
110
155
style: TextStyle (color: Colors .black, fontSize: 18 , fontWeight: FontWeight .w500),
111
156
decoration: InputDecoration (
112
157
contentPadding: EdgeInsets .symmetric (vertical: 20 , horizontal: 20 ),
113
- hintText: "Note ..." ,
158
+ hintText: "Message ..." ,
114
159
hintStyle: TextStyle (color: Colors .grey, fontSize: 15 , fontWeight: FontWeight .w500),
115
- enabledBorder: OutlineInputBorder (
116
- borderRadius: BorderRadius .circular (10 ),
117
- borderSide: BorderSide (color: Colors .grey.shade200, width: 1.5 ),
118
- ),
119
- focusedBorder: OutlineInputBorder (
120
- borderSide: BorderSide (color: Colors .grey.shade300, width: 1.5 ),
121
- ),
160
+ border: InputBorder .none
122
161
),
123
162
),
124
163
),
125
164
),
165
+ SizedBox (height: 20 ,),
166
+ FadeInUp (
167
+ from: 60 ,
168
+ delay: Duration (milliseconds: 800 ),
169
+ duration: Duration (milliseconds: 1000 ),
170
+ child: Container (
171
+ height: 50 ,
172
+ padding: EdgeInsets .symmetric (horizontal: 30 ),
173
+ child: ListView .builder (
174
+ scrollDirection: Axis .horizontal,
175
+ itemCount: _feedbacks.length,
176
+ itemBuilder: (context, index) {
177
+ return FadeInRight (
178
+ from: 100 ,
179
+ delay: Duration (milliseconds: index * 500 ),
180
+ duration: Duration (milliseconds: 1000 ),
181
+ child: BouncingWidget (
182
+ duration: Duration (milliseconds: 100 ),
183
+ scaleFactor: 1.5 ,
184
+ onPressed: () {
185
+ _editingController.text = _feedbacks[index];
186
+ _focusNode.requestFocus ();
187
+ },
188
+ child: Container (
189
+ margin: EdgeInsets .only (right: 20 ),
190
+ padding: EdgeInsets .symmetric (horizontal: 20 , vertical: 8 ),
191
+ decoration: BoxDecoration (
192
+ color: Colors .white,
193
+ borderRadius: BorderRadius .circular (8 ),
194
+ border: Border .all (color: Colors .grey.shade200, width: 2 ),
195
+ ),
196
+ child: Text (_feedbacks[index], style: TextStyle (
197
+ color: Colors .grey.shade800,
198
+ fontSize: 16
199
+ ),),
200
+ ),
201
+ ),
202
+ );
203
+ },
204
+ ),
205
+ ),
206
+ ),
126
207
SizedBox (height: 50 ,),
127
208
FadeInUp (
128
- duration: Duration (milliseconds: 500 ),
209
+ duration: Duration (milliseconds: 1000 ),
129
210
child: Padding (
130
211
padding: const EdgeInsets .symmetric (horizontal: 50.0 ),
131
212
child: Material (
132
213
elevation: 5 ,
133
214
borderRadius: BorderRadius .circular (10 ),
134
215
color: Colors .black,
135
216
child: MaterialButton (
136
- onPressed: () {},
217
+ onPressed: () {
218
+ Navigator .of (context).pushReplacementNamed ('/' );
219
+ },
137
220
minWidth: double .infinity,
138
221
height: 50 ,
139
222
child: Text ("Send" , style: TextStyle (color: Colors .white, fontSize: 16 ),),
0 commit comments