Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bdefd4f

Browse files
Add new changes
1 parent 01ef9d1 commit bdefd4f

File tree

2 files changed

+107
-23
lines changed

2 files changed

+107
-23
lines changed

‎lib/pages/send_money.dart

Lines changed: 106 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:animate_do/animate_do.dart';
2+
import 'package:bouncing_widget/bouncing_widget.dart';
23
import 'package:flutter/material.dart';
34
import 'package:flutter/services.dart';
45
import 'package:pattern_formatter/pattern_formatter.dart';
@@ -15,6 +16,32 @@ class SendMoney extends StatefulWidget {
1516
class _SendMoneyState extends State<SendMoney> {
1617
var amount = TextEditingController(text: "0.00");
1718

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+
1845
@override
1946
Widget build(BuildContext context) {
2047
return Scaffold(
@@ -32,7 +59,8 @@ class _SendMoneyState extends State<SendMoney> {
3259
children: [
3360
SizedBox(height: 50,),
3461
FadeInDown(
35-
duration: Duration(milliseconds: 500),
62+
from: 100,
63+
duration: Duration(milliseconds: 1000),
3664
child: Container(
3765
width: 130,
3866
height: 130,
@@ -47,16 +75,22 @@ class _SendMoneyState extends State<SendMoney> {
4775
),
4876
),
4977
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),
5282
child: Text("Send Money To", style: TextStyle(color: Colors.grey),)),
5383
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),
5688
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),
6094
child: Padding(
6195
padding: const EdgeInsets.symmetric(horizontal: 50.0),
6296
child: TextField(
@@ -97,43 +131,92 @@ class _SendMoneyState extends State<SendMoney> {
97131
),
98132
),
99133
),
100-
SizedBox(height: 30,),
134+
SizedBox(height: 10,),
101135
// 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+
),
106149
child: TextField(
107150
maxLines: 3,
151+
focusNode: _focusNode,
152+
controller: _editingController,
108153
keyboardType: TextInputType.text,
109154
cursorColor: Colors.black,
110155
style: TextStyle(color: Colors.black, fontSize: 18, fontWeight: FontWeight.w500),
111156
decoration: InputDecoration(
112157
contentPadding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
113-
hintText: "Note ...",
158+
hintText: "Message ...",
114159
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
122161
),
123162
),
124163
),
125164
),
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+
),
126207
SizedBox(height: 50,),
127208
FadeInUp(
128-
duration: Duration(milliseconds: 500),
209+
duration: Duration(milliseconds: 1000),
129210
child: Padding(
130211
padding: const EdgeInsets.symmetric(horizontal: 50.0),
131212
child: Material(
132213
elevation: 5,
133214
borderRadius: BorderRadius.circular(10),
134215
color: Colors.black,
135216
child: MaterialButton(
136-
onPressed: () {},
217+
onPressed: () {
218+
Navigator.of(context).pushReplacementNamed('/');
219+
},
137220
minWidth: double.infinity,
138221
height: 50,
139222
child: Text("Send", style: TextStyle(color: Colors.white, fontSize: 16),),

‎pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencies:
3939
pattern_formatter: ^2.0.0
4040
align_positioned: ^3.0.0
4141
flutter_advanced_drawer: ^1.2.3+1
42+
bouncing_widget: ^2.0.0
4243

4344
dev_dependencies:
4445
flutter_test:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /