Can help me. Error message is The default 'List' constructor isn't available when null safety is enabled. Try using a list literal, 'List.filled' or 'List.generate'.
Asked
Active
Viewed 549 times
1 Answers
-1
You can create a new empty list like
List<TextEditingController> _controllers = [];
List()
constructor cannot be used in null-safe code. Use List.filled to create a non-empty list. This requires a fill value to initialize the list elements with. To create an empty list, use [] for a growable list or List.empty for a fixed length list (or where growability is determined at run-time).
More about list class.

Md. Yeasin Sheikh
- 54,221
- 7
- 29
- 56
-
How bout this _functionalAndCognitiveStatusDescriptionControllers = new List(); to fix error I need to change like that? _functionalAndCognitiveStatusDescriptionControllers = []; – John Reaper Mar 23 '22 at 06:26
-
Yes, you are right. – Md. Yeasin Sheikh Mar 23 '22 at 06:29