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

Cast Exception on using tokenAdditionalParameters Map #86

Closed
svendroid opened this issue Feb 20, 2020 · 3 comments · Fixed by #87
Closed

Cast Exception on using tokenAdditionalParameters Map #86

svendroid opened this issue Feb 20, 2020 · 3 comments · Fixed by #87

Comments

@svendroid
Copy link
Contributor

When using the method token of method_channel_flutter_appauth.dart the tokenAdditionalParameters attribute of the returned TokenResponse throws following Exception, as soon as I use it:

[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: type 'int' is not a subtype of type 'String' in type cast
#0      CastMap.forEach.<anonymous closure> (dart:_internal/cast.dart:288:25)
#1      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
#2      CastMap.forEach (dart:_internal/cast.dart:287:13)
#3      MapBase.mapToString (dart:collection/maps.dart:35:9)
#4      MapMixin.toString (dart:collection/maps.dart:192:32)
#5      _StringBase._interpolate (dart:core-patch/string_patch.dart:845:19)

The cause for this problem is the cast in this line

result['tokenAdditionalParameters']?.cast<String, String>());

it should be cast to
result['tokenAdditionalParameters']?.cast<String, dynamic>());.

@MaikuB
Copy link
Owner

MaikuB commented Feb 20, 2020

Oh bugger, thanks for picking up on that!

@svendroid
Copy link
Contributor Author

Should I provide a pull request? I would only need to push it

@MaikuB
Copy link
Owner

MaikuB commented Feb 20, 2020

If you could then that would be great. I don't think I've done it I've setup a template for this repo yet but can you prefix the PR's title with [flutter_appauth_platform_interface] as well?

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