Michael-M-aher / location_picker_flutter_map

A Flutter package that provides Place search and Location picker for flutter maps with alot of cusomizations using Open Street Map.
MIT License
23 stars 48 forks source link

Bug Report importing the package regarding undefined Method #40

Closed gerteck closed 2 months ago

gerteck commented 4 months ago

During the build process, I encountered the error:

Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_map_location_marker-8.0.5/lib/src/options/focal_point.dart:46:20: Error: The method 'scaleBy' isn't defined for the class 'Point<double>'.
 - 'Point' is from 'dart:math'.
Try correcting the name to the name of an existing method, or defining a method named 'scaleBy'.
      (size * 0.5).scaleBy(ratio) + offset;
                   ^^^^^^^
Target kernel_snapshot failed: Exception

Additional Information:

I did a workaround by doing:

  /// Projects the [FocalPoint] onto the map widget given its [size]. The
  /// resulting [Point] represents the absolute pixel coordinates on the map
  /// widget where the marker should be aligned.
  Point<double> project(Point<double> size) =>
  //    (size * 0.5).scaleBy(ratio) + offset; // removed this
  Point<double>(size.x * 0.5 * ratio.x, size.y * 0.5 * ratio.y) + offset; // added this

I'm not sure if I set it up correctly, but I followed all the steps accordingly. Is this a fault on my part? Thank you in advance.

Michael-M-aher commented 2 months ago

i updated the package dependency you can try now and if the problem still exists don't hesitate to open an issue