FlagshipConfig constructor
FlagshipConfig(
- Mode decisionMode,
- int timeout,
- int pollingTime,
- Level _logLevel,
- OnVisitorExposed? onVisitorExposed,
- TrackingManagerConfig trackingManagerConfig, {
- StatusListener? statusListener,
- IVisitorCacheImplementation? visitorCacheImp,
- IHitCacheImplementation? hitCacheImp,
- bool disableDeveloperUsageTracking = false,
Implementation
FlagshipConfig(this.decisionMode, this.timeout, this.pollingTime,
this._logLevel, this.onVisitorExposed, this.trackingManagerConfig,
{this.statusListener,
this.visitorCacheImp,
this.hitCacheImp,
this.disableDeveloperUsageTracking = false}) {
// Set the log Manager
this.logManager = LogManager(level: _logLevel);
// Log the timeout value in ms
this.logManager?.printLog(Level.INFO,
"The timeout for fetching campaigns is $timeout: ms", false);
decisionManager = (decisionMode == Mode.DECISION_API)
? ApiManager(Service(http.Client()))
: BucketingManager(Service(http.Client()), this.pollingTime);
if (this.hitCacheImp == null) {
this.hitCacheImp = DefaultCacheHitImp();
}
if (this.visitorCacheImp == null) {
this.visitorCacheImp = DefaultCacheVisitorImp();
}
}