-
Notifications
You must be signed in to change notification settings - Fork 152
/
Copy pathrounded_input_field.dart
49 lines (46 loc) · 1.3 KB
/
rounded_input_field.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 RoundedInputField extends StatelessWidget {
final String hintText;
final IconData icon;
final ValueChanged<String> onChanged;
final TextEditingController textEditingController;
final Color cursorColor;
final Color iconColor;
final Color editTextBackgroundColor;
const RoundedInputField(
{Key key,
this.hintText,
this.icon = Icons.person,
this.onChanged,
this.textEditingController,
this.cursorColor,
this.iconColor,
this.editTextBackgroundColor})
: super(key: key);
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Container(
margin: EdgeInsets.symmetric(vertical: 10),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 5),
width: size.width * 0.8,
decoration: BoxDecoration(
color: editTextBackgroundColor,
borderRadius: BorderRadius.circular(29),
),
child: TextField(
controller: textEditingController,
onChanged: onChanged,
cursorColor: cursorColor,
decoration: InputDecoration(
icon: Icon(
icon,
color: iconColor,
),
hintText: hintText,
border: InputBorder.none,
),
),
);
}
}