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

Type 'Future<dynamic>' is not a subtype of type 'Future<Map<String, double>>' #28

Closed
foolzoom opened this issue Apr 1, 2018 · 9 comments

Comments

@foolzoom
Copy link

foolzoom commented Apr 1, 2018

Hi! I have the kind of error, when I try to get location:

type 'Future<dynamic>' is not a subtype of type 'Future<Map<String, double>>' where Future is from dart:async Future is from dart:async Map is from dart:core String is from dart:core double is from dart:core

The first string of the stack trace:
#0 Location.getLocation (package:location/location.dart:12:16)

@marcmunro
Copy link

I too am getting this. I investigated further by hacking my own Location class, changing the signature of getLocation to:

Future<dynamic>

This got me past the problem statement leading to this:
...type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, double>' where...

So, it looks like:

 _channel.invokeMethod('getLocation');

Is returning an object of type:

_InternalLinkedHashMap<dynamic, dynamic>'

I hope this helps. For now, I will be tweaking my hacked version but I'd like to return to the proper version later.
If there is more investigation I can do for you, please ask.

@efortuna
Copy link

efortuna commented Apr 4, 2018

I made a fix for this issue, and submitted a PR, but in the meanwhile, you can just point to my fork: https://github.com/efortuna/flutterlocation

@GoHash-Include
Copy link

I updated flutter to the latest version, after update am getting too many bugs like above, now how can I fix this issues.
screen shot 2018-04-04 at 11 09 00 pm

@efortuna
Copy link

efortuna commented Apr 4, 2018

Did you see my link? Put this in your pubspec.yaml:

location:
    git: git://github.com/efortuna/flutterlocation.git

@GoHash-Include
Copy link

do you want remove this flutter package location: "^1.1.7" and put your code or keep both ?

@efortuna
Copy link

efortuna commented Apr 4, 2018

Until my PR is accepted: #27... linking to my code is a stopgap to make your code work. You don't need the '^1.1.7' -- just the two lines I listed above.

@carter3rix
Copy link

I made a fix for this issue, and submitted a PR, but in the meanwhile, you can just point to my fork: https://github.com/efortuna/flutterlocation

Hi @efortuna please how do i point to your fork to use in my project... Hope you can give me a guide.
Thank you

@efortuna
Copy link

efortuna commented Apr 2, 2019

@carter3rix
Copy link

carter3rix commented Apr 10, 2019

https://www.dartlang.org/tools/pub/dependencies#git-packages

Thanks... But wen I added got error in pub spec... Dart SDK version 2.2.1 but location from git requires SDK version <2.0.0, version solving failed ...

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

6 participants