---
# System prepended metadata

title: FLEXIFORM MOBILE APP

---

![alt text](https://staging.flexiformph.com/_next/static/images/Flexiform-logo-dark-8c10715d97924c54ade60410a089ccdc.png)

## 🎉 Welcome
:::success
Flexiform is the partner app for the FlexiForm data collection solution.
:::

[![Codemagic build status](https://api.codemagic.io/apps/64c87758f2cc9b966d63587e/64d07eeb005e1c0bc99bedf5/status_badge.svg)](https://codemagic.io/apps/64c87758f2cc9b966d63587e/64d07eeb005e1c0bc99bedf5/latest_build)
[![codecov](https://codecov.io/bb/awesomelabinc/flexiform_mobile_app/graph/badge.svg?token=AN08H4QVIA)](https://codecov.io/bb/awesomelabinc/flexiform_mobile_app)

## CODE DOCS
Code documentation is found under /docs, run dart doc in terminal first

## RUN THE PROJECT ON YOUR MACHINE
1. Install flutter [Click here for detailed instructions](https://docs.flutter.dev/get-started/install)
2. Clone this project
3. Run `flutter pub get` on your terminal
4. Run the application in the terminal using the command (make sure you have a device connected or emulator running)

DEVELOP
```
flutter run --flavor develop  lib/main_dev.dart
```

STAGING
```
flutter run --flavor staging  lib/main_staging.dart
```

PREPROD
```
flutter run --flavor preprod  lib/main_pre.dart
```

PRODUCTION
```
flutter run --flavor production  lib/main.dart
```

## CONTRIBUTING
:::success
In order for our app to be maintainable in the future we need to follow this guidelines.
:::

1. All critical functions should have a unit test
2. Widgets should have a widget test for all of its behaviors
3. As mush as possible please add an explanation for each code block, see "Code documentation guidlines"
4. Write an integration test for the QA Team


## DEVELOPMENT
:::success
Guidelines for creating a new feature
:::

1. Use the dev environment for developing new features
2. Once the feature is finish you can build and send an APK to the QA team to verify the behavior


## DESIGN PATTERN
:::success
We are currently following the repository design pattern for the data layer,
https://medium.com/@pererikbergman/repository-design-pattern-e28c0f3e4a30
and MVVM for the presentation layer.
https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel
:::


The Diagram below is our current implementation
![image](https://firebasestorage.googleapis.com/v0/b/markjoseultra-website-port.appspot.com/o/flutter-arch-pattern.png?alt=media&token=49c4cac5-2286-4f1a-bc93-2f0c348c11ab)




## CODE DOCUMENTATION GUIDELINES
:::success
We are using [dartdoc](https://pub.dev/packages/dartdoc) to generate the HTML files for us.

for more reference check [Efficient Dart Code]("https://dart.dev/effective-dart")
:::

Doc comments format
1. Provide a short summary for each class or functions
2. Describe the parameters if available
3. Describe the errors returned

e.g.
```
  ///Caches the tokens in the local storage
  Future<void> cacheTokens({
    ///the Cognito access token it then get converted to ISO 8601 format and saved with the token
    required String accessToken,
    ///the Lambda token
    required String lambdaToken,
    ///The storage duration of the token before it expires
    Duration expirationDuration = const Duration(hours: 23),
  });
```

## BITBUCKET FLOW
<div style="width: 640px; height: 480px; margin: 10px; position: relative;"><iframe allowfullscreen frameborder="0" style="width:640px; height:480px" src="https://lucid.app/documents/embedded/f9fc74ef-e6ba-49f6-89bf-dfad6c9decb9" id="VyrfFWult9Jb"></iframe></div>



## DEPLOYMENT FLOW
<div style="width: 640px; height: 480px; margin: 10px; position: relative;"><iframe allowfullscreen frameborder="0" style="width:640px; height:480px" src="https://lucid.app/documents/embedded/575a2f7f-b400-44cd-8320-e2ca354c3025" id="hyrfvK0TvQGP"></iframe></div>

