From 3d3233cbb338425f09e0fcdfa0dd1ce9ffe8bcd5 Mon Sep 17 00:00:00 2001 From: Rishabh Jain Date: Thu, 24 Oct 2024 15:25:21 +0530 Subject: [PATCH] chore(dependencies): Updated segment_analytics_plugin_firebase dependencies. - Updates minimum supported SDK version to Flutter 3.16/Dart 3.2 - Updates firebase_analytics to 11.3.3. - Updates firebase_core to 3.6.0. fix: FirebaseAnalytics.instance.logEvent not accepting nullable values. --- .../plugins/plugin_firebase/lib/properties.dart | 16 ++++++++++------ packages/plugins/plugin_firebase/pubspec.yaml | 14 ++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/plugins/plugin_firebase/lib/properties.dart b/packages/plugins/plugin_firebase/lib/properties.dart index 8ae6142..8f316d4 100644 --- a/packages/plugins/plugin_firebase/lib/properties.dart +++ b/packages/plugins/plugin_firebase/lib/properties.dart @@ -28,14 +28,18 @@ String sanitizeEventName(String eventName) { return eventName.replaceAll(RegExp(r'[^a-zA-Z0-9]'), '_'); } -Map castParameterType(Map properties) { - return properties.map((key, value) { - if (value is String || value is num || value == null) { - return MapEntry(key, value); - } else { - return MapEntry(key, value.toString()); +Map castParameterType(Map properties) { + Map safeProperties = {}; + properties.forEach((key, value) { + if (value != null) { + if (value is String || value is num) { + safeProperties[key] = value; + } else { + safeProperties[key] = value.toString(); + } } }); + return safeProperties; } @JsonSerializable() diff --git a/packages/plugins/plugin_firebase/pubspec.yaml b/packages/plugins/plugin_firebase/pubspec.yaml index 0ea74f2..87549b0 100644 --- a/packages/plugins/plugin_firebase/pubspec.yaml +++ b/packages/plugins/plugin_firebase/pubspec.yaml @@ -6,21 +6,19 @@ repository: https://github.com/segmentio/analytics_flutter/tree/main/packages/pl issue_tracker: https://github.com/segmentio/analytics_flutter/issues environment: - sdk: '>=2.19.2 <4.0.0' - flutter: ">=1.17.0" + sdk: '>=3.2.0 <4.0.0' + flutter: ">=3.16.0" dependencies: - firebase_analytics: ^11.3.2 - firebase_core: ^3.5.0 + firebase_analytics: ^11.3.3 + firebase_core: ^3.6.0 flutter: sdk: flutter json_annotation: ^4.8.0 - segment_analytics: ^1.0.0 + segment_analytics: ^1.1.1 dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - flutter_lints: ^2.0.0 - -flutter: + flutter_lints: ^4.0.0 \ No newline at end of file