diff --git a/packages/analytics/example/lib/pages/rudderstack.dart b/packages/analytics/example/lib/pages/rudderstack.dart index eccb7df3e..26749ebe7 100644 --- a/packages/analytics/example/lib/pages/rudderstack.dart +++ b/packages/analytics/example/lib/pages/rudderstack.dart @@ -1,3 +1,4 @@ +import 'package:analytics/sdk/rudderstack/models/user_info.dart'; import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:flutter/material.dart'; @@ -15,8 +16,6 @@ class _RudderStackState extends State { @override void initState() { super.initState(); - - } @override @@ -65,8 +64,8 @@ class _RudderStackState extends State { onTap: () async { await DerivRudderstack() .setContext(token: 'xxx-xxxx-xxxx-xxxxx-xxxx-test'); - final bool result = - await DerivRudderstack().identify(userId: '998'); + final bool result = await DerivRudderstack() + .identify(userInfo: UserInfo(userId: 988)); _showSnackBar(context, result); }, ), @@ -81,9 +80,8 @@ class _RudderStackState extends State { )), ), onTap: () async { - final bool result = await DerivRudderstack().track( - eventName: 'Application Opened' - ); + final bool result = await DerivRudderstack() + .track(eventName: 'Application Opened'); _showSnackBar(context, result); }), @@ -98,9 +96,8 @@ class _RudderStackState extends State { )), ), onTap: () async { - final bool result = await DerivRudderstack().screen( - screenName: 'main' - ); + final bool result = + await DerivRudderstack().screen(screenName: 'main'); _showSnackBar(context, result); }), @@ -115,9 +112,8 @@ class _RudderStackState extends State { )), ), onTap: () async { - final bool result = await DerivRudderstack().group( - groupId: 'Group-id-test' - ); + final bool result = + await DerivRudderstack().group(groupId: 'Group-id-test'); _showSnackBar(context, result); }), InkWell( diff --git a/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart b/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart index aec6040cb..784d9b04f 100644 --- a/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart +++ b/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart @@ -69,13 +69,10 @@ class DerivFirebaseAnalytics implements BaseAnalytics { /// Logs a custom Flutter Analytics event with the given [name] and event [parameters]. Future logEvent({ required String name, - Map? parameters, + Map? parameters, }) async => _execute(() async { - await _firebaseAnalytics.logEvent( - name: name, - parameters: parameters, - ); + await _firebaseAnalytics.logEvent(name: name, parameters: parameters); }); /// Sets the user ID property. diff --git a/packages/analytics/pubspec.yaml b/packages/analytics/pubspec.yaml index 13a931242..ae4f5ddfa 100644 --- a/packages/analytics/pubspec.yaml +++ b/packages/analytics/pubspec.yaml @@ -11,8 +11,8 @@ environment: dependencies: - firebase_analytics: ^10.6.2 - firebase_core: ^2.20.0 + firebase_core: ^3.5.0 + firebase_analytics: ^11.3.2 rudder_sdk_flutter: ^2.6.0 datadog_flutter_plugin: ^1.6.2 diff --git a/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart b/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart index 69c051360..82f01e30e 100644 --- a/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart +++ b/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart @@ -36,8 +36,7 @@ void main() { await derivFirebaseAnalytics.setCurrentScreen(screenName: screenName); - verify(() => - mockFirebaseAnalytics.logScreenView(screenName: screenName)) + verify(() => mockFirebaseAnalytics.logScreenView(screenName: screenName)) .called(1); }); @@ -75,7 +74,7 @@ void main() { test('should call logEvent with correct parameters', () async { const String name = 'test_name'; - const Map params = {}; + const Map params = {}; when(() => mockFirebaseAnalytics.logEvent( name: name,