imput widget in flutter code example

Example 1: how to take user input in a flutter app

For userinput, we have a widget called TextField(), An example is given below:
- The decoration field, is self explanatory.
- The labelText: tells user about what he/she has to provide in the respective TextField(). 
TextField(
	decoration: InputDecoration(labelText: 'Title'),
),

Example 2: 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,  ), );}

Tags:

Dart Example