SearchController class
Controller for searching the provided categories.
- Inheritance
-
- Object
- GetLifeCycle
- DisposableInterface
- GetxController
- SearchController
Constructors
-
SearchController(ChatService _chatService, UserService _userService, ContactService _contactService, MyUserService _myUserService, {required List<
SearchCategory> categories, RxChat? chat, void onSelected(SearchViewResults? results)?})
Properties
-
categories
→ List<
SearchCategory> -
SearchCategoryies to search through.
final
- chat → RxChat?
-
RxChat this controller is bound to, if any.
final
-
chats
→ RxMap<
ChatId, RxChat> -
Chats found under the SearchCategory.chat category.
final
-
contacts
→ RxMap<
UserId, RxChatContact> -
RxChatContacts found under the SearchCategory.contact category.
final
-
contactsSearch
→ Rx<
Paginated< ChatContactId, RxChatContact> ?> -
ChatContacts search results.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
no setterinherited
- hasNext → bool
-
Whether this SearchController has potentially more search results.
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
-
onDelete
→ InternalFinalCallback<
void> -
Internal callback that starts the cycle of this controller.
finalinherited
- onSelected → void Function(SearchViewResults? results)?
-
Callback, called on the selectedContacts, selectedChats,
selectedUsers and selectedRecent changes.
final
-
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
- query → RxString
-
Reactive value of the search field passed to the
_search
method.final -
recent
→ RxMap<
UserId, RxUser> -
RxUsers found under the SearchCategory.recent category.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → FlutterListViewController
-
FlutterListViewController
of aFlutterListView
displaying the search results.final - search ↔ TextFieldState
-
TextFieldState of the search field.
latefinal
-
searchStatus
→ Rx<
RxStatus> -
Status of a
_search
completion.final -
selectedChats
→ RxList<
RxChat> -
Reactive list of the selected Chats.
final
-
selectedContacts
→ RxList<
RxChatContact> -
Reactive list of the selected ChatContacts.
final
-
selectedRecent
→ RxList<
RxUser> -
Reactive list of the selected recent Users.
final
-
selectedUsers
→ RxList<
RxUser> -
Reactive list of the selected Users.
final
-
users
→ RxMap<
UserId, RxUser> -
RxUsers found under the SearchCategory.user category.
final
-
usersSearch
→ Rx<
Paginated< UserId, RxUser> ?> -
Users search results.
final
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
-
dispose(
) → void -
inherited
-
disposeId(
Object id) → void -
To dispose an
id
from future updates(), this ids are registered byGetBuilder()
or similar, so is a way to unlink the state change with the Widget from the Controller.inherited -
elementAt(
int i) → dynamic - Returns an item by its index from the search results.
-
getUser(
UserId id) → FutureOr< RxUser?> -
Returns a User from the UserService 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
-
populate(
) → void - Updates the chats, recent, contacts and users according to the query.
-
refresh(
) → void -
inherited
-
refreshGroup(
Object id) → void -
inherited
-
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
-
select(
{RxChatContact? contact, RxUser? user, RxChat? chat, RxUser? recent}) → void -
Selects or unselects the specified
contact
,user
,chat
orrecent
. -
selected(
) → List< UserId> - Returns all the selected UserIds.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
[List< Object> ? ids, bool condition = true]) → void -
Rebuilds
GetBuilder
each time you callupdate()
; Can take a List ofids
, that will only update the matchingGetBuilder( id: )
,ids
can be reused amongGetBuilders
like group tags. The update will only notify the Widgets, ifcondition
is true.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited