-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Separate business logic from UI - (Locator - ViewModel - View) #758
Comments
I was working with the events page and I think this needs to be implemented there as the code is really clustered into a single |
@CoderMayhem, if you're working on the PR related to events.dart and if we are implementing MVVM you can pull our recent merge, I've already setup the locator and made other necessary changes😊. |
Sure. Will do👍 |
@Sagar2366 At first I would like to work on the page files that are huge (around 500+ lines):
|
@rutvik11062000 If you don't mind, Can we divide those pages and so that everyone else can work on it? |
Sure @StrangeNoob 😊, if anyone wants to take this issue they can implement MMVM in the below page/pages:
|
I recommend making a PR for every page instead of making a single PR, this will reduce the code checking (review) that has to be done by the mentors, and also we can roll back if a page is not properly structured. |
@CoderMayhem @StrangeNoob, please ask Sagar sir, to assign the pages you want to work on. 👍 |
@Sagar2366 Sir, @rutvik11062000 maybe we can do something like issue #326 . |
Right. Before that, at least any one screen changes should be made available to reference it as a template. |
Sure @Sagar2366 sir👍, I'm currently working on the update profile page once it is done it will work as a template, @utkarshshendge I'll create child issues for pages that need MVVM and will also make a discussion thread in which there will be general standard methods to implement this architecture so all the contributors will be on the same page. (All these things will be done till evening). |
Is your feature request related to a problem? Please describe.
Parent issue: #721
The parent issue only describes or deals with separating
data fetching services
and theUI
.As per the model - view - ViewModel architecture there must be a
ViewModel layer
between theservice
andUI
layer.Separating only the
services layer
will reduce the file size but it won't reduce files below 300 lines, as the after fetching functions are still executing inside the UI file.Also by not separating the changing state or data modification function it will be difficult to test the UI and state changing logic.
Describe the solution you'd like
Creating a middle ViewModel layer which deals with "State change logic" and fetching data from the "services".
Creating an only View file that deals only with the UI and showing data that it receives from the respective ViewModel.
Approach to be followed (optional)
Steps:
Additional context
This issue will work on all the pages the app has. for implementation, reference see PR: #728
The aftermath of solving this issue:
The text was updated successfully, but these errors were encountered: