installDoubles method
void
installDoubles()
Points bifrostServiceLocator at these doubles.
For packages with no DI container of their own — bifrosted's own tests are the motivating case. An app should not call this: it overwrites the locator its bindings installed, so its tests would stop exercising the injection its production code uses. Register the doubles through the app's container instead.
Call it after reset, which recreates the instances this closes over.
Implementation
void installDoubles() {
bifrostServiceLocator = <T>() {
if (T == StorageService) return storage as T;
if (T == SystemNotifier) return notifier as T;
if (T == ConnectionChecker) return connectionChecker as T;
if (T == AnalyticsService) return analytics as T;
if (T == EntitlementService) return entitlements as T;
if (T == PaywallPresenter) return paywalls as T;
if (T == AttributionService) return attribution as T;
throw StateError('Unknown type: $T');
};
}