This repository contains test mobile application for Fake Product API.
- This project is build with Flutter 3.24.0 and uses fvm (Flutter Version Manager)
- Using fvm is highly recommended, because there is .fvm config dir commited in source to sync Flutter versions for all developers
The app has currently 1 environment:
DEV
- using
https://fakestoreapi.com/
of REST API - package name
cz.stepanzalis.aktin_product_viewer
- app name
Aktin (dev)
- env app suffix
dev
- using
Append this commands when running run or build command with chosen flavor:
-
--dart-define-from-file=.env/development.json
- defines:
- REST API url
- defines package name suffix
- defines:
-
When using VSCode, there is a
launch.json
file with predefined configurations for running and building the app with the DEV flavor
- flutter_bloc (state management)
- get_it (service locator)
- Dio (HTTP client)
- go_router (routing)
- drift (SQLite ORM)
-
State management is done with BLoC (flutter_bloc)
-
The app is built with a modified clean architecture approach
-
It's divided into features (modules) and each feature has its own folder
application
- contains business logicdomain
- contains entitiesconfig
- contains configuration, DI and navigationinfrastructure
- contains implementation of repositories, DTOs, servicespresentation
- contains UI (pages & widgets)
-
Each feature should be independent and should not depend on other features except for the core module, which contains shared code
-
Each feature has its own
{name}_feature.dart
file, which contains all dependencies for the current feature like blocs, repositories, services, etc.
- Create a new folder in the
lib/features
directory - Create the following folders inside the new feature folder:
application
,domain
,config
,infrastructure
,presentation
- Create a
{name}_feature.dart
file in the feature folder - Create a
{name}_injection.dart
file in thefeature/{name}/config/di
directory which extends theInjectableFeature
class - Feature registration is done in the
config/di/injection.dart
file
- The app has unit tests for business logic, repositories and services
- The app has widget tests for UI using Patrol