File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,15 @@ class _VerificationCodeInputState extends State<VerificationCodeInput> {
2828 final List <FocusNode > _listFocusNode = < FocusNode > [];
2929 final List <TextEditingController > _listControllerText =
3030 < TextEditingController > [];
31- Map < int , String > _code = Map ();
31+ List < String > _code = List ();
3232 int _currentIdex = 0 ;
3333 @override
3434 void initState () {
3535 if (_listFocusNode.isEmpty) {
3636 for (var i = 0 ; i < widget.length; i++ ) {
3737 _listFocusNode.add (new FocusNode ());
3838 _listControllerText.add (new TextEditingController ());
39- _code[i] = " " ;
39+ _code. add ( ' ' ) ;
4040 }
4141 }
4242 super .initState ();
@@ -123,6 +123,9 @@ class _VerificationCodeInputState extends State<VerificationCodeInput> {
123123 void _prev (int index) {
124124 if (index > 0 ) {
125125 setState (() {
126+ if (_listControllerText[index].text.isEmpty) {
127+ _listControllerText[index - 1 ].text = ' ' ;
128+ }
126129 _currentIdex = index - 1 ;
127130 });
128131 FocusScope .of (context).requestFocus (_listFocusNode[index - 1 ]);
You can’t perform that action at this time.
0 commit comments