live_location_plus 0.0.3
live_location_plus: ^0.0.3 copied to clipboard
A Flutter package for real-time location tracking with foreground and background updates, built-in permission handling, and battery optimization.
example/main.dart
import 'package:live_location_plus/live_location_plus.dart';
void main() {
LocationService locationService = LocationService();
locationService.init(
currentLocation: true, // if you set "currentLocation" equal "false" you can't use any location service in app
foregroundLiveLocation: true, // if you set "foregroundLiveLocation" equal "false" the live location update only on foreground
backgroundLiveLocation: false, // replace with "true" if you want get live location on background
);
locationService.locationStream.listen((position) {
print("New Location: ${position.currentLocation.latitude}, ${position.currentLocation.longitude}");
});
}