Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Google Pay button doesn't update the amount on Android

Aperta
#323 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
android, dart, flutter
Ambito
mobile, payments

Direzione di ricerca

Parti da GooglePayButton e traccia il modo in cui la relativa vista della piattaforma Android riceve l'importo del pagamento e gli articoli durante le ricostruzioni del widget; riproduci il problema con un totale del checkout variabile. Il lavoro è completato quando il foglio Google Pay visualizza l'importo del pagamento e gli articoli più recenti dopo le ricostruzioni guidate dallo stato, senza rimuovere il widget dall'albero.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

paymentItems is not reactive

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

Recording
Lingua principale
Dart
Stelle
177
Fork
145
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google-pay/flutter-plugin

Tutte le issue di google-pay/flutter-plugin

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.