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

Can not convert cubeSession into jsonString using json.encode().. #50

Closed
wrteam-priyansh opened this issue Dec 15, 2020 · 7 comments
Closed

Comments

@wrteam-priyansh
Copy link

wrteam-priyansh commented Dec 15, 2020

In order to save cubeSession into local storage i need to convert it into jsonString..
Here is my code :

Map<String,dynamic> jsonSession = cubeSession.toJson();
String jsonString = json.encode(jsonSession)

getting following error
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Converting object to an encodable object failed: Instance of 'CubeUser'

@TatankaConCube
Copy link
Contributor

@wrteam-priyansh thank you for reporting this issue, we will fix it in the next version of our SDK

@wrteam-priyansh
Copy link
Author

@TatankaConCube i have solved this issue by converting DateTime into toIso8601String

@TatankaConCube
Copy link
Contributor

it does not completely resolve your issue, in this case, the field tokenExpirationDate will not be saved to json. Just wait new release, we plan to do this today or tomorrow.

@wrteam-priyansh
Copy link
Author

Ok

@TatankaConCube
Copy link
Contributor

Or you can add it manually to your jsonSession, and set it after decoding the json

@wrteam-priyansh
Copy link
Author

Yes I have added manually

@TatankaConCube
Copy link
Contributor

today we released a new version, which contains the fix for your issue, please try it.

If your issue was resolved, please close this ticket.

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

2 participants