- This is a sample application.
- Uses MVVM pattern
- Tries to encourage the use of boundaries (by using the concept of packages)
Getting Started ??
- Download the repo
- Make sure you are on the Flutter Stable Channel (1.22.6)
flutter channel stable flutter upgrade
- Install dependencies, when asked, after downloading the project.
- Run the cmd
- You should see the app working at this point..
The app follows MVVM approach
Their is a shared folder, which comprises of all the common entities.
Common entites like assets, extensions, services etc
Take a folder, let’s say home
It is broken down into components, models, utils (utilties if any), view and view_models
Let’s discuss each of them
- They contain the building blocks of UI.
- A UI may comprise of a button, or card, or a list.
- All these items are created under their respective folders
- Let’s say for a list component,
Model (from MVVM)
- They are usually simple classes
- For instance, let’s take home
- It would contain models folder, including all the models needed for home
View (from MVVM)
- These are the screens visible to the user on their device.
- For instance, home would have views folder
- We have 3 views
- HomeView. Now home has 2 options (Egestas scleri) and (Consectur)
- On click of Egestas scleri, you see the PellenView
- On click of Consectur, you see the FringillaView
They are some cases, when a view has a piece of UI, that is somewhat big.
We extract those bits of UI, into the templates
Let’s say for the home view, we have a template as,
ViewModel (from MVVM)
- They help in transforming the data into models.
- For instance, home would have view_models folder
- Any additional helpers or strings are put inside the utils
- For instance, home would have utils folder, containing all the strings needed
Their is a folder called shared, which includes all the common entities inside the app
For instance, all the styles, colors are placed under styles
- For instance, all the services are placed under the services folder
- Sample data files are put inside the assets
- When needed they are fetched within the app.
- Uses golden tests
- Integration tests
flutter drive \ --driver=test_driver/integration_test.dart \ --target=integration_test/app_test.dart
flutter drive \ --driver=test_driver/integration_test.dart \ --target=integration_test/app_test.dart -d "9B4DC39F-5419-4B26-9330-0B72FE14E15E"