This repository was archived by the owner on Aug 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
lib/src/presentation/widgets Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class PinInputWidget extends StatefulWidget {
3131class _PinInputWidgetState extends State <PinInputWidget > {
3232 late final TextEditingController controller;
3333 late final FocusNode focusNode;
34+
3435 @override
3536 void initState () {
3637 super .initState ();
@@ -42,10 +43,17 @@ class _PinInputWidgetState extends State<PinInputWidget> {
4243 focusNode.addListener (() => setState (() {}));
4344 }
4445
46+ @override
47+ void dispose () {
48+ focusNode.dispose ();
49+ controller.dispose ();
50+ super .dispose ();
51+ }
52+
4553 @override
4654 Widget build (BuildContext context) {
4755 if (controller.text != widget.value) {
48- controller.text = widget.value ;
56+ controller.clear () ;
4957 }
5058 return Row (
5159 mainAxisSize: MainAxisSize .min,
@@ -77,10 +85,9 @@ class _PinInputWidgetState extends State<PinInputWidget> {
7785 focusNode: focusNode,
7886 keyboardType: TextInputType .number,
7987 maxLength: widget.pinLength,
80- onChanged: (text) async {
88+ onChanged: (text) {
8189 widget.onInput (text);
82- if (text.length == widget.pinLength &&
83- focusNode.hasFocus == true ) {
90+ if (text.length == widget.pinLength && focusNode.hasFocus == true ) {
8491 widget.nextFocusNode? .requestFocus ();
8592 }
8693 },
You can’t perform that action at this time.
0 commit comments