VChatController class
this is the controller of vchat which create the chat or customize the design
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addMembersToGroupChat(
{required String groupId, required List< String> usersEmails}) → Future - throw exception if current user not admin throw No internet connection
-
bindChatControllers(
{required BuildContext context, String? email}) → Future< void> - make sure you init v chat in the Home page of you app to start receive notifications when you call this function the user will be online and can receive notification first you have to login or register in v chat other wise will throw Exception
-
changeLanguage(
String lng) → Future - throw No internet connection
-
createGroupChat(
{required BuildContext context, required CreateGroupRoomDto createGroupRoomDto}) → Future< void> - throw exception if path one user only or path one user he is the app login throw No internet connection
-
createSingleChat(
{required String peerEmail, required String message, BuildContext? context}) → Future< String> -
context
if you pass the context the the chat will open after send message throw You cant start chat if you start chat your self throw Exception if peer Email Not in v chat Data base ! so first you must migrate all users throw No internet connection -
downgradeGroupAdmin(
{required String groupId, required String userId}) → Future - throw exception if current user not admin or if downgrade the group creator members cant downgrade admins throw No internet connection
-
enableAllNotification(
) → Future< String> - throw No internet connection
-
forceLanguage(
{required String languageCode, String? countryCode}) → void - Force language to the package i made this api for who use getx translate projects you must call this api any time you open the app
-
getGroupMembers(
{required String groupId, required int paginationIndex}) → Future< List< VChatGroupUser> > - throw exception if group not exist or current user not in group throw No internet connection
-
init(
{required Uri baseUrl, required String appName, required VChatNotificationType vChatNotificationType, VChatNotificationSettings vChatNotificationSettings = const VChatNotificationSettings(), VChatWidgetBuilder widgetsBuilder = const VChatWidgetBuilder(), required bool enableLogger, required String passwordHashKey, int maxMediaUploadSize = 50 * 1000 * 1000, int maxGroupChatUsers = 512}) → Future -
baseUrl v chat backend base url
appName your app name to because we create a file in phone internal storage to save files
the folder in Documents/
appName
isUseFirebase if firebase not supported in your country or you not connect the app with firebase yet lightTheme define and override v_chat default Light theme darkTheme define and override v_chat default Dark theme navKey nav Key to get the context any where and support localization maxMediaUploadSize file videos images max size in byes 50 * 1000 * 1000 ~ 50mb -
kickUserFromGroup(
{required String groupId, required String kickedId}) → Future - will delete user from group only if this user in the group and current current user is admin admin can delete admin but cant delete the group creator group creator can delete any user but cant be deleted throw exception if current user not admin or if kick the group creator of kick your self be aware ! throw No internet connection
-
login(
{required BuildContext context, required String email}) → Future< VChatUser> - throw User not in v chat data base throw No internet connection
-
logOut(
) → Future - throw No internet connection
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
{required BuildContext context, required VChatRegisterDto dto}) → Future< VChatUser> - throw User already in v chat data base throw No internet connection
-
setLocaleMessages(
{required List< VChatAddLanguageModel> vChatAddLanguageModel}) → void - to add new language to v chat
-
stopAllNotification(
BuildContext context) → Future< String> - throw No internet connection
-
toString(
) → String -
A string representation of this object.
inherited
-
updateGroupChatImage(
{required String groupId, required String path}) → Future< String> - throw exception if group not exist or current user not in group and current user not admin throw No internet connection
-
updateGroupChatTitle(
{required String groupId, required String title}) → Future< void> - throw exception if group not exist or current user not in group and current user not admin throw No internet connection
-
updateUserImage(
{required String imagePath}) → Future - throw File Not Found ! throw No internet connection
-
updateUserName(
{required String name}) → Future - throw No internet connection
-
upgradeGroupUser(
{required String groupId, required String userId}) → Future - throw exception if current user not admin throw No internet connection
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → VChatController
-
final