CallStateService class
Service for managing global call state using ValueNotifier pattern.
Replaces the GetX-based CallStateController singleton with a
ValueNotifier-based implementation that integrates cleanly with BLoC architecture.
Usage:
// Access the singleton instance
final callState = CallStateService.instance;
// Listen to state changes
callState.isActiveCall.addListener(() {
print('Active call: ${callState.isActiveCall.value}');
});
// Update state
callState.setActiveCallValue(true);
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isActiveCall
→ ValueNotifier<
bool> -
ValueNotifier tracking whether there is an active ongoing call.
final
-
isActiveIncomingCall
→ ValueNotifier<
bool> -
ValueNotifier tracking whether there is an active incoming call.
final
-
isActiveOutgoingCall
→ ValueNotifier<
bool> -
ValueNotifier tracking whether there is an active outgoing call.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setActiveCallValue(
bool value) → void - Sets the active call state.
-
setActiveIncomingValue(
bool value) → void - Sets the active incoming call state.
-
setActiveOutgoingValue(
bool value) → void - Sets the active outgoing call state.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → CallStateService
-
Singleton instance of CallStateService.
final