ChatRoom class
Constructors
-
ChatRoom({required DatabaseReference ref, required String key, String? text, String? url, int? updatedAt, int? createdAt, int? newMessage, int? singleChatOrder, int? groupChatOrder, int? openGroupChatOrder, String? name, String? iconUrl, String? photoUrl, String? description, String? master, bool isVerifiedOnly = false, bool urlVerifiedUserOnly = false, bool uploadVerifiedUserOnly = false, Map<
String, bool> ? users, int? noOfUsers}) - ChatRoom.fromJson(Map json, {String? key})
-
fromJson It creates a ChatRoom from a json.
factory
- ChatRoom.fromRoomdId(String id, {Map data = const {}})
-
Returns a ChatRoom from a group id.
factory
- ChatRoom.fromSnapshot(DataSnapshot snapshot)
-
fromSnapshot It creates a ChatRoom from a
DataSnapshot
.factory - ChatRoom.fromUid(String otherUserUid)
-
다른 사용자 uid 로 1:1 채팅방 모델 객체를 만든다.
factory
Properties
- createdAt ↔ int?
-
getter/setter pair
- description ↔ String?
-
getter/setter pair
-
getSubscribedUids
→ List<
String> ? -
Returns the uids of the users who subscribed the chat room.
no setter
- groupChatOrder ↔ int?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconUrl ↔ String?
-
그룹 채팅방을 대표하는 아이콘 사진을 저장한다.
getter/setter pair
- id → String
-
id It returns the chat room id.
no setter
- isGroupChat → bool
-
no setter
- isMaster → bool
-
no setter
- isOpenGroupChat → bool
-
no setter
- isSingleChat → bool
-
no setter
- isVerifiedOnly ↔ bool
-
회원 인증한 사용자만 입장 가능하도록 하는 옵션
getter/setter pair
- joined → bool
-
joined 현재 사용자가 입장해 있으면, 즉 users 에 현재 사용자의 UID 가 있으면, true 를 리턴한다.
no setter
- key ↔ String
-
getter/setter pair
- master ↔ String?
-
getter/setter pair
- name ↔ String?
-
getter/setter pair
- newMessage ↔ int?
-
getter/setter pair
- noOfUsers ↔ int?
-
그룹 채팅방의 사용자 수
이 값은 /chat-joins/
getter/setter pair
- openGroupChatOrder ↔ int?
-
getter/setter pair
- otherUserUid → String?
-
Return the first other user uid from the users list.
no setter
- path → String
-
path is the path of the chat room.
no setter
- photoUrl ↔ String?
-
채팅방 목록에 표시할 사진을 저장한다.
getter/setter pair
- ref → DatabaseReference
-
Variables
Chat Room Document Reference
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- singleChatOrder ↔ int?
-
getter/setter pair
- text ↔ String?
-
getter/setter pair
-
uids
→ List<
String> -
no setter
- updatedAt ↔ int?
-
getter/setter pair
- uploadVerifiedUserOnly ↔ bool
-
회원 인증한 사용자만 업로드 가능하도록 하는 옵션
getter/setter pair
- url ↔ String?
-
getter/setter pair
- urlVerifiedUserOnly ↔ bool
-
회원 인증한 사용자만 url 입력 가능하도록 하는 옵션
getter/setter pair
-
users
↔ Map<
String, bool> ? -
getter/setter pair
Methods
-
deleteIfNoUsers(
) → Future< void> - 채팅방에 남아 있는 사람이 없으면, 방을 삭제한다. If there are no remaining people in the chat room, the room is deleted.
-
getOtherUids(
) → Future< List< String> > - Return uid list of chat room members except mine.
-
invite(
String uid, {bool forceJoin = false}) → Future< String?> - 1:1 채팅방과 그룹 채팅방에 사용자 초대 또는 채팅방 입장
-
join(
{String? uid, bool forceJoin = false}) → Future< String?> - 채팅방 입장
-
leave(
) → Future - 채팅방 나가기
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reload(
) → Future< ChatRoom> - 현재 채팅방 정보 모델 인스턴스의 데이터를 DB 에서 다시 읽어서 리턴한다.
-
remove(
String uid) → Future - Remove user in ChatRoomBody
-
toggleNotifications(
) → dynamic - 채팅방 알림 토글
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
toString
override
-
update(
{String? name, String? iconUrl, String? description, bool? isOpenGroupChat, bool? isVerifiedOnly, bool? urlVerifiedUserOnly, bool? uploadVerifiedUserOnly}) → Future
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- rootRef ↔ DatabaseReference
-
getter/setter pair
Static Methods
-
chatRoomIconUrl(
dynamic roomId) → String -
chatRoomName(
dynamic roomId) → String -
create(
{String? uid, String? roomId, String? name, String? iconUrl, String? description, bool? isOpenGroupChat}) → Future< ChatRoom> - 채팅방 생성
-
fromReference(
DatabaseReference ref) → Future< ChatRoom> - Return ChatRoom from a reference
-
get(
String id) → Future< ChatRoom> -
Load data from database and return a
ChatRoom
from a group chat room id. -
iconUrlRef(
dynamic roomId) → DatabaseReference -
nameRef(
String roomId) → DatabaseReference - Member Variable Reference
-
usersAt(
dynamic roomId, dynamic uid) → String -
usersAtRef(
dynamic roomId, dynamic uid) → DatabaseReference