New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
paymentItems
is not reactive
#235
Comments
dickermoshe
changed the title
Dec 26, 2023
paymentItems
are not reactivepaymentItems
is not reactive
CauseThis is because flutter-plugin/pay_ios/lib/src/widgets/apple_pay_button.dart Lines 153 to 162 in af2e70d
If we made |
Merged
PR #236 fixes this. |
Published under |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BUG
If you change the value of
paymentItems
on a PayButton it doesn't update it internally.Example
This Widget returns a ApplePayButton that will charge
priceInCents
.However, If the parent widget changes the price (E.G. The customer selects a different tip amount) the payment will still show the original amount.
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-12-26.at.01.47.53.1.mp4
Temp Workaround
Assign the button a
UniqueKey
and change it when thepriceInCents
changes.This will force Flutter to rebuild the entire
ApplePayButton
(This is using flutter_hooks, but you could use something else to do this.)
The text was updated successfully, but these errors were encountered: