payfrit-app/lib/app/app_state.dart
2025-12-28 12:28:45 -08:00

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();
}
}