File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1+ [ 6.0.2] - Added fallback color when the cursor color fails to retrive.
2+
13[ 6.0.1] - Fixed read-only warning when field is not ` enabled ` & cursor animation now only triggers if ` showCursor = true `
24
35# [ 6.0.0]
Original file line number Diff line number Diff line change @@ -241,8 +241,7 @@ class _PinCodeTextFieldState extends State<PinCodeTextField>
241241 _focusNode.addListener (() {
242242 setState (() {});
243243 }); // Rebuilds on every change to reflect the correct color on each field.
244- _inputList = List <String >(widget.length);
245- _initializeValues ();
244+ _inputList = List <String >.filled (widget.length, "" );
246245
247246 _cursorController = AnimationController (
248247 duration: Duration (milliseconds: 1000 ), vsync: this );
@@ -376,12 +375,6 @@ class _PinCodeTextFieldState extends State<PinCodeTextField>
376375 super .dispose ();
377376 }
378377
379- void _initializeValues () {
380- for (int i = 0 ; i < _inputList.length; i++ ) {
381- _inputList[i] = "" ;
382- }
383- }
384-
385378 // selects the right color for the field
386379 Color _getColorFromIndex (int index) {
387380 if (! widget.enabled) {
@@ -718,7 +711,7 @@ class _PinCodeTextFieldState extends State<PinCodeTextField>
718711 }
719712
720713 void _setTextToInput (String data) async {
721- var replaceInputList = List <String >(widget.length);
714+ var replaceInputList = List <String >. filled (widget.length, "" );
722715
723716 for (int i = 0 ; i < widget.length; i++ ) {
724717 replaceInputList[i] = data.length > i ? data[i] : "" ;
You can’t perform that action at this time.
0 commit comments