Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_analytics]: typing of event parameters to Map<String, Object>? is not working #12969

Closed
1 task done
tuyennvt opened this issue Jun 17, 2024 · 4 comments
Closed
1 task done
Assignees
Labels
Needs Attention This issue needs maintainer attention. resolution: invalid This doesn't seem right and might not belong here. type: bug Something isn't working

Comments

@tuyennvt
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Analytics

Which platforms are affected?

Android, iOS

Description

final parameters = <String, Object>{
'signup_fail_other': false,
'signup_fail_phone_existed': true,
};
_firebaseAnalytics.logEvent('signup_fail', parameters)

Expected:
log event success

Actually:
'package:firebase_analytics/src/firebase_analytics.dart': Failed assertion: line 1351 pos 9: 'value is String || value is num': 'string' OR 'number' must be set as the value of the parameter: signup_fail_other. false found instead

Reproducing the issue

Use description to the reproduce

Firebase Core version

3.1.0

Flutter Version

11.0.1

Relevant Log Output

I/flutter ( 9282): 'package:firebase_analytics/src/firebase_analytics.dart': Failed assertion: line 1351 pos 9: 'value is String || value is num': 'string' OR 'number' must be set as the value of the parameter: signup_fail_other. false found instead
I/flutter ( 9282): 
I/flutter ( 9282): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
I/flutter ( 9282): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
I/flutter ( 9282): #2      _assertParameterTypesAreCorrect.<anonymous closure> (package:firebase_analytics/src/firebase_analytics.dart:1351:9)
I/flutter ( 9282): #3      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13)
I/flutter ( 9282): #4      _assertParameterTypesAreCorrect (package:firebase_analytics/src/firebase_analytics.dart:1349:17)
I/flutter ( 9282): #5      FirebaseAnalytics.logEvent (package:firebase_analytics/src/firebase_analytics.dart:100:5)
I/flutter ( 9282): #6      AnalyticsUtils.logEvent (package:edupia_class/shared/utils/analytics_utils.dart:14:32)
I/flutter ( 9282): #7      _SignUpPageState._logEventAnalyticSignUpFailure (package:edupia_class/presentation/auth/sign_up/sign_up_page.dart:123:20)
I/flutter ( 9282): #8      _SignUpPageState._submitForm (package:edupia_class/presentation/auth/sign_up/sign_up_page.dart:109:5)
I/flutter ( 9282): #9      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1183:21)
I/flutter ( 9282): #10     GestureRecognizer.invokeC

Flutter dependencies

Dart SDK 3.3.3
Flutter SDK 3.19.5

dependencies:

  • app_settings 5.1.1 [flutter plugin_platform_interface]
  • audioplayers 5.2.1 [audioplayers_android audioplayers_darwin audioplayers_linux audioplayers_platform_interface audioplayers_web audioplayers_windows file flutter http meta path_provider synchronized uuid]
  • cached_network_image 3.3.1 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image]
  • camera 0.10.6 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle]
  • collection 1.18.0
  • connectivity_plus 6.0.3 [flutter flutter_web_plugins connectivity_plus_platform_interface web meta nm collection]
  • cupertino_icons 1.0.8
  • dartz 0.10.1
  • dio 5.4.3+1 [async http_parser meta path]
  • dotted_border 2.1.0 [flutter path_drawing]
  • dotted_line 3.2.2 [flutter]
  • equatable 2.0.5 [collection meta]
  • file_picker 6.1.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32]
  • firebase_analytics 11.0.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
  • firebase_core 3.1.0 [firebase_core_platform_interface firebase_core_web flutter meta]
  • firebase_crashlytics 4.0.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
  • firebase_messaging 15.0.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
  • flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
  • flutter_bloc 8.1.5 [bloc flutter provider]
  • flutter_cached_pdfview 0.4.2 [flutter flutter_pdfview flutter_cache_manager path_provider path]
  • flutter_html 3.0.0-beta.2 [html csslib collection list_counter flutter]
  • flutter_local_notifications 17.1.2 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
  • flutter_math_fork 0.7.2 [flutter flutter_svg provider meta collection tuple]
  • flutter_native_splash 2.4.0 [args flutter flutter_web_plugins html image meta path universal_io xml yaml ansicolor]
  • flutter_shakemywidget 1.0.5+1 [flutter cupertino_icons]
  • flutter_sound 9.2.13 [path_provider recase uuid provider path synchronized logger flutter flutter_sound_platform_interface flutter_sound_web]
  • flutter_svg 2.0.10+1 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler]
  • flutter_ume_kit_console_plus 2.0.5 [flutter tuple shared_preferences flutter_ume_plus share_plus]
  • flutter_ume_kit_device_plus 2.0.0 [flutter flutter_ume_plus system_info device_info platform]
  • flutter_ume_kit_dio_plus 3.4.5 [flutter flutter_ume_plus dio flex_color_scheme freezed_annotation json_serializable]
  • flutter_ume_kit_ui_plus 2.0.0 [flutter flutter_ume_plus touch_indicator image quiver basics]
  • flutter_ume_plus 3.0.2 [flutter flutter_localizations shared_preferences vm_service tuple]
  • fluttertoast 8.2.5 [flutter flutter_web_plugins]
  • focus_detector_v2 3.1.0+1 [flutter visibility_detector]
  • freezed_annotation 2.4.1 [collection json_annotation meta]
  • get 4.6.6 [flutter]
  • google_mlkit_face_detection 0.11.0 [flutter google_mlkit_commons]
  • image_picker 0.8.6 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
  • in_app_purchase 3.1.12 [flutter in_app_purchase_android in_app_purchase_platform_interface in_app_purchase_storekit]
  • intl 0.18.1 [clock meta path]
  • json_annotation 4.8.1 [meta]
  • loading_animation_widget 1.2.1 [flutter]
  • lottie 3.1.0 [archive flutter http path vector_math]
  • package_info_plus 8.0.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32 clock]
  • path_provider 2.1.3 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
  • permission_handler 11.0.1 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
  • pinput 4.0.0 [flutter smart_auth universal_platform]
  • record 5.1.1 [flutter uuid record_platform_interface record_web record_windows record_linux record_android record_darwin]
  • rxdart 0.27.7
  • scroll_to_index 3.0.1 [flutter]
  • shared_preferences 2.2.3 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
  • shimmer 3.0.0 [flutter]
  • showcaseview 3.0.0 [flutter]
  • speech_to_text 6.6.0 [flutter speech_to_text_platform_interface speech_to_text_macos json_annotation clock pedantic flutter_web_plugins meta js]
  • stomp_dart_client 1.0.3 [web_socket_channel]
  • super_tool_tip 0.0.1 [flutter]
  • table_calendar 3.0.9 [flutter intl simple_gesture_detector]
  • url_launcher 6.2.6 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
  • video_player 2.8.7 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web]
  • webview_flutter 4.7.0 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview]
  • youtube_player_flutter 9.0.1 [flutter flutter_inappwebview]

dev dependencies:

  • build_runner 2.4.9 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
  • flutter_lints 3.0.2 [lints]
  • flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]
  • freezed 2.5.2 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation]
  • json_serializable 6.7.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]

dependency overrides:

  • record_android 1.1.0 [flutter record_platform_interface]
  • webview_flutter_android 3.16.1 [flutter webview_flutter_platform_interface]

transitive dependencies:

  • _fe_analyzer_shared 67.0.0 [meta]
  • _flutterfire_internals 1.3.37 [collection firebase_core firebase_core_platform_interface flutter meta]
  • analyzer 6.4.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
  • ansicolor 2.0.2
  • archive 3.6.1 [crypto path]
  • args 2.5.0
  • async 2.11.0 [collection meta]
  • audioplayers_android 4.0.3 [audioplayers_platform_interface flutter]
  • audioplayers_darwin 5.0.2 [audioplayers_platform_interface flutter]
  • audioplayers_linux 3.1.0 [audioplayers_platform_interface flutter]
  • audioplayers_platform_interface 6.1.0 [flutter meta plugin_platform_interface]
  • audioplayers_web 4.1.0 [audioplayers_platform_interface flutter flutter_web_plugins js]
  • audioplayers_windows 3.1.0 [audioplayers_platform_interface flutter]
  • basics 0.10.0 [characters]
  • bloc 8.1.4 [meta]
  • boolean_selector 2.1.1 [source_span string_scanner]
  • build 2.4.1 [analyzer async convert crypto glob logging meta package_config path]
  • build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
  • build_daemon 4.0.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
  • build_resolvers 2.4.2 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml]
  • build_runner_core 7.3.0 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
  • built_collection 5.1.1
  • built_value 8.9.2 [built_collection collection fixnum meta]
  • cached_network_image_platform_interface 4.0.0 [flutter flutter_cache_manager]
  • cached_network_image_web 1.2.0 [cached_network_image_platform_interface flutter flutter_cache_manager]
  • camera_android 0.10.9+2 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform]
  • camera_avfoundation 0.9.16 [camera_platform_interface flutter stream_transform]
  • camera_platform_interface 2.7.4 [cross_file flutter plugin_platform_interface stream_transform]
  • camera_web 0.3.3 [camera_platform_interface flutter flutter_web_plugins stream_transform]
  • characters 1.3.0
  • checked_yaml 2.0.3 [json_annotation source_span yaml]
  • clock 1.1.1
  • code_builder 4.10.0 [built_collection built_value collection matcher meta]
  • connectivity_plus_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
  • convert 3.1.1 [typed_data]
  • cross_file 0.3.4+1 [meta web]
  • crypto 3.0.3 [typed_data]
  • csslib 0.17.3 [source_span]
  • dart_style 2.3.6 [analyzer args collection path pub_semver source_span]
  • dbus 0.7.10 [args ffi meta xml]
  • device_info 2.0.3 [flutter device_info_platform_interface]
  • device_info_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
  • fake_async 1.3.1 [clock collection]
  • ffi 2.1.2
  • file 7.0.0 [meta path]
  • file_utils 1.0.1 [globbing path]
  • firebase_analytics_platform_interface 4.0.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
  • firebase_analytics_web 0.5.7+9 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins]
  • firebase_core_platform_interface 5.1.0 [collection flutter flutter_test meta plugin_platform_interface]
  • firebase_core_web 2.17.2 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
  • firebase_crashlytics_platform_interface 3.6.37 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
  • firebase_messaging_platform_interface 4.5.39 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
  • firebase_messaging_web 3.8.9 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins meta web]
  • fixnum 1.1.0
  • flex_color_scheme 7.3.1 [flex_seed_scheme flutter meta]
  • flex_seed_scheme 1.5.0 [collection flutter meta]
  • flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid]
  • flutter_inappwebview 6.0.0 [flutter flutter_inappwebview_platform_interface flutter_inappwebview_android flutter_inappwebview_ios flutter_inappwebview_macos flutter_inappwebview_web]
  • flutter_inappwebview_android 1.0.13 [flutter flutter_inappwebview_platform_interface]
  • flutter_inappwebview_internal_annotations 1.1.1
  • flutter_inappwebview_ios 1.0.13 [flutter flutter_inappwebview_platform_interface]
  • flutter_inappwebview_macos 1.0.11 [flutter flutter_inappwebview_platform_interface]
  • flutter_inappwebview_platform_interface 1.0.10 [flutter flutter_inappwebview_internal_annotations plugin_platform_interface]
  • flutter_inappwebview_web 1.0.8 [flutter flutter_web_plugins js flutter_inappwebview_platform_interface]
  • flutter_local_notifications_linux 4.0.0+1 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories]
  • flutter_local_notifications_platform_interface 7.1.0 [flutter plugin_platform_interface]
  • flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
  • flutter_pdfview 1.3.2 [flutter]
  • flutter_plugin_android_lifecycle 2.0.19 [flutter]
  • flutter_sound_platform_interface 9.2.13 [flutter meta plugin_platform_interface logger]
  • flutter_sound_web 9.2.13 [flutter_sound_platform_interface flutter logger flutter_web_plugins meta js]
  • flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
  • frontend_server_client 4.0.0 [async path]
  • glob 2.1.2 [async collection file path string_scanner]
  • globbing 1.0.0 [path]
  • google_mlkit_commons 0.7.1 [flutter]
  • graphs 2.3.1 [collection]
  • html 0.15.4 [csslib source_span]
  • http 1.2.1 [async http_parser meta web]
  • http_multi_server 3.2.1 [async]
  • http_parser 4.0.2 [collection source_span string_scanner typed_data]
  • image 4.2.0 [archive meta xml]
  • image_picker_android 0.8.12+1 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
  • image_picker_for_web 2.2.0 [flutter flutter_web_plugins image_picker_platform_interface mime]
  • image_picker_ios 0.8.12 [flutter image_picker_platform_interface]
  • image_picker_platform_interface 2.10.0 [cross_file flutter http plugin_platform_interface]
  • in_app_purchase_android 0.3.6 [collection flutter in_app_purchase_platform_interface json_annotation]
  • in_app_purchase_platform_interface 1.4.0 [flutter plugin_platform_interface]
  • in_app_purchase_storekit 0.3.16 [collection flutter in_app_purchase_platform_interface json_annotation]
  • io 1.0.4 [meta path string_scanner]
  • js 0.6.7 [meta]
  • leak_tracker 10.0.0 [clock collection meta path vm_service]
  • leak_tracker_flutter_testing 2.0.1 [flutter leak_tracker leak_tracker_testing matcher meta]
  • leak_tracker_testing 2.0.1 [leak_tracker matcher meta]
  • lints 3.0.0
  • list_counter 1.0.2
  • logger 1.4.0
  • logging 1.2.0
  • matcher 0.12.16+1 [async meta stack_trace term_glyph test_api]
  • material_color_utilities 0.8.0 [collection]
  • meta 1.11.0
  • mime 1.0.5
  • nested 1.0.0 [flutter]
  • nm 0.5.0 [dbus]
  • octo_image 2.0.0 [flutter]
  • package_config 2.1.0 [path]
  • package_info_plus_platform_interface 3.0.0 [flutter meta plugin_platform_interface]
  • path 1.9.0
  • path_drawing 1.0.1 [vector_math meta path_parsing flutter]
  • path_parsing 1.0.1 [vector_math meta]
  • path_provider_android 2.2.4 [flutter path_provider_platform_interface]
  • path_provider_foundation 2.4.0 [flutter path_provider_platform_interface]
  • path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
  • path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface]
  • path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32]
  • pedantic 1.11.1
  • permission_handler_android 11.1.0 [flutter permission_handler_platform_interface]
  • permission_handler_apple 9.1.4 [flutter permission_handler_platform_interface]
  • permission_handler_platform_interface 3.12.0 [flutter meta plugin_platform_interface]
  • permission_handler_windows 0.1.3 [flutter permission_handler_platform_interface]
  • petitparser 6.0.2 [meta]
  • platform 3.1.5
  • plugin_platform_interface 2.1.8 [meta]
  • pool 1.5.1 [async stack_trace]
  • provider 6.1.2 [collection flutter nested]
  • pub_semver 2.1.4 [collection meta]
  • pubspec_parse 1.3.0 [checked_yaml collection json_annotation pub_semver yaml]
  • quiver 3.2.1 [matcher]
  • recase 4.1.0
  • record_darwin 1.1.0 [flutter record_platform_interface]
  • record_linux 0.7.1 [flutter record_platform_interface]
  • record_platform_interface 1.1.0 [flutter plugin_platform_interface]
  • record_web 1.1.0 [flutter flutter_web_plugins web record_platform_interface]
  • record_windows 1.0.3 [flutter record_platform_interface]
  • share_plus 9.0.0 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi web win32]
  • share_plus_platform_interface 4.0.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
  • shared_preferences_android 2.2.2 [flutter shared_preferences_platform_interface]
  • shared_preferences_foundation 2.4.0 [flutter shared_preferences_platform_interface]
  • shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
  • shared_preferences_platform_interface 2.3.2 [flutter plugin_platform_interface]
  • shared_preferences_web 2.3.0 [flutter flutter_web_plugins shared_preferences_platform_interface web]
  • shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
  • shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
  • shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
  • simple_gesture_detector 0.2.1 [flutter]
  • sky_engine 0.0.99
  • smart_auth 2.0.0 [flutter flutter_web_plugins]
  • source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml]
  • source_helper 1.3.4 [analyzer collection source_gen]
  • source_span 1.10.0 [collection path term_glyph]
  • speech_to_text_macos 1.1.0 [flutter plugin_platform_interface speech_to_text_platform_interface]
  • speech_to_text_platform_interface 2.2.0 [flutter meta plugin_platform_interface]
  • sqflite 2.3.3+1 [flutter sqflite_common path]
  • sqflite_common 2.5.4 [synchronized path meta]
  • stack_trace 1.11.1 [path]
  • stream_channel 2.1.2 [async]
  • stream_transform 2.1.0
  • string_scanner 1.2.0 [source_span]
  • synchronized 3.1.0+1
  • system_info 1.0.1 [file_utils path]
  • term_glyph 1.2.1
  • test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
  • timezone 0.9.3 [path]
  • timing 1.0.1 [json_annotation]
  • touch_indicator 2.0.0 [flutter]
  • tuple 2.0.2
  • typed_data 1.3.2 [collection]
  • universal_io 2.2.2 [collection meta typed_data]
  • universal_platform 1.1.0
  • url_launcher_android 6.3.2 [flutter url_launcher_platform_interface]
  • url_launcher_ios 6.3.0 [flutter url_launcher_platform_interface]
  • url_launcher_linux 3.1.1 [flutter url_launcher_platform_interface]
  • url_launcher_macos 3.2.0 [flutter url_launcher_platform_interface]
  • url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface]
  • url_launcher_web 2.3.1 [flutter flutter_web_plugins url_launcher_platform_interface web]
  • url_launcher_windows 3.1.1 [flutter url_launcher_platform_interface]
  • uuid 3.0.7 [crypto]
  • vector_graphics 1.1.11+1 [flutter http vector_graphics_codec]
  • vector_graphics_codec 1.1.11+1
  • vector_graphics_compiler 1.1.11+1 [args meta path_parsing xml vector_graphics_codec path]
  • vector_math 2.1.4
  • video_player_android 2.4.14 [flutter video_player_platform_interface]
  • video_player_avfoundation 2.6.1 [flutter video_player_platform_interface]
  • video_player_platform_interface 6.2.2 [flutter plugin_platform_interface]
  • video_player_web 2.3.1 [flutter flutter_web_plugins video_player_platform_interface web]
  • visibility_detector 0.4.0+2 [flutter]
  • vm_service 13.0.0
  • watcher 1.1.0 [async path]
  • web 0.5.1
  • web_socket_channel 2.4.5 [async crypto stream_channel web]
  • webview_flutter_platform_interface 2.10.0 [flutter meta plugin_platform_interface]
  • webview_flutter_wkwebview 3.13.1 [flutter path webview_flutter_platform_interface]
  • win32 5.5.0 [ffi]
  • xdg_directories 1.0.4 [meta path]
  • xml 6.5.0 [collection meta petitparser]
  • yaml 3.1.2 [collection source_span string_scanner]

Additional context and comments

I see the logEvent() method of the firebase_analytics package:
`Future logEvent({
required String name,
Map<String, Object>? parameters,
AnalyticsCallOptions? callOptions,
}) async {
_logEventNameValidation(name);

_assertParameterTypesAreCorrect(parameters);

await _delegate.logEvent(
  name: name,
  parameters: parameters,
  callOptions: callOptions,
);

}`

The problem is in the method:
_assertParameterTypesAreCorrect(parameters);

void _assertParameterTypesAreCorrect( Map<String, Object>? parameters, ) => parameters?.forEach((key, value) { assert( value is String || value is num, "'string' OR 'number' must be set as the value of the parameter: $key. $value found instead", ); });
Data type is Object, but 'assert' only accept String or num

@tuyennvt tuyennvt added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jun 17, 2024
@Lyokone Lyokone self-assigned this Jun 18, 2024
@Lyokone
Copy link
Contributor

Lyokone commented Jun 18, 2024

Yes, the assert prevents you from using Object that would be incorrect. The only accepted values are string or number not all Object. Since Dart does not support Union Types, we accept objects then filter out incorrect objects in the assert.

@Lyokone Lyokone closed this as completed Jun 18, 2024
@tuyennvt
Copy link
Author

So, What is the use of pull request #12427. There is no difference between converting from dynamic to Object

@Lyokone
Copy link
Contributor

Lyokone commented Jun 19, 2024

We try to remove usage of dynamic since it's too permissive and do not give enough informations about nullable fields.

@tuyennvt
Copy link
Author

We try to remove usage of dynamic since it's too permissive and do not give enough informations about nullable fields.

I appreciate your efforts. However, I believe it would be beneficial to clearly indicate the transition from dynamic to Object. This would help prevent any unnecessary confusion.

@Lyokone Lyokone added the resolution: invalid This doesn't seem right and might not belong here. label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. resolution: invalid This doesn't seem right and might not belong here. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants