getExperiment never returns null. When the customer is not in the experiment, isEnrolled is false, variantKey is null, and every typed getter (boolValue, stringValue, intValue, doubleValue with a defaultValue:, and experiment['key'] for JSON payloads) returns your default — so control renders with no null-check or cast. The raw nullable assignment is .assignment (or getExperimentAssignment).
Use assignments for:
- paywall variants
- onboarding route tests
- offer emphasis tests
- holdout groups
Implementation pattern
- Configure AppActor.
- Fetch offerings or Remote Config if the screen needs them.
- Resolve the experiment assignment for the placement.
- Render the variant in Flutter.
- Gate access from customer entitlements.
Identity and cache
Re-resolve assignment when identity changes. Do not reuse a previous user’s assignment afterlogIn, logOut, or reset.
Launch Experiments
Read the product-level experiment launch checklist.