added map live locating

This commit is contained in:
2024-03-27 01:03:01 +01:00
parent 99cc98f853
commit 911c2738aa
5 changed files with 136 additions and 15 deletions

View File

@ -1,22 +1,18 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:geolocator/geolocator.dart';
class MapState extends ChangeNotifier {
bool _isLocationLock = false;
bool _isCurrentlyFetchin = false;
bool _isCurrentlyLoading = false;
final MapController _mapController = MapController();
final Geolocator _geolocator = Geolocator();
bool get followLocation => _isLocationLock;
bool get isCurrentlyFetching => _isCurrentlyFetchin;
bool get isCurrentlyLoading => _isCurrentlyLoading;
MapController get getMapController => _mapController;
Geolocator get getGeolocator => _geolocator;
toggleLocationLock() {
_isLocationLock = !_isLocationLock;
notifyListeners();
}
set setNetworkActivity(bool active) {
_isCurrentlyFetchin = active;
void setLoading(bool loading) {
_isCurrentlyLoading = loading;
notifyListeners();
}
}