How the pieces connect
The split is strict: the Stripe secret key lives only on your server, the flutter_stripe package runs only on the device. On startup you set Stripe.publishableKey and, for Apple Pay, Stripe.merchantIdentifier. When the user checks out, Flutter hits your backend endpoint, which calls Stripe's API (stripe.paymentIntents.create) with the amount, currency, and customer id, and returns the client_secret to the app. Flutter passes that secret to Stripe.instance.initPaymentSheet(...) then presentPaymentSheet(), which renders the native sheet with card, Apple Pay, and Google Pay. The amount is fixed server-side, so a tampered client can't change what's charged. The server is also where you confirm the final state — never trust the client's success callback as the record of truth.