29 lines
742 B
Dart
29 lines
742 B
Dart
import "package:flutter/foundation.dart";
|
|
|
|
class AppState extends ChangeNotifier {
|
|
int? _selectedBusinessId;
|
|
int? _selectedServicePointId;
|
|
|
|
int? get selectedBusinessId => _selectedBusinessId;
|
|
int? get selectedServicePointId => _selectedServicePointId;
|
|
|
|
bool get hasLocationSelection =>
|
|
_selectedBusinessId != null && _selectedServicePointId != null;
|
|
|
|
void setBusiness(int businessId) {
|
|
_selectedBusinessId = businessId;
|
|
_selectedServicePointId = null;
|
|
notifyListeners();
|
|
}
|
|
|
|
void setServicePoint(int servicePointId) {
|
|
_selectedServicePointId = servicePointId;
|
|
notifyListeners();
|
|
}
|
|
|
|
void clearAll() {
|
|
_selectedBusinessId = null;
|
|
_selectedServicePointId = null;
|
|
notifyListeners();
|
|
}
|
|
}
|