Skip to content

Commit ba39c98

Browse files
authored
Reverting change for #152 (#169)
1 parent b01303e commit ba39c98

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

packages/core/lib/analytics.dart

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Analytics with ClientMethods {
6969
addPlugin(segmentDestination);
7070
}
7171

72-
if(config.token != null) {
72+
if (config.token != null) {
7373
_platformPlugins.add(InjectToken(config.token!));
7474
}
7575

@@ -210,30 +210,26 @@ class Analytics with ClientMethods {
210210

211211
@override
212212
Future track(String event, {Map<String, dynamic>? properties}) async {
213-
await _process(TrackEvent(event, properties: properties ?? {},
214-
integrations: _state.integrations.state)); // Patch for Github Issue #152
213+
await _process(TrackEvent(event, properties: properties ?? {}));
215214
}
216215

217216
@override
218217
Future screen(String name, {Map<String, dynamic>? properties}) async {
219-
final event = ScreenEvent(name, properties: properties ?? {},
220-
integrations: _state.integrations.state); // Patch for Github Issue #152
218+
final event = ScreenEvent(name, properties: properties ?? {});
221219

222220
await _process(event);
223221
}
224222

225223
@override
226224
Future identify({String? userId, UserTraits? userTraits}) async {
227-
final event = IdentifyEvent(userId: userId, traits: userTraits,
228-
integrations: _state.integrations.state); // Patch for Github Issue #152
225+
final event = IdentifyEvent(userId: userId, traits: userTraits);
229226

230227
await _process(event);
231228
}
232229

233230
@override
234231
Future group(String groupId, {GroupTraits? groupTraits}) async {
235-
final event = GroupEvent(groupId, traits: groupTraits,
236-
integrations: _state.integrations.state); // Patch for Github Issue #152
232+
final event = GroupEvent(groupId, traits: groupTraits);
237233

238234
await _process(event);
239235
}
@@ -242,8 +238,7 @@ class Analytics with ClientMethods {
242238
Future alias(String newUserId) async {
243239
final userInfo = await state.userInfo.state;
244240
final event =
245-
AliasEvent(userInfo.userId ?? userInfo.anonymousId, userId: newUserId,
246-
integrations: _state.integrations.state); // Patch for Github Issue #152
241+
AliasEvent(userInfo.userId ?? userInfo.anonymousId, userId: newUserId);
247242

248243
await _process(event);
249244
}

packages/core/lib/event.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ abstract class RawEvent with JSONSerialisable {
5555
@JsonKey(name: "_metadata")
5656
DestinationMetadata? metadata;
5757

58-
RawEvent(this.type, {this.anonymousId, this.userId, this.integrations,}); // Patch for Github Issue #152
58+
RawEvent(this.type, {this.anonymousId, this.userId});
5959
}
6060

6161
@JsonSerializable(explicitToJson: true)
@@ -79,7 +79,7 @@ class TrackEvent extends RawEvent {
7979
String event;
8080
Map<String, dynamic>? properties;
8181

82-
TrackEvent(this.event, {this.properties, Map<String, dynamic>? integrations,}) : super(EventType.track, integrations: integrations,); // Patch for Github Issue #152
82+
TrackEvent(this.event, {this.properties}) : super(EventType.track);
8383

8484
factory TrackEvent.fromJson(Map<String, dynamic> json) =>
8585
_$TrackEventFromJson(json);
@@ -90,8 +90,8 @@ class TrackEvent extends RawEvent {
9090
@JsonSerializable(explicitToJson: true)
9191
class IdentifyEvent extends RawEvent {
9292
UserTraits? traits;
93-
IdentifyEvent({this.traits, String? userId, Map<String, dynamic>? integrations})
94-
: super(EventType.identify, userId: userId, integrations: integrations); // Patch for Github Issue #152
93+
IdentifyEvent({this.traits, String? userId})
94+
: super(EventType.identify, userId: userId);
9595

9696
factory IdentifyEvent.fromJson(Map<String, dynamic> json) =>
9797
_$IdentifyEventFromJson(json);
@@ -105,7 +105,7 @@ class GroupEvent extends RawEvent {
105105
String groupId;
106106
GroupTraits? traits;
107107

108-
GroupEvent(this.groupId, {this.traits, Map<String, dynamic>? integrations}) : super(EventType.group, integrations: integrations); // Patch for Github Issue #152
108+
GroupEvent(this.groupId, {this.traits}) : super(EventType.group);
109109

110110
factory GroupEvent.fromJson(Map<String, dynamic> json) =>
111111
_$GroupEventFromJson(json);
@@ -117,8 +117,8 @@ class GroupEvent extends RawEvent {
117117
class AliasEvent extends RawEvent {
118118
String previousId;
119119

120-
AliasEvent(this.previousId, {String? userId, Map<String, dynamic>? integrations})
121-
: super(EventType.alias, userId: userId, integrations: integrations); // Patch for Github Issue #152
120+
AliasEvent(this.previousId, {String? userId})
121+
: super(EventType.alias, userId: userId);
122122

123123
factory AliasEvent.fromJson(Map<String, dynamic> json) =>
124124
_$AliasEventFromJson(json);
@@ -134,7 +134,7 @@ class ScreenEvent extends RawEvent {
134134
ScreenEvent(
135135
this.name, {
136136
this.properties,
137-
Map<String, dynamic>? integrations}) : super(EventType.screen, integrations: integrations); // Patch for Github Issue #152
137+
}) : super(EventType.screen);
138138

139139
factory ScreenEvent.fromJson(Map<String, dynamic> json) =>
140140
_$ScreenEventFromJson(json);

0 commit comments

Comments
 (0)