TextField requires a MaterialLocalizations widget

Summary

Context

Migration guide

Timeline

References

Summary

Instances of TextField must have a MaterialLocalizations present in the widget tree.
Trying to instantiate a TextField without the proper localizations results in an assertion such
as the following:

Context

If the TextField descends from a MaterialApp, the
DefaultMaterialLocalizations is already instantiated
and won’t require any changes to your existing code.

If the TextField doesn’t descend from MaterialApp,
you can use a Localizations widget to
provide your own localizations.

Migration guide

If you see an assertion error, make sure that locale information is available to the TextField,
either through an ancestor MaterialApp (that automatically provides Localizations), or by
creating your own Localizations widget.

Code before migration:

import