11/// **************************************************************************
2- /// Copyright 2022-2023 , Optimizely, Inc. and contributors *
2+ /// Copyright 2022, Optimizely, Inc. and contributors *
33/// *
44/// Licensed under the Apache License, Version 2.0 (the "License"); *
55/// you may not use this file except in compliance with the License. *
@@ -21,8 +21,6 @@ import 'package:optimizely_flutter_sdk/src/data_objects/activate_response.dart';
2121import 'package:optimizely_flutter_sdk/src/data_objects/base_response.dart' ;
2222import 'package:optimizely_flutter_sdk/src/data_objects/datafile_options.dart' ;
2323import 'package:optimizely_flutter_sdk/src/data_objects/event_options.dart' ;
24- import 'package:optimizely_flutter_sdk/src/data_objects/get_vuid_response.dart' ;
25- import 'package:optimizely_flutter_sdk/src/data_objects/sdk_settings.dart' ;
2624import 'package:optimizely_flutter_sdk/src/data_objects/get_variation_response.dart' ;
2725import 'package:optimizely_flutter_sdk/src/data_objects/optimizely_config_response.dart' ;
2826import 'package:optimizely_flutter_sdk/src/optimizely_client_wrapper.dart' ;
@@ -35,7 +33,7 @@ export 'package:optimizely_flutter_sdk/src/user_context/optimizely_forced_decisi
3533export 'package:optimizely_flutter_sdk/src/user_context/optimizely_decision_context.dart'
3634 show OptimizelyDecisionContext;
3735export 'package:optimizely_flutter_sdk/src/user_context/optimizely_user_context.dart'
38- show OptimizelyUserContext, OptimizelyDecideOption, OptimizelySegmentOption ;
36+ show OptimizelyUserContext, OptimizelyDecideOption;
3937export 'package:optimizely_flutter_sdk/src/data_objects/decide_response.dart'
4038 show Decision;
4139export 'package:optimizely_flutter_sdk/src/data_objects/track_listener_response.dart'
@@ -46,8 +44,6 @@ export 'package:optimizely_flutter_sdk/src/data_objects/logevent_listener_respon
4644 show LogEventListenerResponse;
4745export 'package:optimizely_flutter_sdk/src/data_objects/event_options.dart'
4846 show EventOptions;
49- export 'package:optimizely_flutter_sdk/src/data_objects/sdk_settings.dart'
50- show SDKSettings;
5147export 'package:optimizely_flutter_sdk/src/data_objects/datafile_options.dart'
5248 show DatafileHostOptions;
5349
@@ -63,19 +59,17 @@ class OptimizelyFlutterSdk {
6359 final int _datafilePeriodicDownloadInterval;
6460 final Map <ClientPlatform , DatafileHostOptions > _datafileHostOptions;
6561 final Set <OptimizelyDecideOption > _defaultDecideOptions;
66- final SDKSettings _sdkSettings;
67- OptimizelyFlutterSdk (this ._sdkKey,
68- {EventOptions eventOptions = const EventOptions (),
69- int datafilePeriodicDownloadInterval =
70- 10 * 60 , // Default time interval in seconds
71- Map <ClientPlatform , DatafileHostOptions > datafileHostOptions = const {},
72- Set <OptimizelyDecideOption > defaultDecideOptions = const {},
73- SDKSettings sdkSettings = const SDKSettings ()})
74- : _eventOptions = eventOptions,
62+ OptimizelyFlutterSdk (
63+ this ._sdkKey, {
64+ EventOptions eventOptions = const EventOptions (),
65+ int datafilePeriodicDownloadInterval =
66+ 10 * 60 , // Default time interval in seconds
67+ Map <ClientPlatform , DatafileHostOptions > datafileHostOptions = const {},
68+ Set <OptimizelyDecideOption > defaultDecideOptions = const {},
69+ }) : _eventOptions = eventOptions,
7570 _datafilePeriodicDownloadInterval = datafilePeriodicDownloadInterval,
7671 _datafileHostOptions = datafileHostOptions,
77- _defaultDecideOptions = defaultDecideOptions,
78- _sdkSettings = sdkSettings;
72+ _defaultDecideOptions = defaultDecideOptions;
7973
8074 /// Starts Optimizely SDK (Synchronous) with provided sdkKey.
8175 Future <BaseResponse > initializeClient () async {
@@ -84,8 +78,7 @@ class OptimizelyFlutterSdk {
8478 _eventOptions,
8579 _datafilePeriodicDownloadInterval,
8680 _datafileHostOptions,
87- _defaultDecideOptions,
88- _sdkSettings);
81+ _defaultDecideOptions);
8982 }
9083
9184 /// Use the activate method to start an experiment.
@@ -147,40 +140,17 @@ class OptimizelyFlutterSdk {
147140 return await OptimizelyClientWrapper .getOptimizelyConfig (_sdkKey);
148141 }
149142
150- /// Send an event to the ODP server.
151- ///
152- /// Takes [action] The event action name.
153- /// Optional [type] The event type (default = "fullstack").
154- /// Optional [identifiers] A dictionary for identifiers.
155- /// Optional [data] A dictionary for associated data. The default event data will be added to this data before sending to the ODP server.
156- /// Returns [BaseResponse] A object containing success result or reason of failure.
157- Future <BaseResponse > sendOdpEvent (String action,
158- {String ? type,
159- Map <String , String > identifiers = const {},
160- Map <String , dynamic > data = const {}}) async {
161- return await OptimizelyClientWrapper .sendOdpEvent (_sdkKey, action,
162- type: type, identifiers: identifiers, data: data);
163- }
164-
165- /// Returns the device vuid.
166- ///
167- /// Returns [GetVuidResponse] A object containing device vuid
168- Future <GetVuidResponse > getVuid () async {
169- return await OptimizelyClientWrapper .getVuid (_sdkKey);
170- }
171-
172143 /// Creates a context of the user for which decision APIs will be called.
173144 ///
174145 /// NOTE: A user context will only be created successfully when the SDK is fully configured using initializeClient.
175146 ///
176- /// Optional [userId] the [String] user ID to be used for bucketing.
177- /// The device vuid will be used as an userId when userId is not provided.
147+ /// Takes [userId] the [String] user ID to be used for bucketing.
178148 /// Takes [attributes] An Optional [Map] of attribute names to current user attribute values.
179149 /// Returns An [OptimizelyUserContext] associated with this OptimizelyClient.
180- Future <OptimizelyUserContext ?> createUserContext (
181- { String ? userId, Map <String , dynamic > attributes = const {}} ) async {
182- return await OptimizelyClientWrapper .createUserContext (_sdkKey,
183- userId : userId, attributes : attributes);
150+ Future <OptimizelyUserContext ?> createUserContext (String userId,
151+ [ Map <String , dynamic > attributes = const {}] ) async {
152+ return await OptimizelyClientWrapper .createUserContext (
153+ _sdkKey, userId, attributes);
184154 }
185155
186156 /// Allows user to remove notification listener using id.
0 commit comments