geopoint_location

Last updated:

0 purchases

geopoint_location Image
geopoint_location Images
Add to Cart

Description:

geopoint location

Geopoint location #

Get Geopoint data from Geolocator Position updates
Simple position #
import 'package:geopoint/geopoint.dart';
import 'package:geopoint_location/geopoint_location.dart';

GeoPoint geoPoint = await geoPointFromLocation(
name: "Current position", withAddress: true);
copied to clipboard
Positions stream #
import 'package:geopoint/geopoint.dart';
import 'package:geopoint_location/geopoint_location.dart';

StreamSubscription<GeoPoint> _sub;
final _loc = LocationStream().initGeoPointStream();
_sub = _loc.geoPointStream.listen((pos) => print("Position update $pos"));
//_sub.cancel();
copied to clipboard
Convert a geolocator Position to a GeoPoint #
import 'package:geopoint/geopoint.dart';
import 'package:geopoint_location/geopoint_location.dart';

final position = await Geolocator().getCurrentPosition();
final GeoPoint geoPoint = await geoPointFromPosition(
position: position,
name: "Current position");
copied to clipboard
Same but sync, address not available:
final GeoPoint geoPoint = geoPointFromPositionSync(
position: position,
name: "Current position");
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.