basic state management

This commit is contained in:
2024-03-26 19:30:40 +01:00
parent f701ddefad
commit a718e02827
9 changed files with 153 additions and 8 deletions

View File

@ -0,0 +1,18 @@
import 'package:app/model/legelState.dart';
import 'package:flutter/cupertino.dart';
class LegalStatusState extends ChangeNotifier {
LegalState _legalState = LegalState.unknown;
LegalState get getLegalState => _legalState;
set setInSightOfDisallowedAreas(bool isInSight) {
_legalState = LegalState.disallowedRegion;
notifyListeners();
}
set setIsInDisallowedTimeRanges(bool isInDisallowedTime) {
_legalState = LegalState.disallowedTime;
notifyListeners();
}
}

12
lib/state/mapState.dart Normal file
View File

@ -0,0 +1,12 @@
import 'package:flutter/cupertino.dart';
class MapState extends ChangeNotifier {
bool _isLocationLock = false;
bool get followLocation => _isLocationLock;
toggleLocationLock() {
_isLocationLock = !_isLocationLock;
notifyListeners();
}
}