DirectChatViewModel class
This ViewModel class have different functions that are used interact with model in the context of Direct Chat.
Functions include:
initialise: Initialise the states.getChatMessages: to get all the messages of a chat.sendMessageToDirectChat: to send the message to chat.
Inheritance
: - Object
- ChangeNotifier
- BaseModel
- DirectChatViewModel
Constructors
:
Properties
[chatMessagesByUser] [→ Map[<[String], [List[<[ChatMessage]>]]>]]
: ::: features no setter :::
[chats] [→ List[<[ChatListTileDataModel]>]]
: ::: features no setter :::
: ::: features getter/setter pair :::
[hashCode] [→ int] : The hash code for this object. ::: features no setterinherited :::
[hasListeners] [→ bool] : Whether any listeners are currently registered. ::: features no setterinherited :::
: ::: features no setterinherited :::
[listKey] [→ GlobalKey[<[AnimatedListState]>]]
: ::: features final :::
: ::: features getter/setter pair :::
[runtimeType] [→ Type] : A representation of the runtime type of the object. ::: features no setterinherited :::
: ::: features no setterinherited :::
Methods
[addListener][([[VoidCallback] listener]) → void ] : Register a closure to be called when the object changes. ::: features inherited :::
[chatName]([[dynamic chatId]) → void ]
:
dispose [→ void ] : Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed). ::: features override :::
[getChatMessages][([[String] chatId]) [→ Future<[void>]] ] : This function get all messages for a chat.
[initialise][ [→ Future<[void>]] ]
:
[noSuchMethod][([[Invocation] invocation]) → dynamic ] : Invoked when a nonexistent method or property is accessed. ::: features inherited :::
notifyListeners [→ void ] : Call all the registered listeners. ::: features inherited :::
refreshChats [→ void ] : This function refresh the chats.
[removeListener][([[VoidCallback] listener]) → void ] : Remove a previously registered closure from the list of closures that are notified when the object changes. ::: features inherited :::
[sendMessageToDirectChat][([[String] chatId, ][[String] messageContent]) [→ Future<[void>]] ] : This function send the message to Direct Chat.
[setState][([[ViewState] viewState]) → void ]
: ::: features inherited :::
[toString][ [→ String] ] : A string representation of this object. ::: features inherited :::
Operators
[operator ==][([[Object] other]) [→ bool] ] : The equality operator. ::: features inherited :::
- talawa
- direct_chat_view_model
- DirectChatViewModel class