Skip to content

Commit b2ef17d

Browse files
authored
fix: fixing formatting issues. (#38)
* fixing formatting issues. * fixes.
1 parent 8e8ecae commit b2ef17d

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

example/lib/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class _MyAppState extends State<MyApp> {
5454
print("Parsed decision event ....................");
5555
print(notification.type);
5656
print(notification.userId);
57-
print(notification);
57+
print(notification.decisionInfo);
5858
print("decide notification received");
5959
});
6060

@@ -69,7 +69,7 @@ class _MyAppState extends State<MyApp> {
6969
// variationKey: off
7070

7171
// Setting forced decision
72-
userContext.setForcedDecision(
72+
await userContext.setForcedDecision(
7373
OptimizelyDecisionContext("flag1", "flag1_experiment"),
7474
OptimizelyForcedDecision("variation_a"));
7575

@@ -84,7 +84,7 @@ class _MyAppState extends State<MyApp> {
8484
// variationKey: variation_a
8585

8686
// removing forced decision
87-
userContext.removeForcedDecision(
87+
await userContext.removeForcedDecision(
8888
OptimizelyDecisionContext("flag1", "flag1_experiment"));
8989

9090
// Decide call
@@ -131,7 +131,7 @@ class _MyAppState extends State<MyApp> {
131131
});
132132

133133
// To cancel track listener
134-
//await flutterSDK.removeNotificationListener(trackListenerID);
134+
await flutterSDK.removeNotificationListener(trackListenerID);
135135

136136
if (!mounted) return;
137137
}

lib/optimizely_flutter_sdk.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,18 @@ class OptimizelyFlutterSdk {
152152
/// Takes [int] id which allows user to remove that specific listener.
153153
/// Returns [BaseResponse] A object containing success result or reason of failure.
154154
Future<BaseResponse> removeNotificationListener(int id) async {
155-
return await OptimizelyClientWrapper.removeNotificationListener(_sdkKey, id);
155+
return await OptimizelyClientWrapper.removeNotificationListener(
156+
_sdkKey, id);
156157
}
157158

158159
/// Allows user to clear all notification listeners of specific type.
159160
///
160161
/// Takes [ListenerType] A listener type which allows user to remove only specific type of listeners.
161162
/// Returns [BaseResponse] A object containing success result or reason of failure.
162-
Future<BaseResponse> clearNotificationListeners(ListenerType listenerType) async {
163-
return await OptimizelyClientWrapper.clearNotificationListeners(_sdkKey, listenerType);
163+
Future<BaseResponse> clearNotificationListeners(
164+
ListenerType listenerType) async {
165+
return await OptimizelyClientWrapper.clearNotificationListeners(
166+
_sdkKey, listenerType);
164167
}
165168

166169
/// Allows user to check and clear all notification listeners.

lib/src/optimizely_client_wrapper.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class OptimizelyClientWrapper {
6969
Constants.eventMaxQueueSize: eventOptions.maxQueueSize,
7070
};
7171

72-
// clearing notification listeners, if they are mapped to the same sdkKey.
72+
// clearing notification listeners, if they are mapped to the same sdkKey.
7373
activateCallbacksById.remove(sdkKey);
7474
decisionCallbacksById.remove(sdkKey);
7575
trackCallbacksById.remove(sdkKey);
@@ -162,11 +162,9 @@ class OptimizelyClientWrapper {
162162
}
163163

164164
/// Remove notification listener by notification id.
165-
static Future<BaseResponse> removeNotificationListener(String sdkKey, int id) async {
166-
Map<String, dynamic> request = {
167-
Constants.sdkKey: sdkKey,
168-
Constants.id: id
169-
};
165+
static Future<BaseResponse> removeNotificationListener(
166+
String sdkKey, int id) async {
167+
Map<String, dynamic> request = {Constants.sdkKey: sdkKey, Constants.id: id};
170168

171169
activateCallbacksById[sdkKey]?.remove(id);
172170
decisionCallbacksById[sdkKey]?.remove(id);
@@ -180,7 +178,8 @@ class OptimizelyClientWrapper {
180178
}
181179

182180
/// Remove notification listeners by notification type.
183-
static Future<BaseResponse> clearNotificationListeners(String sdkKey, ListenerType listenerType) async {
181+
static Future<BaseResponse> clearNotificationListeners(
182+
String sdkKey, ListenerType listenerType) async {
184183
var callbackIds = _clearAllCallbacks(sdkKey, listenerType);
185184
Map<String, dynamic> request = {
186185
Constants.sdkKey: sdkKey,
@@ -193,7 +192,8 @@ class OptimizelyClientWrapper {
193192
}
194193

195194
/// Removes all notification listeners.
196-
static Future<BaseResponse> clearAllNotificationListeners(String sdkKey) async {
195+
static Future<BaseResponse> clearAllNotificationListeners(
196+
String sdkKey) async {
197197
var callbackIds = _clearAllCallbacks(sdkKey);
198198
Map<String, dynamic> request = {
199199
Constants.sdkKey: sdkKey,

0 commit comments

Comments
 (0)