@@ -30,6 +30,12 @@ export 'package:optimizely_flutter_sdk/src/user_context/optimizely_user_context.
30
30
show OptimizelyDecideOption;
31
31
export 'package:optimizely_flutter_sdk/src/data_objects/decide_response.dart'
32
32
show Decision;
33
+ export 'package:optimizely_flutter_sdk/src/data_objects/track_listener_response.dart'
34
+ show TrackListenerResponse;
35
+ export 'package:optimizely_flutter_sdk/src/data_objects/decision_listener_response.dart'
36
+ show DecisionListenerResponse;
37
+ export 'package:optimizely_flutter_sdk/src/data_objects/logevent_listener_response.dart'
38
+ show LogEventListenerResponse;
33
39
34
40
/// The main client class for the Optimizely Flutter SDK.
35
41
///
@@ -59,31 +65,56 @@ class OptimizelyFlutterSdk {
59
65
_sdkKey, userId, attributes);
60
66
}
61
67
68
+ /// Checks if eventHandler are Closeable and calls close on them.
69
+ Future <BaseResponse > close () async {
70
+ return await OptimizelyClientWrapper .close (_sdkKey);
71
+ }
72
+
62
73
Future <CancelListening > addDecisionNotificationListener (
63
- MultiUseCallback callback) async {
64
- return await _addNotificationListener (callback, ListenerType .decision );
74
+ DecisionNotificationCallback callback) async {
75
+ return await _addDecisionNotificationListener (callback);
65
76
}
66
77
67
78
Future <CancelListening > addTrackNotificationListener (
68
- MultiUseCallback callback) async {
69
- return await _addNotificationListener (callback, ListenerType .track );
79
+ TrackNotificationCallback callback) async {
80
+ return await _addTrackNotificationListener (callback);
70
81
}
71
82
72
83
Future <CancelListening > addUpdateConfigNotificationListener (
73
84
MultiUseCallback callback) async {
74
- return await _addNotificationListener (
75
- callback, ListenerType .projectConfigUpdate);
85
+ return await _addConfigUpdateNotificationListener (callback);
76
86
}
77
87
78
88
Future <CancelListening > addLogEventNotificationListener (
79
- MultiUseCallback callback) async {
80
- return await _addNotificationListener (callback, ListenerType .logEvent);
89
+ LogEventNotificationCallback callback) async {
90
+ return await _addLogEventNotificationListener (callback);
91
+ }
92
+
93
+ /// Allows user to listen to supported Decision notifications.
94
+ Future <CancelListening > _addDecisionNotificationListener (
95
+ DecisionNotificationCallback callback) async {
96
+ return await OptimizelyClientWrapper .addDecisionNotificationListener (
97
+ _sdkKey, callback);
98
+ }
99
+
100
+ /// Allows user to listen to supported Track notifications.
101
+ Future <CancelListening > _addTrackNotificationListener (
102
+ TrackNotificationCallback callback) async {
103
+ return await OptimizelyClientWrapper .addTrackNotificationListener (
104
+ _sdkKey, callback);
81
105
}
82
106
83
- /// Allows user to listen to supported notifications.
84
- Future <CancelListening > _addNotificationListener (
85
- MultiUseCallback callback, ListenerType listenerType) async {
86
- return await OptimizelyClientWrapper .addNotificationListener (
87
- _sdkKey, callback, listenerType);
107
+ /// Allows user to listen to supported LogEvent notifications.
108
+ Future <CancelListening > _addLogEventNotificationListener (
109
+ LogEventNotificationCallback callback) async {
110
+ return await OptimizelyClientWrapper .addLogEventNotificationListener (
111
+ _sdkKey, callback);
112
+ }
113
+
114
+ /// Allows user to listen to supported Project Config Update notifications.
115
+ Future <CancelListening > _addConfigUpdateNotificationListener (
116
+ MultiUseCallback callback) async {
117
+ return await OptimizelyClientWrapper .addConfigUpdateNotificationListener (
118
+ _sdkKey, callback);
88
119
}
89
120
}
0 commit comments