The task is to implement a food delivery app to let the user browse meals and add meals to his favourite page and to add meals to cart.
The basic features that are fulfilled include:
- As a User I should be able to browse categories.
- As a User I should be able to browse click on a category from categories screen and show me the category meals.
- As a User I should be able to save any meal into my favourite section.
- As a User I should be able to add any meal into my cart section.
- As a User I should be able to delete any meal from my cart section.
- As a User I should be able to delete any meal from my favourite section.
.
├── core
│ ├── constants
│ ├── models
│ ├── data
│ ├── domain
│ └── view_models
├── ui
│ ├── utils
│ ├── views
│ └── widgets
└── config
The lib folder is divided into three folders; core, ui, and config. Core contains all the files associated with the logic. Ui contains all the files associated with the ui. Config is for configurations.
-
core
- constants
- Holds app constants and enums and routes.
- models
- Contains all the plain data models.
- data
- This layer interacts directly with an API (REST API or a local database).
- domain
- This layer transforms or manipulates the data that the API or local database provides.
- view_models
- This layer manages the state (Business logic layer). contains a view model for each view which will act as an interface between a view and domains.
- constants
-
ui
- utils
- Contains functions or constants that are used in multiple other UI files.
- views
- Contains the main app screens.
- widgets
- Contains widget files that are too big to keep in the view files.
- Usually contains shared widgets that are classes extending stateless widgets.
- utils
-
config
- configuration files for routing, providers, locators and functions (Usually contains shared functions that are classes use them)
- Writing Unit tests.
- Add meal details screen.
- improve cart screen by adding quantity number for each meal and increase and decrease buttons for quantity number.
- Add dark theme to the app.
- provider: ^6.0.3
- http: ^0.13.4
- cached_network_image: ^3.2.1
- shared_preferences: ^2.0.15
- equatable: ^2.0.0
- get_it: ^7.2.0
- Run
flutter packages get
to download pubspec dependencies. - Run
flutter clean
for most of the first-run errors you may face. - Run
flutter run
to try it live on a running emulator or USB connected device. - You can target a specific device to run by running
flutter devices
and getting the id and runningflutter run -d <device_id>
. - Run
flutter build apk
to generate the APK file. - Run
flutter build ios
to package the iOS app.