Maplerad Take Home Project

coverage style: very good analysis License: MIT


Framework: Flutter

Features:

Multi-flavor support: development, staging, production Platform compatibility: Android & iOS Clean Architecture structure

Getting Started ๐Ÿš€

Project Setup

Create an .env file in the root directory for each environment by referring to the provided example here. Ensure that you generate the necessary environment variables as specified in the example to enable the usage of all available configurations as listed below.

  • .env.development
  • .env.production
  • .env.staging

Install dependencies

flutter pub get

Code Generation

dart run build_runner build --delete-conflicting-outputs

Or run the following command to install dependencies and generate codes

 make fresh

Run the app

The application consists of 3 different variations, and you can utilize the subsequent commands to execute each distinct variation.

  • development
  • staging
  • production

To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:

# Development
$ flutter run --flavor development --target lib/main_development.dart

# Staging
$ flutter run --flavor staging --target lib/main_staging.dart

# Production
$ flutter run --flavor production --target lib/main_production.dart

*project works on iOS and Android.


Running Tests ๐Ÿงช

To run all unit and widget tests use the following command:

$ flutter test --coverage --test-randomize-ordering-seed random

To view the generated coverage report you can use lcov.

# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

Feature Folder Structure

โ”‚
โ”œโ”€โ”€ feature
|     โ”œโ”€โ”€ data
โ”‚     โ”‚     โ”œโ”€โ”€ data source
โ”‚     โ”‚     โ”œโ”€โ”€ model
โ”‚     โ”‚     โ””โ”€โ”€ repository(implementation)
โ”‚     โ”œโ”€โ”€ domain     
โ”‚     โ”‚     โ”œโ”€โ”€ entities
โ”‚     โ”‚     โ”œโ”€โ”€ repository(abstract)
โ”‚     โ”‚     โ””โ”€โ”€ use cases
โ”‚     โ””โ”€โ”€ presentation
โ”‚     โ”‚     โ”œโ”€โ”€ bloc/cubit
โ”‚     โ”‚     โ”œโ”€โ”€ pages
โ”‚     โ”‚     โ””โ”€โ”€ widgets
โ”‚     โ”‚        

Screen Record

https://www.loom.com/share/cd87e95a0c1043c297581d4bd911264b?sid=58f4c413-ac5e-4fc5-b7a7-4c65aaae8eb1

APK

The apk file can be found here