1

Trying to create a list of 28*28.

final resultBytes = List(28 * 28);

Why am I getting this error

"The default 'List' constructor isn't available when null safety is enabled."

Anim
  • 109
  • 6

1 Answers1

4

'List' is deprecated and shouldn't be used. Use a list literal, [], or the List.filled constructor instead. -> this is before null safety

Now, They have removed it completely, now you can use List.filled List.filled(28*28, 0);

Refer docs

Mohan Sai Manthri
  • 2,808
  • 1
  • 11
  • 26