onInit method
Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.
Implementation
@override
Future<void> onInit() {
// For each field
for (final field in fields) {
// Set text controllers
_textControllers[field] = TextEditingController(
// Set the default values if they exist
text: defaultValues[field],
);
// Set focus Nodes
_focusNodes[field] = FocusNode();
}
return super.onInit();
}