Giter Site home page Giter Site logo

Comments (15)

delizondo avatar delizondo commented on August 21, 2024 1

@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.

delizondo avatar delizondo commented on August 21, 2024 1

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.

a14n avatar a14n commented on August 21, 2024 1

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.

a14n avatar a14n commented on August 21, 2024 1

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.

a14n avatar a14n commented on August 21, 2024

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.

delizondo avatar delizondo commented on August 21, 2024

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.

a14n avatar a14n commented on August 21, 2024

What's the version of google_maps package?

from dart-google-maps.

delizondo avatar delizondo commented on August 21, 2024

What's the version of google_maps package?

google_maps: ^5.1.0

from dart-google-maps.

a14n avatar a14n commented on August 21, 2024

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.

delizondo avatar delizondo commented on August 21, 2024

@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.

a14n avatar a14n commented on August 21, 2024

Extensions are enabled starting from sdk 2.6.0. I guess that's the reason fo your failures.

from dart-google-maps.

delizondo avatar delizondo commented on August 21, 2024

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.

a14n avatar a14n commented on August 21, 2024

I'm sorry but I don't have other ideas without code access :-/ Is your project public?

from dart-google-maps.

delizondo avatar delizondo commented on August 21, 2024

@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.

delizondo avatar delizondo commented on August 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.