Skip to main content
This is an enterprise-only feature. Please contact us to enable.
On Flutter the Connections contract is the same as every other platform, using Chrome Custom Tabs on Android and ASWebAuthenticationSession on iOS. You have two options:
  • Basic — present the hosted page and read the result. One Dart file to copy.
  • Headless — render your own native wallet list, driven by a hidden WebViewWidget. Your app links no wallet SDK.
The basic flow is the recommended default. Use headless only when you need a fully native front end.

Basic

The integration is fireblocks_connect.dart.
flutter_web_auth_2 wraps both platform auth-session APIs in one call — the Flutter equivalent of iOS’s ASWebAuthenticationSession and Android’s Chrome Custom Tabs.

1. Add dependencies

pubspec.yaml

2. Register your URL scheme

For iOS, add to ios/Runner/Info.plist.
Info.plist
For Android, add inside your <activity> in AndroidManifest.xml.
AndroidManifest.xml

3. Connect and use the result

connect_button.dart
walletImage is usually an SVG-sprite URL — render it in a WebViewWidget rather than Image.network.

Headless

Render your own native list and drive a hidden WebViewWidget that runs the Dynamic SDK and returns results — including message and transaction signatures — over a JS bridge.
No SDK in your app. Your app links no wallet SDK — no CocoaPods, no native crypto, no Gradle dep. It needs a hidden WebViewWidget pointed at headless.html and your URL scheme. All the WalletConnect / MetaMask / Phantom logic — and the wallet list itself — comes from that hosted view.
Copy fireblocks_headless_connect.dart.

1. Add dependencies

pubspec.yaml

2. Register URL schemes

You need two hosts under your scheme — one for the visible flow callback (wallet-callback) and one for Phantom’s redirect (phantom-headless) — plus LSApplicationQueriesSchemes on iOS for the wallet schemes you open.

3. Mount the engine and connect

Wrap your home screen with FireblocksEngineHost — it keeps the hidden WebViewWidget alive at all times. Prewarm at launch and connect on tap.
main.dart
example_screen.dart
Forward deep-links from Phantom to the engine in MaterialApp.onGenerateRoute (or your router’s redirect hook) with FireblocksHeadlessConnect.shared.handleReturnUrl(uri).

4. Sign a message and transaction

After a successful connect, call sign() with any string, or signTransaction() with a serialized transaction (signing only — no broadcast).
example_screen.dart
For EVM, pass a JSON transaction (only to is required) and receive an RLP-encoded hex string. For Solana, pass a base64-encoded serialized VersionedTransaction and receive base64-encoded signed bytes. Signing is only available for wallets connected through the headless engine.

5. Disconnect

Clears localStorage in the hidden WebView and reloads the engine so stale SDK state doesn’t bleed into the next connect.
example_screen.dart

Common pitfalls

  • Match the channel name exactly. Flutter bridges over addJavaScriptChannel('walletNative', …). A mismatch is invisible — the channel just never receives anything.
  • Test on a physical device. Wallets don’t run in the Simulator or a bare emulator.
  • Serve over HTTPS. The flow mints WalletConnect URIs via WebCrypto, which needs a secure context.
Last modified on August 7, 2026