Comments (15)
@a14n thanks! I'll take a look at that. I've upgraded the sdk constraint to >=2.12.0 <3.0.0
and it's complaining everywhere about null safety, but that's another issue. I'll get back to you if the error persist after checking the null safety issue.
from dart-google-maps.
I'm sorry but I don't have other ideas without code access :-/ Is your project public?
No, it's a private repo, but I'll try to create a public example project to show this issue
from dart-google-maps.
Thanks for the reproduction. To make it work you only have to add an import:
diff --git a/flutter_map_example/lib/map_parent_widget.dart b/flutter_map_example/lib/map_parent_widget.dart
index 90b7916..d83a562 100644
--- a/flutter_map_example/lib/map_parent_widget.dart
+++ b/flutter_map_example/lib/map_parent_widget.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:google_maps/google_maps.dart';
import 'package:google_maps/google_maps_places.dart';
import 'map_location_notifier.dart';
from dart-google-maps.
The only question I have now is why the import is not suggested in both VSCode and Android Studio
That's another problem for another repo ;)
from dart-google-maps.
Strange! Extensions are defined in the same library and should be valid as any other method. Did you try to restart your IDE? What's the current dart version in your pubspec.yaml ?
from dart-google-maps.
Using VSCode as my main IDE, and if I restart the IDE the error continues
delizondo@MacBook-Pro fixar_admin % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.7 19H524 darwin-x64, locale en)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Xcode - develop for iOS and macOS
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.0)
[✓] Connected device (1 available)
My Dart version in my pubspec.yaml is
environment: sdk: ">=2.3.0 <3.0.0"
dart --version
Dart SDK version: 2.12.2 (stable) (Wed Mar 17 10:30:20 2021 +0100) on "macos_x64"
from dart-google-maps.
What's the version of google_maps
package?
from dart-google-maps.
What's the version of
google_maps
package?
google_maps: ^5.1.0
from dart-google-maps.
Strange that pub accepts that as google_maps: ^5.1.0
requires that your lower bound in the sdk constraint should be at least 2.12.0.
After bumping your sdk constraint to environment: sdk: ">=2.12.0 <3.0.0"
it should be ok.
from dart-google-maps.
@a14n something I've found is that even if I downgrade the google_maps library to version 4.0.0 (prior to null safety changes) I get the same error as stated above.
In the release notes, for version 4.0.0 the change was:
- Migrate from dart:js to package:js.
from dart-google-maps.
Extensions are enabled starting from sdk 2.6.0. I guess that's the reason fo your failures.
from dart-google-maps.
Updated the sdk to
sdk: '>=2.10.0 <3.0.0'
And the google_maps library to
google_maps: ^4.0.0
Restarted the IDE, did a pub get packages, and the error persist, same as the original error in the screenshot
from dart-google-maps.
I'm sorry but I don't have other ideas without code access :-/ Is your project public?
from dart-google-maps.
@a14n I've created a new example project with the core functionality of my main project, and was able to reproduce the issue.
The repo is: https://github.com/delizondo/Flutter_Maps_example
The error should be visible here
from dart-google-maps.
That's it!! Thanks a lot! it worked! The only question I have now is why the import is not suggested in both VSCode and Android Studio
from dart-google-maps.
Related Issues (20)
- Google Maps drawing manager HOT 1
- map.projection.fromLatLngToPoint not correctly bound HOT 3
- Error loading Google MAP in Web HOT 8
- Error with DirectionsService HOT 1
- List<dynamic> is not List<QueryAutocompletePrediction?>? in getQueryPredictions() HOT 3
- Heatmap HOT 3
- Move Camera not working HOT 7
- Remove Polyline from Map HOT 2
- Map view has Infinite Width HOT 1
- Fit bounds doesn't fit properly HOT 4
- Encoding.decodePath throws when running with webdev serve HOT 3
- How to run the demo? HOT 1
- Drawing a layer over part of the map HOT 1
- getPanorama throw a exception when consult not available location for streetview HOT 8
- Multiple Dependency Issue HOT 1
- Google Maps JavaScript API has a new loader, should this lib use it (or expose its API)? HOT 2
- Map not shown in TabBarView after upgrading from flutter version 3.3.10 to 3.7.0 or newer HOT 1
- Using legacy MapLabel JS from flutter application HOT 2
- Migrate to `package:web` HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-google-maps.