Integration · SDK
Flutter
The Flutter client ships on pub.dev as metapolicy_sdk. Dart 3+. Same six-method surface as every other SDK; same wire format. Works with both the Cupertino and Material UI stacks.
The contract
What flows in
- Decide requests returning Future
- Reward events as Future
; await for confirm-on-server semantics - Stream interface for slate decisions where the assignment may revalidate
What flows out
- Assignment + propensity available on the same Future
- Errors typed via DecideException, ServerException, NetworkException
Setup
- 01flutter pub add metapolicy_sdk
- 02Initialise in main() with the environment-scoped API key
- 03Call client.decide(...) at the decision widget
- 04Emit rewards on observable outcome events
- 05Optional: MetapolicyProvider widget for InheritedWidget-style propagation through the tree
Cross-platform considerations
Decision caching uses Flutter's app lifecycle observer to invalidate on app resume, matching the iOS and Android native SDKs. The contract is platform-agnostic by design.
If you also run native iOS or Android entry points, all three SDKs hit the same backend and use the same propensity log — the lift readout aggregates across surfaces.
Other sdk integrations
PythonAsync client for FastAPI / Django / Celery. Same six-method surface as every other SDK.TypeScriptUniversal client. Same wire format whether you ship in Node, the browser, or React Native.KotlinCoroutines-native client for Android + JVM backends. Same contract as every other SDK.Swiftasync/await client for iOS, macOS, watchOS, tvOS. Same wire format as the rest.
Wire Flutter in a 30-minute call.
We pair with your engineer, ship the integration live, and run the first decision on your stack.