-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create classes to store the response map. #720
Comments
@Sagar2366 I am free I can work on this. |
Issue #700 has now been integrated into the pull request process. It will flag all Dart files that are longer than 300 lines to help with readability. Please make sure your contribution reduces file sizes to within this limit. |
Sure @palisadoes I will keep this in mind while sending PR. |
@palisadoes As This will add more class in the model. I was thinking of changing the directory structure. It will look something like this.
@Sagar2366, @palisadoes Can you share your views? @utkarshshendge & @sumitra19jha I will love to take your suggestion on this. |
@StrangeNoob your approach looks fine. It will make the code more readable and it will be easy to add tests. |
@StrangeNoob Can you elaborate a little more Like the data model are to be build keeping the backend responses in mind. For example: Comment data model will contain Also, is it good to name a model |
@sumitra19jha At a glance, New developer won't be having idea out the response of the every API Call. Converting the response JSON to a class will help it.
I will look at the response and convert it as per requirement.
Right now, I am not concerned with the name of the files but its directory structure? |
It will organize the codebase. What is the purpose of the data model? For example: So your work will structure the codebase and also help the developers work more effectively. And in my opinion, the folder structure should be somewhat like |
@CyberWake On our work on separation of business logic from UI #721, this creation of data models will help us in coming with a great solution. During refactoring, we can make sure all the logics are very well implemented using this data model rather than current response map. |
@sumitra19jha Thanks for the input. I will put it model directory only. Trying to complete as soon as possible to it will help you and @CyberWake to implement logics into it. |
Parent issue : Refactoring of codebase and separation on data/UI #715
Issue Description:
Need to modify data modal classes in the project for easy conversion of JSON maps to class objects enabling easy traversal and retrieval of response data accessibility. As currently everywhere the response map is directly iterated to the search key which doesn't come in handy at every place. And the removal of
user_info.dart
not used in the project and the user data model is much bigger than the one defined. Better to create a new one. Currently, declared models are less efficient, and some are not even used. The model should look like the models declared in the API. We also need to have its implementation done on getting successful response data from the server.Issue Severity:
Medium
Environment Details:
Project Level
Observed Behaviour:
The response map is directly iterated to the search key.
Expected Behaviour:
Use of classes to store the response.
Does this issue need immediate attention?
No
Please ask mentors/maintainers to assign if you are willing to work on this issue.
The text was updated successfully, but these errors were encountered: