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

Unhandled Exception: type 'Future<dynamic>' is not a subtype of type 'FutureOr<Map<dynamic, dynamic>>' in type cast #29

Closed
natintosh opened this issue Mar 25, 2021 · 3 comments · Fixed by #30

Comments

@natintosh
Copy link
Contributor

Hi @emostar,

It seems like the cast you did here is no longer valid

PhoneNumberUtil.getRegionInfo (package:libphonenumber/libphonenumber.dart:78:8)

natintosh added a commit to natintosh/flutter-libphonenumber that referenced this issue Mar 25, 2021
…mic>' is not a subtype of type 'FutureOr<Map<dynamic, dynamic>>' in type cast
@natintosh
Copy link
Contributor Author

Hi, @emostar any update for this PR.

@krunaldoshi2019
Copy link

hi @emostar any update for this PR?

@ahmedfef
Copy link

ahmedfef commented Jun 12, 2021

This is still not fixed!
You should fix the casting type.

For now, I changed the package files to make it work till they release a proper update for it.
Inside: \libphonenumber-2.0.0\lib\libphonenumber.dart

Change the following:
Map<dynamic, dynamic> result = await (_channel.invokeMethod('getRegionInfo', { 'phone_number': phoneNumber, 'iso_code': isoCode, }) as FutureOr<Map<dynamic, dynamic>>);

To
Map<dynamic, dynamic> result = await (_channel.invokeMethod('getRegionInfo', { 'phone_number': phoneNumber, 'iso_code': isoCode, }) as Future<dynamic>);

emostar added a commit that referenced this issue Jun 14, 2021
#29: Fixed issue with - Unhandled Exception
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

Successfully merging a pull request may close this issue.

3 participants