FLUTTER ERROR || Failed assertion: 'initialValue == null || controller == null': is not true.

Publicado el: 11 enero 2024
en el canal de: IFASTEK TV
275
2

In flutter, when you are trying to use both initial value and controller in your textform field

SOLUTION BY CopsOnRoad FROM STACK OVER FLOW
https://stackoverflow.com/questions/5...
You can't use both initialValue and controller at the same time. So, it's better to use controller as you can set default text in its constructor.

Here is an example.

// Create the controller.
final controller = TextEditingController(text: "Your initial value");

Widget build(BuildContext context) {
return TextFormField(
controller: controller, // Assign it here.
// ...
);
}
To get the value entered by the user, use:

controller.text


En esta página del sitio puede ver el video en línea FLUTTER ERROR || Failed assertion: 'initialValue == null || controller == null': is not true. de Duración hora minuto segunda en buena calidad , que subió el usuario IFASTEK TV 11 enero 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 275 veces y le gustó 2 a los espectadores. Disfruta viendo!