Skip to main content
This page contains a complete reference implementation for integrating the MoonPay Developer Platform in Flutter. The implementation is entirely in Dart and uses webview_flutter to render MoonPay frames.

Overview

The Flutter SDK consists of the following files:

Project Setup

pubspec.yaml
Add the following to your ios/Runner/Info.plist:
To generate Dart types from the OpenAPI spec:
  1. Download the openapi.json file to your project root
  2. Run the generator:
This generates typed models in lib/gen/ that you can import instead of manually defining types.

Source Files

Types are imported from the generated OpenAPI types where possible, with SDK-specific types defined separately.
types.dart
Uses the generated PaymentMethod and Quote types from the OpenAPI spec.
api.dart
Manages credentials internally. The connect event handler captures credentials automatically.
client.dart
Matches the Web implementation’s cryptographic approach: X25519 key exchange, HKDF key derivation (no salt, no info), and AES-GCM decryption.
crypto.dart
Matches the Web SDK’s frame handling pattern. Uses MoonPayBridge JavaScript channel with message bridge injection.
frames.dart