kb0 / maps_toolkit

Dart library for area, distance, heading measurements
Apache License 2.0
46 stars 17 forks source link

Unable to use package #2

Closed jramesh91 closed 4 years ago

jramesh91 commented 4 years ago

Can't use import 'package:google_maps_flutter/google_maps_flutter.dart'; & import 'package:maps_toolkit/maps_toolkit.dart'; in the same dart file. The existing LatLng class is throwing error.

kb0 commented 4 years ago

You can specify a prefix for an import - import ... as ..., for ex.:

import 'package:maps_toolkit/maps_toolkit.dart' as mp;
import 'package:google_maps/google_maps.dart';
import 'package:test/test.dart';

void main() {
  // LatLng from maps toolkit
  final pointToolkit = mp.LatLng(90, 0);
  // LatLng from google maps
  final pointGoogle = LatLng(90, 0);

  // functions and classes from maps toolkit
  mp.SphericalUtil.computeAngleBetween(pointToolkit , pointToolkit );
}