Skip to content

Commit

Permalink
chore(dependencies): Updated segment_analytics_plugin_firebase depend…
Browse files Browse the repository at this point in the history
…encies. (#115)

- 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.

Co-authored-by: Rishabh Jain <risjain@twilio.com>
  • Loading branch information
Rjaintwilio and rishabh-twilio authored Oct 30, 2024
1 parent 4b4d1ab commit d6f74b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
16 changes: 10 additions & 6 deletions packages/plugins/plugin_firebase/lib/properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ String sanitizeEventName(String eventName) {
return eventName.replaceAll(RegExp(r'[^a-zA-Z0-9]'), '_');
}

Map<String, Object?> castParameterType(Map<String, Object?> 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<String, Object> castParameterType(Map<String, Object?> properties) {
Map<String, Object> 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()
Expand Down
14 changes: 6 additions & 8 deletions packages/plugins/plugin_firebase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d6f74b6

Please sign in to comment.