This is the official Dodo Payments Flutter package (
dodopayments_checkout
on pub.dev). A separate, community-built package also exists, see
Community Projects.Checkout Sessions API
Create the checkout_url this SDK opens, from your backend.
Mobile Integration Guide
See how this fits into the full mobile payment flow.
dodopayments_checkout opens Dodo’s hosted checkout in
SFSafariViewController on iOS and a Chrome Custom Tab on Android — the same
native cores used by the standalone iOS and
Android SDKs. All checkout logic lives in
those native cores; the Dart layer passes the call through a typed
Pigeon channel. It holds no API key and
never calls the Dodo Payments API.
Requires Flutter 3.44+ / Dart 3.12+, iOS 16+, and Android minSdk 23.
Installation
1
Add the Dependency
pubspec.yaml
2
Register a Callback URL Scheme
- iOS
- Android
Add a URL type for your scheme in Then forward incoming URLs (e.g. via
ios/Runner/Info.plist:ios/Runner/Info.plist
app_links) into the SDK, because
SFSafariViewController cannot catch its own return URL:It’s safe to forward every URL here.
handleOpenURL only acts on URLs
matching your registered returnUrl and resolves false for anything
else.Usage
What the Result Means
CheckoutStatus
required
One of
succeeded, failed, cancelled, pending, expired.String?
Set when the return URL included one. Display it in the UI, don’t use it
to grant access. See Verify the Payment below.
String?
Set for subscription checkouts.
List<String>?
Set when the checkout includes license key products.
String?
Set when the checkout captures an email.
Map<String, String>
Every query parameter from the return URL, verbatim.
Verify the Payment
Webhooks
Dodo Payments calls your backend when a payment succeeds or a subscription activates.
Get Payment Detail
Look up
paymentId with your secret key to check its status directly.result.status alone.
Appearance Customization
Customize the checkout browser’s toolbar, buttons, and color scheme viacustomization on CheckoutParams. Options are grouped by platform because
Android’s Custom Tab and iOS’s SFSafariViewController expose different
native controls. All fields are optional; omitting customization uses each
platform’s default appearance.
Android — Custom Tab
Android — Custom Tab
Color?
Toolbar background color.
Navigation bar color.
Divider color above the navigation bar.
CloseButtonStyle
standard shows the system “X” icon; back draws a back arrow instead.CloseButtonPosition
Which side of the toolbar the close button appears on.
Shows the toolbar’s share icon.
bool
Shows the page title under the URL in the toolbar.
bool
Lets the toolbar auto-hide as the page scrolls.
bool
Shows “Bookmark this page” in the overflow menu.
bool
Shows “Download page” in the overflow menu.
BrowserColorScheme
Forces light or dark appearance regardless of the device’s system setting.
iOS — SFSafariViewController
iOS — SFSafariViewController
DismissButtonStyle
Label or icon for the dismiss button.
PresentationStyle
pageSheet presents as a card with swipe-to-dismiss; fullScreen covers the whole screen.bool
Lets the toolbar collapse on scroll. Only visible when
presentationStyle is fullScreen — pageSheet keeps the bars pinned regardless of this setting.BrowserColorScheme
Forces light or dark appearance regardless of the device’s system setting.
Errors
start throws CheckoutException only for misuse or a platform failure.
A cancelled or declined payment is always a result, never an exception.
invalidCheckoutUrl(INVALID_CHECKOUT_URL): not acheckout.dodopayments.comsession URL.invalidReturnUrl(INVALID_RETURN_URL): not a valid absolute URL.alreadyInProgress(ALREADY_IN_PROGRESS): a checkout is already running.platformError(PLATFORM_ERROR): unexpected platform failure.
Abandoned Sessions
If the app is killed mid-checkout, recover the session on next launch and
reconcile it with your backend.
Related
Mobile Integration Guide
The same contract for Android, iOS, and React Native.
Community Projects
A separate, community-built Flutter package also exists.