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

Mixpanel track event > track(String, Map<String, dynamic>) function have issue. Kindly correct it. Added the solution. #72

Closed
akshayindia opened this issue Apr 25, 2022 · 7 comments

Comments

@akshayindia
Copy link

Hi Mixpanel Team,

instead of this
void track(String eventName, {Map<String, dynamic>?} properties) {

it should be function -
void track(String eventName, Map<String, dynamic>? properties) {

I've attached the screenshot and changed it in my project. please do change the plugin as well.

Screenshot 2022-04-25 at 5 32 29 PM

@akshayindia akshayindia changed the title .track(String, Map<String, Dynamic>) function have issue. Kindly correct it. Mixpanel track event > track(String, Map<String, Dynamic>) function have issue. Kindly correct it. Added the solution. Apr 25, 2022
@akshayindia akshayindia changed the title Mixpanel track event > track(String, Map<String, Dynamic>) function have issue. Kindly correct it. Added the solution. Mixpanel track event > track(String, Map<String, dynamic>) function have issue. Kindly correct it. Added the solution. Apr 25, 2022
@hamirshekhawat
Copy link

Why do you want the named parameter to be removed?

@jaredmixpanel
Copy link
Collaborator

@akshayindia the properties argument is optional, the { } indicate that.

@akshayindia
Copy link
Author

Hi @jaredmixpanel,

Thanks for the comment.

Then there is a little error to make it optional you have to put the named parameter in the {} bracket.
correct > {Map<String, dynamic>? properties}
wrong > {Map<String, dynamic>?} properties
or if you want to make it positional then in square bracket [].

Kindly make the changes.
document for ref - https://medium.com/jay-tillu/optional-arguments-in-dart-9114152a0da3

Looking forward to it.

@akshayindia
Copy link
Author

akshayindia commented May 10, 2022

Why do you want the named parameter to be removed?

I don't want to remove the named parameter, I want to correct it, or make it optional as the code is having errors while debugging or make it non-optional.

I've made changes in my project but this is in the interest of Mixpanel and organizations who want to implement Mixpanel in their Flutter application.

I got this error in Mixpanel SDK - 1.4.5

@jaredmixpanel
Copy link
Collaborator

@hamirshekhawat
Copy link

@akshayindia I think you should add mixpanel to a fresh project and check the code again for version 1.4.5. The mistake you are mentioning doesn't exist. If you are getting errors, you must've done some changes directly to the source in pub-cache code. It is recommended not to edit that code.
For your reference please check this in git history for version 1.4.5 -

void track(String eventName, {Map<String, dynamic>? properties}) {

For future reference, confirm the error by cloning the library and checking history, match with your error and then create an issue.

@akshayindia
Copy link
Author

akshayindia commented May 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants