-1

I wanted to use this pin code field generator, but parts of it are deprecated.

_pin = List<String>(widget.fields);
_focusNodes = List<FocusNode>(widget.fields);
_textControllers = List<TextEditingController>(widget.fields);

(widget.fields is an integer) These lines tell me 'List' is deprecated. I tried to convert the first one to List.filled(not sure it's correct though), but couldn't figure out the others.

 List<String> _pin;
List<FocusNode> _focusNodes;
  List<TextEditingController> _textControllers;
_pin = List<String>.filled(widget.fields, '');

I read through the documentation here, but it's not clear enough for me.

Thanks in advance.

Ugur
  • 312
  • 5
  • 15

1 Answers1

0

I believe I found the answer while looking for something else, so I should be using list.generate instead of list.filled. Please check this post if you are interested.

Ugur
  • 312
  • 5
  • 15