CallController class

Controller of an OngoingCall overlay.

Inheritance

Constructors

CallController(Rx<OngoingCall> _currentCall, CallService _calls, ChatService _chatService, UserService _userService, AbstractSettingsRepository _settingsRepository)

Properties

audioState Rx<LocalTrackState>
Returns local audio stream enabled flag.
no setter
buttons RxList<CallButton>
CallButtons placed in the Dock.
latefinal
callCover UserCallCover?
Returns an UserCallCover of the current call's caller.
no setter
callerName String?
Returns a name of the current OngoingCall's caller.
no setter
cameraSwitched RxBool
Indicator whether the camera was switched or not.
final
chat Rx<RxChat?>
Reactive Chat that this OngoingCall is happening in.
final
chatId Rx<ChatId>
Returns the ChatId of the Chat this OngoingCall is taking place in.
no setter
connectionLost RxBool
Indicates whether the connection to the OngoingCall updates was lost and an ongoing reconnection is happening.
no setter
displayMore RxBool
Indicator whether more panel is displayed.
final
dockKey GlobalKey<State<StatefulWidget>>
GlobalKey of the Dock.
final
dockRect Rx<Rect?>
Reactive Rect of the Dock.
final
doughDraggedRenderer Rx<Participant?>
Participant being dragged currently with its dough broken.
final
downAt DateTime?
DateTime of when the last Listener.onPointerDown callback happened.
getter/setter pair
downButtons int
Buttons that were pressed in a Listener.onPointerDown callback used in Listener.onPointerUp since the latter does not provide this info.
getter/setter pair
downPosition Offset
Position of a Listener.onPointerDown callback used in Listener.onPointerUp since the latter does not provide this info.
getter/setter pair
draggedButton Rx<CallButton?>
Currently dragged CallButton.
final
draggedRenderer Rx<Participant?>
Participant being dragged currently.
final
duration Rx<Duration>
Duration of the current ongoing call.
final
focused RxList<Participant>
Participants in focus mode.
final
fullscreen RxBool
Indicator whether the view is in fullscreen.
latefinal
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
no setterinherited
headerHovered bool
Indicator whether the info header of desktop design is currently hovered.
getter/setter pair
height RxDouble
Minimized view current height.
final
hidden RxBool
Indicator whether the view shouldn't be visible.
final
hoveredParticipant Rx<Participant?>
Participant that is hovered right now.
final
hoveredParticipantTimeout int
Timeout of a hoveredParticipant used to hide it.
getter/setter pair
hoveredRenderer Rx<Participant?>
Participant, whose visible part is being hovered right now.
final
initialized bool
Checks whether the controller has already been initialized.
no setterinherited
isClosed bool
Checks whether the controller has already been closed.
no setterinherited
isCursorHidden RxBool
Indicator whether the cursor should be hidden or not.
final
isDialog bool
Indicates whether the chat is a dialog.
no setter
isGroup bool
Indicates whether the chat is a group.
no setter
isMobile bool
Indicator whether the view is mobile or desktop.
getter/setter pair
isMonolog bool
Indicates whether the chat is a monolog.
no setter
isPanelOpen RxBool
Indicator whether the buttons panel is open or not.
final
isRemoteAudioEnabled RxBool
Indicator whether the inbound audio in the current OngoingCall is enabled.
no setter
isRemoteVideoEnabled RxBool
Indicator whether the inbound video in the current OngoingCall is enabled or not.
no setter
left RxDouble
Minimized view current left position.
final
listeners int
no setterinherited
locals RxList<Participant>
Local Participants in default mode.
final
me CallMember
Returns a CallMember of the currently authorized MyUser.
no setter
members RxObsMap<CallMemberId, CallMember>
Reactive map of the current call CallMembers.
no setter
minimized RxBool
Indicator whether the view is minimized or maximized.
latefinal
minimizedAnimation AnimationController?
AnimationController of a MinimizableView used to change the minimized value.
getter/setter pair
minimizing RxBool
Indicator whether the MinimizableView is being minimized.
final
notifications RxList<CallNotification>
List of the currently active CallNotifications.
final
onDelete InternalFinalCallback<void>
Internal callback that starts the cycle of this controller.
finalinherited
onStart InternalFinalCallback<void>
Called at the exact moment the widget is allocated in memory. It uses an internal "callable" type, to avoid any @overrides in subclases. This method should be internal and is required to define the lifetime cycle of the subclass.
finalinherited
outgoing bool
Indicates whether the current authorized MyUser is the caller.
no setter
panel RxList<CallButton>
CallButtons available in the more panel.
latefinal
panelController PanelController
PanelController used to close the SlidingUpPanel.
final
paneled RxList<Participant>
Participants in panel mode.
final
possibleSecondaryAlignment Rx<Alignment?>
Alignment that might become the secondaryAlignment serving as a hint while dragging the secondary view.
final
primary RxList<Participant>
Participants to display in the fit view.
final
primaryDrags RxInt
Count of a currently happening drags of the primary videos used to determine if any drag happened at all and to display secondary view hint.
final
primaryTargets RxInt
Count of Participants to be accepted into the fit view.
final
remotes RxList<Participant>
Remote Participants in default mode.
final
rendererBoxFit RxMap<String, BoxFit?>
Map of BoxFits that RtcVideoRenderer should explicitly have.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenShareState Rx<LocalTrackState>
Returns local screen-sharing stream enabled flag.
no setter
secondary RxList<Participant>
Participants to display in the secondary view.
final
secondaryAlignment Rx<Alignment?>
Alignment of the secondary view.
final
secondaryBottom RxnDouble
Secondary view current bottom position.
final
secondaryBottomShifted double?
secondaryBottom value before the secondary view got relocated with the relocateSecondary method.
getter/setter pair
secondaryDragged RxBool
Indicator whether the secondary view is being dragged.
final
secondaryDrags RxInt
Count of a currently happening drags of the secondary videos used to determine if any drag happened at all.
final
secondaryEntry OverlayEntry?
OverlayEntry of an empty secondary view.
getter/setter pair
secondaryHeight RxDouble
Secondary view current height.
latefinal
secondaryHovered RxBool
Indicator whether the secondary view is being hovered.
final
secondaryKey GlobalKey<State<StatefulWidget>>
GlobalKey of the secondary view.
final
secondaryLeft RxnDouble
Secondary view current left position.
final
secondaryManipulated RxBool
Indicator whether the secondary view is being manipulated in any way, be that scaling or panning.
final
secondaryPanningOffset Offset?
Offset the secondary view has relative to the pan gesture position.
getter/setter pair
secondaryRatio double
Returns a size ratio of the secondary view relative to the size.
no setter
secondaryRight RxnDouble
Secondary view current right position.
final
secondaryTargets RxInt
Count of Participants to be accepted into the secondary view.
final
secondaryTop RxnDouble
Secondary view current top position.
final
secondaryUnscaledSize double?
secondaryWidth or secondaryHeight of the secondary view before its scaling.
getter/setter pair
secondaryWidth RxDouble
Secondary view current width.
latefinal
showDragAndDropButtonsHint bool
Indicates whether a drag and drop buttons hint should be displayed.
getter/setter pair
showDragAndDropVideosHint bool
Indicates whether a drag and drop videos hint should be displayed.
getter/setter pair
showHeader RxBool
Indicator whether the info header of desktop design is currently shown.
final
showUi RxBool
Indicator whether the UI is shown.
final
size Size
Returns actual size of the call view.
no setter
speaker AudioSpeakerKind
Returns the AudioSpeakerKind of the used output device.
no setter
speakerSwitched RxBool
Indicator whether the speaker was switched or not.
latefinal
started bool
Indicates whether the current OngoingCall has started or not.
no setter
state Rx<OngoingCallState>
State of the current OngoingCall progression.
no setter
titleArguments Map<String, String>
Constructs the arguments to pass to L10nExtension.l10nfmt to get the title of this OngoingCall.
no setter
top RxDouble
Minimized view current top position.
final
videoState Rx<LocalTrackState>
Returns local video stream enabled flag.
no setter
width RxDouble
Minimized view current width.
final
withVideo bool
Indicates whether the current OngoingCall is with video or not.
no setter

Methods

$configureLifeCycle() → void
inherited
addListener(GetStateUpdate listener) Disposer
Register a closure to be called when the object notifies its listeners.
inherited
addListenerId(Object? key, GetStateUpdate listener) Disposer
inherited
applyConstraints(BuildContext context) → void
Applies constraints to the width, height, left and top.
applySecondaryConstraints() → void
Applies constraints to the secondaryWidth, secondaryHeight, secondaryLeft and secondaryTop.
calculateSecondaryPanning(Offset offset) → void
Calculates the secondaryPanningOffset based on the provided offset.
center(Participant participant) → void
Centers the participant, which means focusing the participant and unfocusing every participant in focused.
decline() → void
Declines the call.
dispose() → void
inherited
disposeId(Object id) → void
To dispose an id from future updates(), this ids are registered by GetBuilder() or similar, so is a way to unlink the state change with the Widget from the Controller.
inherited
drop() → void
Drops the call.
focus(Participant participant) → void
Focuses participant, which means putting in to the focused.
focusAll() → void
focuses all Participants, which means putting them in theirs default groups.
getUser(UserId id) FutureOr<RxUser?>
Returns an User from the UserService by the provided id.
join({bool withAudio = true, bool withVideo = true, bool withScreen = false}) → void
Joins the call.
keepUi([bool? enabled]) → void
Keeps UI open for some amount of time and then hides it if enabled is null, otherwise toggles its state immediately to enabled.
layoutAsPrimary() → void
Invokes focusAll, moving every Participant to their default, or primary, groups.
layoutAsSecondary({bool floating = false}) → void
Invokes unfocus for the Participants of me, moving it to the paneled group.
maximize() → void
Maximizes the view.
minimize() → void
Minimizes the view.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyChildrens() → void
inherited
onClose() → void
Called before onDelete method. onClose might be used to dispose resources used by the controller. Like closing events, or streams before the controller is destroyed. Or dispose objects that can potentially create some memory leaks, like TextEditingControllers, AnimationControllers. Might be useful as well to persist some data on disk.
override
onInit() → void
Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.
override
onReady() Future<void>
Called 1 frame after onInit(). It is the perfect place to enter navigation events, like snackbar, dialogs, or a new route, or async request.
override
openAddMember(BuildContext context) Future<void>
Returns a result of the showDialog building a ParticipantView.
openSettings(BuildContext context) Future
Returns a result of showDialog that builds CallSettingsView.
refresh() → void
inherited
refreshGroup(Object id) → void
inherited
relocateSecondary() → void
Relocates the secondary view accounting the possible intersections.
removeChatCallMember(UserId userId) Future<void>
Removes User identified by the provided userId from the _currentCall.
removeChatMember(UserId userId) Future<void>
Removes User identified by the provided userId from the chat.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
inherited
removeListenerId(Object id, VoidCallback listener) → void
inherited
resize(BuildContext context, {ScaleModeY? y, ScaleModeX? x, double? dx, double? dy}) → void
Resizes the minimized view along x by dx and/or y by dy axis.
resizeSecondary(BuildContext context, {ScaleModeY? y, ScaleModeX? x, double? dx, double? dy}) → void
Resizes the secondary view along x by dx and/or y by dy axis.
scaleSecondary(BoxConstraints constraints) → void
Scales secondary according to the constraints and _lastConstraints difference.
switchCamera() Future<void>
Changes the local video device to the next one from the OngoingCall.devices list.
toggleAudio() Future<void>
Toggles local audio stream on and off.
toggleAudioEnabled(Participant participant) Future<void>
Toggles the provided participant's incoming audio on and off.
toggleFullscreen() Future<void>
Toggles fullscreen on and off.
toggleHand() Future<void>
Raises/lowers a hand.
toggleMore() → void
Toggles the displayMore.
toggleRemoteAudios() Future<void>
Toggles inbound audio in the current OngoingCall on and off.
toggleRemoteVideos() Future<void>
Toggles inbound video in the current OngoingCall on and off.
toggleScreenShare(BuildContext context) Future<void>
Toggles local screen-sharing stream on and off.
toggleSpeaker() Future<void>
Toggles between the speakerphone, earpiece and headphones output.
toggleVideo() Future<void>
Toggles local video stream on and off.
toggleVideoEnabled(Participant participant) Future<void>
Toggles the provided participant's incoming video on and off.
toString() String
A string representation of this object.
inherited
unfocus(Participant participant) → void
Unfocuses participant, which means putting it in its default group.
unfocusAll() → void
unfocuses all Participants, which means putting them in the paneled group.
update([List<Object>? ids, bool condition = true]) → void
Rebuilds GetBuilder each time you call update(); Can take a List of ids, that will only update the matching GetBuilder( id: ), ids can be reused among GetBuilders like group tags. The update will only notify the Widgets, if condition is true.
inherited
updateSecondaryAttach() → void
Calculates the appropriate secondaryLeft, secondaryRight, secondaryTop and secondaryBottom values according to the nearest edge.
updateSecondaryOffset(Offset offset) → void
Sets the secondaryLeft and secondaryTop correctly to the provided offset.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

buttonSize → const double
Maximum size a single CallButton is allowed to occupy in the Dock.
titleHeight → const double
Height of the title bar.