![]() So, first let me explain the injectable_module.dart file. With the above sections and links, we have completed the Domain Layer successfully. You can find their interfaces, implementations, and more by following the links. They are not complicated and almost all of them have the same logic. We have three more folders: camera, microphone, and connectivity sections. ![]() So, we covered and completed the chat&auth sections for the domain folder. It’s important to determine functions so that we’ve started with the domain folder. With this, we can listen to authentication changes of the chat service, we can follow the channels (chats) of the current/logged-in user, can connect and disconnect, can create a new chat (channel), and can send an attachment (here, we actually use it for the sending photo, so the attachment is a photo). Since we use HydratedBloc for the local storage, and it needs the related functions, we need to fromJson method of this model. If you want to add more user properties such as last seen, team count, etc., you can add of course.įor the fromJson method, we can say it’s for local storage. For this article, since we are not cover all the properties of the Stream, we just consider the three important properties: User's Created Time, User's Role, and User's Ban Status. After creating and handling the chat service, we can use them efficiently. So, since the services are different (handling this situation is quite important) we need to handle them separately. Now we create our user model that is different than the auth one. If you paste it to the terminal and run, you’ll see the red lines of the chat_failure.dart file will disappear. Folder Architectureįirst, let’s look at the folder architecture of the project.īuild runner’s code: flutter packages pub run build_runner build -delete-conflicting-outputs If you would like to follow along, feel free to create a Stream free account and clone the repositiory on Github.
0 Comments
Leave a Reply. |