ChatsTabController class

Controller of the HomeTab.chats tab.

Inheritance

Constructors

ChatsTabController(ChatService _chatService, CallService _callService, AuthService _authService, UserService _userService, ContactService _contactService, MyUserService _myUserService, SessionService _sessionService)

Properties

chats RxList<ChatEntry>
Reactive list of sorted Chats.
final
connected RxBool
Indicates whether the current device is connected to any network.
no setter
creatingStatus Rx<RxStatus>
Status of the createGroup progression.
final
dismissed RxList<DismissedChat>
DismissedChats added in dismiss.
final
elements RxList<ListElement>
ListElements representing the search results visually.
final
fetching Rx<Timer?>
Timer displaying the chats being fetched when it becomes null.
latefinal
groupCreating RxBool
Indicator whether group creation is active.
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
no setterinherited
hasNext RxBool
Indicates whether the chats have a next page.
no setter
initialized bool
Checks whether the controller has already been initialized.
no setterinherited
isClosed bool
Checks whether the controller has already been closed.
no setterinherited
listeners int
no setterinherited
me UserId?
Returns MyUser's UserId.
no setter
monolog ChatId
Returns ChatId of the Chat-monolog of the currently authenticated MyUser, if any.
no setter
moreKey GlobalKey<State<StatefulWidget>>
GlobalKey of the more button.
final
myUser Rx<MyUser?>
Returns the currently authenticated MyUser.
no setter
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
reordering RxBool
Indicator whether an ongoing reordering is happening or not.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController
ScrollController to pass to a Scrollbar.
final
SearchController for searching the Chats, Users and ChatContacts.
final
searching RxBool
Indicator whether searching is active.
final
selectedChats RxList<ChatId>
Reactive list of ChatIds of the selected Chats.
final
selecting RxBool
Indicator whether multiple Chats selection is active.
final
status Rx<RxStatus>
Returns the RxStatus of the chats fetching and initialization.
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
addToContacts(RxChat chat) Future<void>
Adds the User from this chat to the contacts list of the authenticated MyUser.
call(ChatId id, [bool withVideo = false]) Future<void>
Starts an OngoingCall in the Chat identified by the provided id.
closeGroupCreating() → void
Disables and disposes the group creating.
closeSearch([bool disableSearch = false]) → void
Disables and disposes the searching.
createGroup() Future<void>
Creates a Chat-group with SearchController.selectedRecent, SearchController.selectedContacts and SearchController.selectedUsers.
dismiss(RxChat chat) → void
Dismisses the chat, adding it to the dismissed.
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
dropCall(ChatId id) Future<void>
Drops an OngoingCall in a Chat identified by its id, if any.
favoriteChat(ChatId id, [ChatFavoritePosition? position]) Future<void>
Marks the specified Chat identified by its id as favorited.
getUser(UserId id) FutureOr<RxUser?>
Returns an User from UserService by the provided id.
hideChat(ChatId id, [bool clear = false]) Future<void>
Hides the Chat identified by the provided id and clears its history as well if clear is true.
hideChats([bool clear = false]) Future<void>
Hides the selectedChats, clearing their histories as well if clear is true.
inContacts(RxChat chat) bool
Indicates whether User from this chat is already in contacts.
joinCall(ChatId id, {bool withVideo = false}) Future<void>
Joins the call in the Chat identified by the provided id withVideo or without.
leaveChat(ChatId id) Future<void>
Leaves the Chat identified by the provided id.
muteChat(ChatId id) Future<void>
Mutes a Chat identified by the provided id.
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() → 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.
inherited
openChat({RxUser? user, RxChatContact? contact, RxChat? chat}) Future<void>
Opens a Chat-dialog with this user.
refresh() → void
inherited
refreshGroup(Object id) → void
inherited
removeFromContacts(RxChat chat) Future<void>
Removes the User from this chat from the contacts list of the authenticated MyUser.
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
reorderChat(int from, int to) Future<void>
Reorders a Chat from the from position to the to position.
selectChat(RxChat chat) → void
Selects or unselects the provided chat, meaning adding or removing it from the selectedChats.
sendFiles(ChatId id, PerformDropEvent event) Future<void>
Sends the dropped files of event to the Chat identified by its id.
startGroupCreating() → void
Enables and initializes the group creating.
startSearch() → void
Enables and initializes the searching.
toggleSelecting() → void
Toggles the Chats selection.
toString() String
A string representation of this object.
inherited
unfavoriteChat(ChatId id) Future<void>
Removes the specified Chat identified by its id from the favorites.
unmuteChat(ChatId id) Future<void>
Unmutes a Chat identified by the provided id.
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

Operators

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