basic state management
This commit is contained in:
18
lib/state/legalStatusState.dart
Normal file
18
lib/state/legalStatusState.dart
Normal 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
12
lib/state/mapState.dart
Normal 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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user