TextField profile

TextField Text input field

Easiest to use

// This will create a base TextField with an underscore TextField() by defaultCopy the code

Most comprehensive use

Widget buildTextField() {// Text controller Final Controller = TextEditingController(); controller.addListener(() { print('input ${controller.text}'); }); // Controller.text uses this method to get the text of the input box /** * This method is called to get the focus of TextField * focusScope.of (context).requestFocus(nodeTwo); */ FocusNode nodeOne = FocusNode(); return Theme( data: new ThemeData( primaryColor: Colors.blue.shade300, hintColor: Colors.blue), child: TextField(Controller: controller, // Whether to hide password obscureText: false, // Bind focusNode: NodeOne, / * * * TextCapitalization sentences, this is the most common type of capitalized the first letter of each sentence is converted into capital. * TextCapitalization characters capitals all characters in the sentence. * Text3%. Words capitalize the first letter of each word. * / textCapitalization: textCapitalization sentences, / / the cursor control style cursorColor: Colors. Red, cursorRadius: Radius. Circular (6.0), cursorWidth: 6.0, // Automatically get focus autofocus: false, // Maximum length 30, // enter the TextStyle: TextStyle(fontSize: 14.0, color: color.red), // change the keyboardType when pop-up keyboardType: Textinputtype. number, // Keyboard enter key style textInputAction: TextInputAction. Send, / / the input formats allow WhitelistingTextInputFormatter. DigitsOnly only allow input digital inputFormatters: [WhitelistingTextInputFormatter digitsOnly], / / the content change of callback onChanged: (text) {print (' change $text); }, // onSubmitted: (text) {print('submit $text'); }, // press Done onEditingComplete: () {}, decoration: InputDecoration(hintText: "Please enter the text ", hintStyle: TextStyle(fontWeight: fontweight.w300, color: colors.red), // fillColor: color.blue. Shade50, filled: ContentPadding: EdgeInsets. All (10.0), // Border: OutlineInputBorder: BorderRadius. Circular (5.0),),),); }Copy the code