The default ‘List’ constructor isn’t available when null safety is enabled. Try using a list literal, ‘List.filled’ or ‘List.generate’
Short answer: Instead of the pre-null-safety operations var foo = List<int>(); // Now error var bar = List<int>(n); // Now error var baz = List<int>(0); // Now error use the following: var foo = <int>[]; // Always the recommended way. var bar = List.filled(1, 0); // Not filled with `null`s. var baz = List<int>.empty(); Long … Read more