diff --git a/packages/core/lib/analytics.dart b/packages/core/lib/analytics.dart index f3f5c22..1508d12 100644 --- a/packages/core/lib/analytics.dart +++ b/packages/core/lib/analytics.dart @@ -69,7 +69,7 @@ class Analytics with ClientMethods { addPlugin(segmentDestination); } - if(config.token != null) { + if (config.token != null) { _platformPlugins.add(InjectToken(config.token!)); } @@ -210,30 +210,26 @@ class Analytics with ClientMethods { @override Future track(String event, {Map? properties}) async { - await _process(TrackEvent(event, properties: properties ?? {}, - integrations: _state.integrations.state)); // Patch for Github Issue #152 + await _process(TrackEvent(event, properties: properties ?? {})); } @override Future screen(String name, {Map? properties}) async { - final event = ScreenEvent(name, properties: properties ?? {}, - integrations: _state.integrations.state); // Patch for Github Issue #152 + final event = ScreenEvent(name, properties: properties ?? {}); await _process(event); } @override Future identify({String? userId, UserTraits? userTraits}) async { - final event = IdentifyEvent(userId: userId, traits: userTraits, - integrations: _state.integrations.state); // Patch for Github Issue #152 + final event = IdentifyEvent(userId: userId, traits: userTraits); await _process(event); } @override Future group(String groupId, {GroupTraits? groupTraits}) async { - final event = GroupEvent(groupId, traits: groupTraits, - integrations: _state.integrations.state); // Patch for Github Issue #152 + final event = GroupEvent(groupId, traits: groupTraits); await _process(event); } @@ -242,8 +238,7 @@ class Analytics with ClientMethods { Future alias(String newUserId) async { final userInfo = await state.userInfo.state; final event = - AliasEvent(userInfo.userId ?? userInfo.anonymousId, userId: newUserId, - integrations: _state.integrations.state); // Patch for Github Issue #152 + AliasEvent(userInfo.userId ?? userInfo.anonymousId, userId: newUserId); await _process(event); } diff --git a/packages/core/lib/event.dart b/packages/core/lib/event.dart index 9507f63..0cca9b4 100644 --- a/packages/core/lib/event.dart +++ b/packages/core/lib/event.dart @@ -55,7 +55,7 @@ abstract class RawEvent with JSONSerialisable { @JsonKey(name: "_metadata") DestinationMetadata? metadata; - RawEvent(this.type, {this.anonymousId, this.userId, this.integrations,}); // Patch for Github Issue #152 + RawEvent(this.type, {this.anonymousId, this.userId}); } @JsonSerializable(explicitToJson: true) @@ -79,7 +79,7 @@ class TrackEvent extends RawEvent { String event; Map? properties; - TrackEvent(this.event, {this.properties, Map? integrations,}) : super(EventType.track, integrations: integrations,); // Patch for Github Issue #152 + TrackEvent(this.event, {this.properties}) : super(EventType.track); factory TrackEvent.fromJson(Map json) => _$TrackEventFromJson(json); @@ -90,8 +90,8 @@ class TrackEvent extends RawEvent { @JsonSerializable(explicitToJson: true) class IdentifyEvent extends RawEvent { UserTraits? traits; - IdentifyEvent({this.traits, String? userId, Map? integrations}) - : super(EventType.identify, userId: userId, integrations: integrations); // Patch for Github Issue #152 + IdentifyEvent({this.traits, String? userId}) + : super(EventType.identify, userId: userId); factory IdentifyEvent.fromJson(Map json) => _$IdentifyEventFromJson(json); @@ -105,7 +105,7 @@ class GroupEvent extends RawEvent { String groupId; GroupTraits? traits; - GroupEvent(this.groupId, {this.traits, Map? integrations}) : super(EventType.group, integrations: integrations); // Patch for Github Issue #152 + GroupEvent(this.groupId, {this.traits}) : super(EventType.group); factory GroupEvent.fromJson(Map json) => _$GroupEventFromJson(json); @@ -117,8 +117,8 @@ class GroupEvent extends RawEvent { class AliasEvent extends RawEvent { String previousId; - AliasEvent(this.previousId, {String? userId, Map? integrations}) - : super(EventType.alias, userId: userId, integrations: integrations); // Patch for Github Issue #152 + AliasEvent(this.previousId, {String? userId}) + : super(EventType.alias, userId: userId); factory AliasEvent.fromJson(Map json) => _$AliasEventFromJson(json); @@ -134,7 +134,7 @@ class ScreenEvent extends RawEvent { ScreenEvent( this.name, { this.properties, - Map? integrations}) : super(EventType.screen, integrations: integrations); // Patch for Github Issue #152 + }) : super(EventType.screen); factory ScreenEvent.fromJson(Map json) => _$ScreenEventFromJson(json);