added map live locating
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user