ad_flow_testing library
Test doubles for apps that unit-test their ad integration.
Import in test files only:
import 'package:ad_flow/ad_flow_testing.dart';
final sdk = FakeAdSdk()..canRequestAdsResult = true;
final ads = await AdFlow.initialize(config, sdk: sdk, ...);
Classes
- ConsentUpdateCall
- One recorded FakeAdSdk.requestConsentInfoUpdate call.
- FakeAdSdk
- A fully controllable AdSdk test double.
- FakeBannerHandle
- A drivable fake banner handle. buildWidget returns a SizedBox of size so widget tests can pump it without platform views.
- FakeFullScreenAdHandle
- A drivable fake full-screen ad handle.
- FakeNativeHandle
- A drivable fake native handle. buildWidget returns a fixed-size SizedBox so widget tests can pump it without platform views.
Functions
-
resetAppOpenLaunchOpportunity(
) → void -
Resets the process-global one-shot App Open cold-launch latch used by
AppOpenAdManager.showAtLaunchIfReady— call in testsetUpso tests do not leak the consumed latch into each other. Test-only; NOT part of the production API (package:ad_flow/ad_flow.dartnever exposes it).