box textfield flutter code example
Example 1: flutter input text in container
TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Enter a search term'
),
);
Example 2: squared text field flutter
new TextFormField(
decoration: new InputDecoration(
labelText: "Enter Email",
fillColor: Colors.white,
border: new OutlineInputBorder(
borderRadius: new BorderRadius.circular(25.0),
borderSide: new BorderSide(
),
),
),
validator: (val) {
if(val.length==0) {
return "Email cannot be empty";
}else{
return null;
}
},
keyboardType: TextInputType.emailAddress,
),