flutter textfield label code example
Example 1: get more space between label text and input text flutter
Can be solved by simply providing the contentPadding.
Example 2: text field flutter
TextField(
onChanged: (value) {
//Do something with the user input.
},
decoration: InputDecoration(
hintText: 'Enter your password.',
contentPadding:
EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.lightBlueAccent, width: 1.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.lightBlueAccent, width: 2.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
),
),
Example 3: TextInput for flutter
TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Enter a search term'
),
);
Example 4: flutter text field form
TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Enter a search term'
),
);
Example 5: edite text in flutter
Widget _editTitleTextField() { if (_isEditingText) return Center( child: TextField( onSubmitted: (newValue){ setState(() { initialText = newValue; _isEditingText =false; }); }, autofocus: true, controller: _editingController, ), ); return InkWell( onTap: () { setState(() { _isEditingText = true; }); }, child: Text( initialText, style: TextStyle( color: Colors.black, fontSize: 18.0, ), );}