WppChat class

Constructors

WppChat(WpClientInterface wpClient)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
wpClient WpClientInterface
getter/setter pair

Methods

archive({required String phone, bool archive = true}) Future<void>
Pass phone with correct format in archive , and archive = true to archive , and false to unarchive
canMute({required String phone}) Future<bool>
to check if we canMute phone number
clear({required String phone, bool keepStarred = false}) Future
clear chat
delete({required String phone}) Future
delete chat
deleteMessage({required String phone, required String messageId, bool deleteMediaInDevice = false, bool revoke = false}) Future
Delete message Set revoke: true if you want to delete for everyone in group chat
downloadMedia({required MessageId messageId}) Future<Map<String, dynamic>?>
Download the base64 of a media message
forwardTextMessage({required String phone, required MessageId messageId, bool displayCaptionText = false, bool multicast = false}) Future
forwardTextMessage may throw errors if passed an invalid contact or if this method completed without any issue , then probably message sent successfully
getChats({bool onlyUser = false, bool onlyGroups = false}) Future
get all Chats using getChats
getLastSeen({required String phone}) Future<int?>
Get timestamp of last seen using getLastSeen return either a timestamp or 0 if last seen off
getMessages({required String phone, int count = -1}) Future
Fetch messages from a chat
isValidContact({required String phone}) Future<bool>
check if the given Phone number is a valid phone number
markAsSeen({required String phone}) Future
Mark a chat as read and send SEEN event
markAsUnread({required String phone}) Future
Mark a chat as unread
markIsComposing({required String phone, int timeout = 5000}) Future
markIsRecording({required String phone, int timeout = 5000}) Future
mute({required String phone, required int expirationUnixTimeStamp}) Future
Mute a chat, you can use expiration and use unix timestamp (seconds only)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pin({required String phone, bool pin = true}) Future
pin/unpin to chat
rejectCall({String? callId}) Future
rejectCall will reject incoming call
sendContactCard({required String phone, required String contactPhone, required String contactName}) Future
sendCreatePollMessage({required String phone, required String pollName, required List<String> pollOptions}) Future
Send a create poll message , Note: This only works for groups
sendFileMessage({required String phone, required WhatsappFileType fileType, required List<int> fileBytes, String? fileName, String? caption, String? mimetype, MessageId? replyMessageId, String? templateTitle, String? templateFooter, bool useTemplate = false, bool isViewOnce = false, bool audioAsPtt = false, List<MessageButtons>? buttons}) Future
send file messages using sendFileMessage make sure to send fileType , we can also pass optional mimeType replyMessageId will send a quote message to the given messageId add caption to attach a text with the file
sendLocationMessage({required String phone, required String lat, required String long, String? name, String? address, String? url}) Future
send a locationMessage using sendLocationMessage
sendReactionToMessage({required MessageId messageId, String? emoji}) Future
Emoji list: https://unicode.org/emoji/charts/full-emoji-list.html To remove reaction, set emoji to null
sendTextMessage({required String phone, required String message, String? templateTitle, String? templateFooter, bool useTemplate = false, List<MessageButtons>? buttons, MessageId? replyMessageId}) Future
sendMessage may throw errors if passed an invalid contact or if this method completed without any issue , then probably message sent successfully add replyMessageId to quote message
toString() String
A string representation of this object.
inherited
unmute({required String phone}) Future
Un mute chat

Operators

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