Open AndreHaueisen opened 9 months ago
I have a similar issue with CardFiled. After editing another widget on the same page KeepVisibleOnFocus widget produces an error that is ''' Exception has occurred. FlutterError (This widget has been unmounted, so the State no longer has a context (and should be considered defunct). Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.) '''
This maybe fixed in #1539 .
Keep in mind it is not advisable to add the cardfield into complex widgets structures. Reason is that it is a native widget (due to security reasons we cannot create a flutter one) . I recommend using the paymentsheet since it has far superior ux, localisation and configuration capabilities.
@remonh87 Thanks for looking into it and for the tip! 🍻
Update: Using version 10.0.0 now and this is not fixed.
It also happens with CardFormField
I have a similar issue with CardFiled. After editing another widget on the same page KeepVisibleOnFocus widget produces an error that is ''' Exception has occurred. FlutterError (This widget has been unmounted, so the State no longer has a context (and should be considered defunct). Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.) '''
Moving from 9.6.0 to 10.0.0 is fixing the issue.
Steps to reproduce in 9.6.0:
Describe the bug
CardField
loses focus when the screen is rebuilt. In the video, when the list occupies the whole screen, the Scaffold needs to be rebuilt to accommodate the keyboard. When that happens, theCardFiled
loses focus, causing the keyboard to disappear. Notice that when the Keyboard has enough space, the Scaffold does not resize and everything works as expected.To Reproduce Steps to reproduce the behavior:
https://github.com/flutter-stripe/flutter_stripe/assets/13854934/10c9c6b1-275d-42aa-a53b-87a4f4a64176
Expected behavior I'd expect the CardField to keep its focus.
Smartphone / tablet
Additional context
Code for the video above