-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Issue description
GooglePayButton does not update when the payment amount or payment items change after the widget has been built.
Even if the widget rebuilds due to state updates (setState, Bloc, Provider, etc.), the button continues using the initial amount configuration. The updated payment data is not reflected when the Google Pay sheet opens.
The only workaround is to completely remove the widget from the tree and add it again. This suggests the underlying platform view is initialized once and not reconfigured on rebuild. This makes the widget hard to use in dynamic checkout flows where totals change (shipping, discounts, taxes, quantity updates, etc.).
Expected behavior
After a state change and widget rebuild, the Google Pay sheet should display the latest payment amount and items, not the original values.
Reference
Flutter doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.7, on macOS 15.1 24B83 darwin-arm64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
✗ cmdline-tools component is missing.
Try installing or updating Android Studio.
Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.2)
[✓] VS Code (version 1.98.2)
[✓] Connected device (3 available)
[✓] Network resources