Loading topic
TextField, the basic widget for typing text in Flutter. You will place one on screen, read what the user types, react to changes, and learn the errors that beginners hit most often. Controllers, decoration, and forms get their own chapters, so this one stays on the basics.5 min readStatefulWidget and use initState and dispose. It also assumes you know Dart's nullable types and closures, and that you have built a basic TextField in the previous chapter. Here you will learn what a TextEditingController holds, how to read and change 4 min readTextField, attach a TextEditingController, and write a StatefulWidget that calls setState. It also assumes you know Dart's nullable types and named parameters. By the end you will be able to describe a field's appearance with InputDecoration, cont5 min readTextField with a TextEditingController and an InputDecoration, and that you know StatefulWidget and setState. It covers the properties that control the on-screen keyboard, the action key, masked input and autofill. Input formatters and focus movement ge4 min readTextField or TextFormField with a controller and a validator, and that you know how keyboardType is set. It covers inputFormatters, which change the text while the user types, before any validator sees it.5 min readTextField holds one piece of text. A Form groups several fields so you can validate, save, or reset them with one call. This chapter covers what Form does, how FormState tracks the fields inside it, and the mistakes that most often break it.5 min readTextFormField and Form check input. It assumes you can write Dart closures and nullable types, build a StatefulWidget with setState, and have already used TextField, TextEditingController and InputDecoration. The previous chapter showed how to wrap fields in a `4 min readAutovalidateMode, the setting that decides when a field shows its error. It assumes you know how to build a Form with a GlobalKey<FormState>, how a TextFormField takes a validator, and how setState works. A validator returns an error string or null. This chapter is 5 min readFormState that handle submission: validate(), save() and reset(). It assumes you know how to build a Form with a GlobalKey<FormState> and write a TextFormField validator that returns an error string or null. It also assumes you are comfortable5 min readForm with TextFormField and validators, and that you know the State lifecycle (initState, dispose). Knowing GlobalKey<FormState> is 5 min readTextFormField with a validator, wrap fields in a Form, and call validate() through a GlobalKey<FormState>. You should also be comfortable with nullable types, closures, and function types in Dart. Here you will move rules out of individual fields and in4 min readTextFormField with a validator, wrap fields in a Form with a GlobalKey<FormState>, and manage a TextEditingController in a State object. It also assumes you know the reusable Validator typedef from the previous chapter. If any of that is unfamiliar,5 min readForm with a GlobalKey<FormState> and write TextFormField validators that return an error string or null. It also assumes you are comfortable with nullable types and closures in Dart. Here you will apply the same validation, saving and resetting to4 min readForm with a GlobalKey<FormState>, write TextFormField validators, and use async/await with setState. It covers errors that only the server can detect, such as "this email is already registered". It also covers how to show them in the same place as loc5 min readForm, the validator functions, and the visible error text together, without a device or emulator.4 min readTextFormField with a validator, wrap fields in a Form, and use AutovalidateMode, TextInputAction and InputDecoration. It covers the choices that make a form easier to use for everyone, including people who rely on screen readers, large text, or a keyboa6 min read