LiewJunTung / pin_code_text_field

A highly customisable Flutter widget for entering pin code. Suitable for use cases such as login and OTP.
MIT License
376 stars 78 forks source link

Hotfix dispose focusNode on dispose state #5

Closed blackmenthor closed 5 years ago

blackmenthor commented 5 years ago

This bug produces an error when i ran unit tests and fill some of the textbox (for instance 3/6)

The error when running unit tests is

The following assertion was thrown while dispatching notifications for FocusNode: setState() called after dispose(): PinCodeTextFieldState#a65d5(lifecycle state: defunct, not mounted) This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build)