Closed iqfareez closed 2 years ago
Hey, thanks for reporting.
I believe the best replacement would be:
// results = new List<Results>();
results = new List<Results>.empty(growable: true);
Thank you. Your solution works
Hey, thanks for reporting.
I believe the best replacement would be:
// results = new List<Results>(); results = new List<Results>.empty(growable: true);
How about to use a literal list notation?
// results = new List<Results>();
results = [];
Also from the efective dart guide:
DON’T use new. Linter rule: unnecessary_new
Dart 2 makes the new keyword optional. Even in Dart 1, its meaning was never clear because factory constructors mean a new invocation may still not actually return a new object.
The language still permits new in order to make migration less painful, but consider it deprecated and remove it from your code.
This project is all about honoring Dart's recommendations, and it seems that @RaulUrtecho is right.
I'll replace this with a non NEW solution shortly
It's done....sorry for taking soo long...It was a good nap though
Warning message:
'List' is deprecated and shouldn't be used. Try replacing the use of the deprecated member with the replacement.
Generated code: